From ad1190d51d5fa1421fbf4e6caca094ed23ab90bf Mon Sep 17 00:00:00 2001 From: Ikhsan Satriadi Date: Sun, 14 Jul 2024 20:13:49 +0700 Subject: [PATCH] feat: Tambah total status kehadiran di laporan Update config --- README.md | 2 +- app/Config/AbsensiSekolah.php | 2 +- app/Controllers/Admin/GenerateLaporan.php | 17 +++++--- .../admin/generate-laporan/laporan-guru.php | 40 ++++++++++++++++++- .../admin/generate-laporan/laporan-siswa.php | 40 ++++++++++++++++++- 5 files changed, 90 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3cfa510..b0497c6 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Aplikasi Web Sistem Absensi Sekolah Berbasis QR Code adalah sebuah proyek yang b > - Untuk mengubah identitas nama sekolah, buka file konfigurasi `app/Config/AbsensiSekolah.php` dan ubah pada: > > ```php -> public string $namaSekolah = 'SMK 1 Indonesia'; +> const SCHOOL_NAME = 'SMK 1 Indonesia'; > ``` > > - Ganti/replace logo sekolah di `public/assets/img/logo_sekolah.jpg`. diff --git a/app/Config/AbsensiSekolah.php b/app/Config/AbsensiSekolah.php index 1432c30..0fbc248 100644 --- a/app/Config/AbsensiSekolah.php +++ b/app/Config/AbsensiSekolah.php @@ -13,5 +13,5 @@ class AbsensiSekolah extends BaseConfig * * Pengaturan untuk nama sekolah */ - public string $namaSekolah = 'SMK 1 Indonesia'; + const SCHOOL_NAME = 'SMK 1 Indonesia'; } diff --git a/app/Controllers/Admin/GenerateLaporan.php b/app/Controllers/Admin/GenerateLaporan.php index c904790..06de387 100644 --- a/app/Controllers/Admin/GenerateLaporan.php +++ b/app/Controllers/Admin/GenerateLaporan.php @@ -37,7 +37,7 @@ public function __construct() $this->presensiSiswaModel = new PresensiSiswaModel(); $this->presensiGuruModel = new PresensiGuruModel(); - $this->namaSekolah = (new ConfigAbsensiSekolah)->namaSekolah; + $this->namaSekolah = ConfigAbsensiSekolah::SCHOOL_NAME; } public function index() @@ -76,7 +76,9 @@ public function generateLaporanSiswa() return redirect()->to('/admin/laporan'); } - $kelas = $this->kelasModel->where(['id_kelas' => $idKelas])->join('tb_jurusan', 'tb_kelas.id_jurusan = tb_jurusan.id', 'left')->first(); + $kelas = $this->kelasModel->where(['id_kelas' => $idKelas]) + ->join('tb_jurusan', 'tb_kelas.id_jurusan = tb_jurusan.id', 'left') + ->first(); $bulan = $this->request->getVar('tanggalSiswa'); @@ -129,10 +131,12 @@ public function generateLaporanSiswa() 'namaSekolah' => $this->namaSekolah ]; - if ($type == 'doc') { $this->response->setHeader('Content-type', 'application/vnd.ms-word'); - $this->response->setHeader('Content-Disposition', 'attachment;Filename=laporan_absen_' . $kelas['kelas'] . " " . $kelas['jurusan'] . '_' . $begin->format('F-Y') . '.doc'); + $this->response->setHeader( + 'Content-Disposition', + 'attachment;Filename=laporan_absen_' . $kelas['kelas'] . " " . $kelas['jurusan'] . '_' . $begin->format('F-Y') . '.doc' + ); return view('admin/generate-laporan/laporan-siswa', $data); } @@ -205,7 +209,10 @@ public function generateLaporanGuru() if ($type == 'doc') { $this->response->setHeader('Content-type', 'application/vnd.ms-word'); - $this->response->setHeader('Content-Disposition', 'attachment;Filename=laporan_absen_guru_' . $begin->format('F-Y') . '.doc'); + $this->response->setHeader( + 'Content-Disposition', + 'attachment;Filename=laporan_absen_guru_' . $begin->format('F-Y') . '.doc' + ); return view('admin/generate-laporan/laporan-guru', $data); } diff --git a/app/Views/admin/generate-laporan/laporan-guru.php b/app/Views/admin/generate-laporan/laporan-guru.php index 400255f..684a090 100644 --- a/app/Views/admin/generate-laporan/laporan-guru.php +++ b/app/Views/admin/generate-laporan/laporan-guru.php @@ -27,24 +27,60 @@ format('D'); ?> + Total - No - Nama + No + Nama format('d'); ?> + H + S + I + A + + + + + + + + + + + + + format('D'); ?> + Total - No - Nama + No + Nama format('d'); ?> + H + S + I + A + + + + + + + + + + + + +