From 1ec3cae51e279aec5e2713c29d5c000c7e165c3f Mon Sep 17 00:00:00 2001 From: Farrel Augusta Dinata Date: Fri, 20 Dec 2024 09:24:23 +0700 Subject: [PATCH 1/2] add: new SQL query to get data based on status 'diajukan' --- app/controllers/HomeController.php | 4 ++-- app/repository/BerkasProdiRepository.php | 27 ++++++++++++++++++++++++ app/repository/BerkasTARepository.php | 27 ++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index cd668df..a93fa1e 100644 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -40,7 +40,7 @@ public function viewDashboard(): void switch ($_SESSION['role']) { case 'Admin Prodi': $statistic_request = StatistikRepository::getStatisticRequest('Prodi'); - $all_req_verif = BerkasProdiRepository::getAllBerkasProdiReq(); + $all_req_verif = BerkasProdiRepository::getAllSubmittedBerkasProdi(); $this->view("templates/header", $data); $this->view("pages/admin_prodi/dashboard", [ 'statistic_request' => $statistic_request, @@ -51,7 +51,7 @@ public function viewDashboard(): void break; case 'Admin TA': $statistic_request = StatistikRepository::getStatisticRequest('TA'); - $all_req_verif = BerkasTARepository::getAllBerkasTAReq(); + $all_req_verif = BerkasTARepository::getAllSubmittedBerkasTA(); $this->view("templates/header", $data); $this->view("pages/admin_ta/dashboard", [ 'statistic_request' => $statistic_request, diff --git a/app/repository/BerkasProdiRepository.php b/app/repository/BerkasProdiRepository.php index f1d6a8e..49c3991 100644 --- a/app/repository/BerkasProdiRepository.php +++ b/app/repository/BerkasProdiRepository.php @@ -77,6 +77,33 @@ public static function getAllBerkasProdiReq(): array } } + public static function getAllSubmittedBerkasProdi(): array + { + try { + return Database::getConnection() + ->query(<<fetchAll(\PDO::FETCH_CLASS, BerkasPengajuan::class); + } catch (\PDOException $e) { + error_log(ErrorLog::formattedErrorLog($e->getMessage()), 3, LOG_FILE_PATH); + throw new \PDOException($e->getMessage()); + } + } + public static function getSingleBerkasProdiReq(int $id_verifikasi): bool|DetailBerkasProdiPengajuan { try { diff --git a/app/repository/BerkasTARepository.php b/app/repository/BerkasTARepository.php index b1c1e88..3598d83 100644 --- a/app/repository/BerkasTARepository.php +++ b/app/repository/BerkasTARepository.php @@ -76,6 +76,33 @@ public static function getAllBerkasTAReq(): array } } + public static function getAllSubmittedBerkasTA(): array + { + try { + return Database::getConnection() + ->query(<<fetchAll(\PDO::FETCH_CLASS, BerkasPengajuan::class); + } catch (\PDOException $e) { + error_log(ErrorLog::formattedErrorLog($e->getMessage()), 3, LOG_FILE_PATH); + throw new \PDOException($e->getMessage()); + } + } + public static function getSingleBerkasTAReq(int $id_verifikasi): bool|DetailBerkasTAPengajuan { From f57b2beb6017f522aaf634bedf0d57c53ae930cd Mon Sep 17 00:00:00 2001 From: Farrel Augusta Dinata Date: Sat, 21 Dec 2024 22:13:44 +0700 Subject: [PATCH 2/2] add gitattributes to exclude sql file --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f374256 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sql linguist-vendored \ No newline at end of file