From 4a3c0392d0aea1768e35d7ef5783da2da011b75a Mon Sep 17 00:00:00 2001 From: arie wira kusuma baru Date: Tue, 11 Mar 2025 16:43:54 +0800 Subject: [PATCH] fix: :bug: filter laporan, dan cetak laporan menggunakan session filter laporan, dan cetak laporan menggunakan session, file yang di modifikasi : sertifikat.php, laporan.php, halaman_utama.php, logout.php --- cetak/laporan/laporan.php | 7 ++++--- logout.php | 1 + tampilan/halaman_utama.php | 1 + tampilan/sertifikat.php | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cetak/laporan/laporan.php b/cetak/laporan/laporan.php index ac0029c..afe31d9 100644 --- a/cetak/laporan/laporan.php +++ b/cetak/laporan/laporan.php @@ -1,13 +1,14 @@ AddPage(); // ===== HEADER (KOP SURAT) ===== // -$pdf->Image('../../gambar/logoti.png', 10, 6, 20); // Logo +// $pdf->Image('../../gambar/logoti.png', 10, 6, 20); // Logo $pdf->SetFont('Arial', 'B', 14); $pdf->Cell(190, 7, 'SMK TI Bali Global Denpasar', 0, 1, 'C'); $pdf->SetFont('Arial', '', 12); @@ -88,8 +89,8 @@ function tampilRekapKegiatan($pdf, $koneksi, $angkatan = NULL, $status = NULL) { } // ===== Panggil Fungsi Berdasarkan Filter User ===== // -$angkatan = isset($_COOKIE['angkatan']) ? $_COOKIE['angkatan'] : 'semua'; -$status = isset($_COOKIE['status']) ? $_COOKIE['status'] : 'semua'; +$angkatan = isset($_SESSION['angkatan']) ? $_SESSION['angkatan'] : 'semua'; +$status = isset($_SESSION['status']) ? $_SESSION['status'] : 'semua'; if ($angkatan == 'semua' && $status == 'semua') { $result_angkatan = mysqli_query($koneksi, "SELECT DISTINCT Angkatan FROM siswa ORDER BY Angkatan ASC"); diff --git a/logout.php b/logout.php index 403a8a9..cb46ff5 100755 --- a/logout.php +++ b/logout.php @@ -5,5 +5,6 @@ setcookie('nama_lengkap', '', time(), '/'); setcookie('nis', '', time(), '/'); setcookie('angkatan', '', time(), '/'); setcookie('status', '', time(), '/'); +session_destroy(); echo ""; ?> \ No newline at end of file diff --git a/tampilan/halaman_utama.php b/tampilan/halaman_utama.php index 0b3e03d..459ed5e 100755 --- a/tampilan/halaman_utama.php +++ b/tampilan/halaman_utama.php @@ -1,5 +1,6 @@ diff --git a/tampilan/sertifikat.php b/tampilan/sertifikat.php index a3ea4a5..09f8ab6 100755 --- a/tampilan/sertifikat.php +++ b/tampilan/sertifikat.php @@ -56,8 +56,10 @@ function getSertifikat($koneksi, $status = '', $kegiatan = '') { if(@$_POST['tombol_cetak_laporan']){ - setcookie('angkatan', $_POST['angkatan'], time() + (60 * 60 * 24 * 7), '/'); - setcookie('status', $_POST['status'], time() + (60 * 60 * 24 * 7), '/'); + $_SESSION['angkatan'] = $_POST['angkatan']; + $_SESSION['status'] = $_POST['status']; + // setcookie('angkatan', $_POST['angkatan'], time() + (60 * 60 * 24 * 7), '/'); + // setcookie('status', $_POST['status'], time() + (60 * 60 * 24 * 7), '/'); echo ""; }