From 7a0b79e73e24f899cd5a4f2e2b9b8671d03808fa Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Tue, 24 Feb 2026 08:41:04 +0700 Subject: [PATCH] Update Fix UI Certificate Maintenance Index --- app/Config/Routes.php | 7 + app/Controllers/Activities.php | 3 +- app/Controllers/Certificates.php | 1109 +++++-------------- app/Views/activities_editor.php | 62 +- app/Views/certificate_maintenance_index.php | 522 +++++---- app/Views/certificate_training_index.php | 391 ++++--- 6 files changed, 805 insertions(+), 1289 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b0c1094..0743c1c 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -217,6 +217,13 @@ $routes->group('certificates', function($routes) { $routes->get('calibration', 'Certificates::calibrateIndex'); $routes->get('maintenance', 'Certificates::maintenanceIndex'); + $routes->get('api/getindexmaintenance', 'Certificates::getDataIndexMaintenance'); + $routes->get('api/getindextraining', 'Certificates::getDataIndexTraining'); + + + $routes->post('validate', 'Certificates::validateCertificate'); + + // Untuk View Cerificate $routes->get('training/show/(:any)', 'Certificates::createTraining/$1'); $routes->get('calibration/show/(:any)/(:any)', 'Certificates::createCalibrate/$1/$2'); diff --git a/app/Controllers/Activities.php b/app/Controllers/Activities.php index f9f64c8..2aa7097 100644 --- a/app/Controllers/Activities.php +++ b/app/Controllers/Activities.php @@ -193,8 +193,6 @@ class Activities extends Controller { $data['sql'] = $sql; $data['tampildata'] = $result; - // dd($sql); - return view('activities_index', $data); } @@ -366,6 +364,7 @@ class Activities extends Controller { if( $this->request->getVar('siteid') != '' ) { $siteid = $this->request->getVar('siteid'); } if ($this->request->getMethod() === 'POST') { + // $allPostData = $this->request->getPost(); $rules = [ 'subject' => 'required', 'siteid' => 'required', diff --git a/app/Controllers/Certificates.php b/app/Controllers/Certificates.php index 614d665..adef85e 100644 --- a/app/Controllers/Certificates.php +++ b/app/Controllers/Certificates.php @@ -10,867 +10,114 @@ class Certificates extends BaseController { protected array $data; - // public function index() { - - // $certificates = [ - // [ - // 'certid' => 'CERT001', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-001', - // 'type' => 'calibration', - // 'issuedate' => '2024-01-15', - // 'expirydate' => '2025-01-15', - // 'vendor' => 'Summit Calibration Lab' - // ], - // [ - // 'certid' => 'CERT002', - // 'certname' => 'CL900i Operator Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-002', - // 'type' => 'training', - // 'issuedate' => '2024-03-20', - // 'expirydate' => '2025-03-20', - // 'vendor' => 'Summit Training Center' - // ], - // [ - // 'certid' => 'CERT003', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-003', - // 'type' => 'maintenance', - // 'issuedate' => '2024-06-10', - // 'expirydate' => '2024-12-10', - // 'vendor' => 'Summit Service Team' - // ] - // ]; - - // // Data dummy untuk products dropdown - // // $products = [ - // // ['productid' => '1', 'productname' => 'CL900i', 'productnumber' => 'SN-2024-001'], - // // ['productid' => '2', 'productname' => 'CL900i', 'productnumber' => 'SN-2024-002'], - // // ['productid' => '3', 'productname' => 'CL900i', 'productnumber' => 'SN-2024-003'] - // // ]; - - // $data = [ - // 'certificates' => $certificates, - // // 'products' => $products - // ]; - - // return view('certificate_index', $data); - // } - // public function view($certid = null) { - // if (!$certid) { - // return $this->response->setStatusCode(400)->setJSON(['error' => 'Certificate ID is required']); - // } - - // // Get certificate data from dummy data - // $certificates = [ - // [ - // 'certid' => 'CERT001', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-001', - // 'type' => 'calibration', - // 'issuedate' => '2024-01-15', - // 'expirydate' => '2025-01-15', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT002', - // 'certname' => 'CL900i Operator Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-002', - // 'type' => 'training', - // 'issuedate' => '2024-03-20', - // 'expirydate' => '2025-03-20', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Operator training completion certificate. Covers basic operation and safety procedures.' - // ], - // [ - // 'certid' => 'CERT003', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-003', - // 'type' => 'maintenance', - // 'issuedate' => '2024-06-10', - // 'expirydate' => '2024-12-10', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT004', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-004', - // 'type' => 'calibration', - // 'issuedate' => '2023-11-01', - // 'expirydate' => '2024-11-01', - // 'vendor' => 'External Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT005', - // 'certname' => 'CL900i Advanced Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-005', - // 'type' => 'training', - // 'issuedate' => '2024-05-15', - // 'expirydate' => '2025-05-15', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Advanced training completion certificate. Covers advanced operation and troubleshooting procedures.' - // ], - // [ - // 'certid' => 'CERT006', - // 'certname' => 'CL900i Annual Maintenance', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-006', - // 'type' => 'maintenance', - // 'issuedate' => '2024-01-01', - // 'expirydate' => '2025-01-01', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Annual maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT007', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-007', - // 'type' => 'calibration', - // 'issuedate' => '2024-02-28', - // 'expirydate' => '2025-02-28', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT008', - // 'certname' => 'CL900i Safety Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-008', - // 'type' => 'training', - // 'issuedate' => '2024-04-10', - // 'expirydate' => '2025-04-10', - // 'vendor' => 'External Safety Institute', - // 'description' => 'Safety training completion certificate. Covers safety procedures and emergency protocols.' - // ], - // [ - // 'certid' => 'CERT009', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-009', - // 'type' => 'calibration', - // 'issuedate' => '2024-07-20', - // 'expirydate' => '2025-07-20', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT010', - // 'certname' => 'CL900i Technical Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-010', - // 'type' => 'training', - // 'issuedate' => '2024-08-05', - // 'expirydate' => '2025-08-05', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Technical training completion certificate. Covers technical specifications and maintenance procedures.' - // ], - // [ - // 'certid' => 'CERT011', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-011', - // 'type' => 'maintenance', - // 'issuedate' => '2024-09-15', - // 'expirydate' => '2025-03-15', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT012', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-012', - // 'type' => 'calibration', - // 'issuedate' => '2024-10-01', - // 'expirydate' => '2025-10-01', - // 'vendor' => 'External Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT013', - // 'certname' => 'CL900i Basic Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-013', - // 'type' => 'training', - // 'issuedate' => '2024-11-20', - // 'expirydate' => '2025-11-20', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Basic training completion certificate. Covers basic operation procedures.' - // ], - // [ - // 'certid' => 'CERT014', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-014', - // 'type' => 'maintenance', - // 'issuedate' => '2024-12-01', - // 'expirydate' => '2025-06-01', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT015', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-015', - // 'type' => 'calibration', - // 'issuedate' => '2024-01-10', - // 'expirydate' => '2025-01-10', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT016', - // 'certname' => 'CL900i Operator Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-016', - // 'type' => 'training', - // 'issuedate' => '2024-02-15', - // 'expirydate' => '2025-02-15', - // 'vendor' => 'External Training Institute', - // 'description' => 'Operator training completion certificate. Covers basic operation and safety procedures.' - // ], - // [ - // 'certid' => 'CERT017', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-017', - // 'type' => 'maintenance', - // 'issuedate' => '2024-03-25', - // 'expirydate' => '2024-09-25', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT018', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-018', - // 'type' => 'calibration', - // 'issuedate' => '2024-04-30', - // 'expirydate' => '2025-04-30', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT019', - // 'certname' => 'CL900i Advanced Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-019', - // 'type' => 'training', - // 'issuedate' => '2024-05-20', - // 'expirydate' => '2025-05-20', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Advanced training completion certificate. Covers advanced operation and troubleshooting procedures.' - // ], - // [ - // 'certid' => 'CERT020', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-020', - // 'type' => 'maintenance', - // 'issuedate' => '2024-06-15', - // 'expirydate' => '2024-12-15', - // 'vendor' => 'External Service Provider', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT021', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-021', - // 'type' => 'calibration', - // 'issuedate' => '2024-07-10', - // 'expirydate' => '2025-07-10', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT022', - // 'certname' => 'CL900i Safety Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-022', - // 'type' => 'training', - // 'issuedate' => '2024-08-25', - // 'expirydate' => '2025-08-25', - // 'vendor' => 'External Safety Institute', - // 'description' => 'Safety training completion certificate. Covers safety procedures and emergency protocols.' - // ], - // [ - // 'certid' => 'CERT023', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-023', - // 'type' => 'maintenance', - // 'issuedate' => '2024-09-05', - // 'expirydate' => '2025-03-05', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT024', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-024', - // 'type' => 'calibration', - // 'issuedate' => '2024-10-15', - // 'expirydate' => '2025-10-15', - // 'vendor' => 'External Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT025', - // 'certname' => 'CL900i Technical Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-025', - // 'type' => 'training', - // 'issuedate' => '2024-11-10', - // 'expirydate' => '2025-11-10', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Technical training completion certificate. Covers technical specifications and maintenance procedures.' - // ], - // [ - // 'certid' => 'CERT026', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-026', - // 'type' => 'maintenance', - // 'issuedate' => '2024-12-20', - // 'expirydate' => '2025-06-20', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT027', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-027', - // 'type' => 'calibration', - // 'issuedate' => '2024-01-05', - // 'expirydate' => '2025-01-05', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ], - // [ - // 'certid' => 'CERT028', - // 'certname' => 'CL900i Operator Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-028', - // 'type' => 'training', - // 'issuedate' => '2024-02-20', - // 'expirydate' => '2025-02-20', - // 'vendor' => 'External Training Institute', - // 'description' => 'Operator training completion certificate. Covers basic operation and safety procedures.' - // ], - // [ - // 'certid' => 'CERT029', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-029', - // 'type' => 'maintenance', - // 'issuedate' => '2024-03-10', - // 'expirydate' => '2024-09-10', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment. All components checked and serviced.' - // ], - // [ - // 'certid' => 'CERT030', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-030', - // 'type' => 'calibration', - // 'issuedate' => '2024-04-25', - // 'expirydate' => '2025-04-25', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment. All parameters verified and within specifications.' - // ] - // ]; - - // $certificate = null; - // foreach ($certificates as $cert) { - // if ($cert['certid'] === $certid) { - // $certificate = $cert; - // break; - // } - // } - - // if (!$certificate) { - // return $this->response->setStatusCode(404)->setJSON(['error' => 'Certificate not found']); - // } - - // // Generate PDF based on type - // return $this->generatePDF($certificate, $certificate['type']); - // } - // public function get($certid = null) { - // $certificates = [ - // [ - // 'certid' => 'CERT001', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-001', - // 'type' => 'calibration', - // 'issuedate' => '2024-01-15', - // 'expirydate' => '2025-01-15', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT002', - // 'certname' => 'CL900i Operator Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-002', - // 'type' => 'training', - // 'issuedate' => '2024-03-20', - // 'expirydate' => '2025-03-20', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Operator training completion certificate.' - // ], - // [ - // 'certid' => 'CERT003', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-003', - // 'type' => 'maintenance', - // 'issuedate' => '2024-06-10', - // 'expirydate' => '2024-12-10', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT004', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-004', - // 'type' => 'calibration', - // 'issuedate' => '2023-11-01', - // 'expirydate' => '2024-11-01', - // 'vendor' => 'External Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT005', - // 'certname' => 'CL900i Advanced Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-005', - // 'type' => 'training', - // 'issuedate' => '2024-05-15', - // 'expirydate' => '2025-05-15', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Advanced training completion certificate.' - // ], - // [ - // 'certid' => 'CERT006', - // 'certname' => 'CL900i Annual Maintenance', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-006', - // 'type' => 'maintenance', - // 'issuedate' => '2024-01-01', - // 'expirydate' => '2025-01-01', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Annual maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT007', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-007', - // 'type' => 'calibration', - // 'issuedate' => '2024-02-28', - // 'expirydate' => '2025-02-28', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT008', - // 'certname' => 'CL900i Safety Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-008', - // 'type' => 'training', - // 'issuedate' => '2024-04-10', - // 'expirydate' => '2025-04-10', - // 'vendor' => 'External Safety Institute', - // 'description' => 'Safety training completion certificate.' - // ], - // [ - // 'certid' => 'CERT009', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-009', - // 'type' => 'calibration', - // 'issuedate' => '2024-07-20', - // 'expirydate' => '2025-07-20', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT010', - // 'certname' => 'CL900i Technical Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-010', - // 'type' => 'training', - // 'issuedate' => '2024-08-05', - // 'expirydate' => '2025-08-05', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Technical training completion certificate.' - // ], - // [ - // 'certid' => 'CERT011', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-011', - // 'type' => 'maintenance', - // 'issuedate' => '2024-09-15', - // 'expirydate' => '2025-03-15', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT012', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-012', - // 'type' => 'calibration', - // 'issuedate' => '2024-10-01', - // 'expirydate' => '2025-10-01', - // 'vendor' => 'External Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT013', - // 'certname' => 'CL900i Basic Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-013', - // 'type' => 'training', - // 'issuedate' => '2024-11-20', - // 'expirydate' => '2025-11-20', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Basic training completion certificate.' - // ], - // [ - // 'certid' => 'CERT014', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-014', - // 'type' => 'maintenance', - // 'issuedate' => '2024-12-01', - // 'expirydate' => '2025-06-01', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT015', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-015', - // 'type' => 'calibration', - // 'issuedate' => '2024-01-10', - // 'expirydate' => '2025-01-10', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT016', - // 'certname' => 'CL900i Operator Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-016', - // 'type' => 'training', - // 'issuedate' => '2024-02-15', - // 'expirydate' => '2025-02-15', - // 'vendor' => 'External Training Institute', - // 'description' => 'Operator training completion certificate.' - // ], - // [ - // 'certid' => 'CERT017', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-017', - // 'type' => 'maintenance', - // 'issuedate' => '2024-03-25', - // 'expirydate' => '2024-09-25', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT018', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-018', - // 'type' => 'calibration', - // 'issuedate' => '2024-04-30', - // 'expirydate' => '2025-04-30', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT019', - // 'certname' => 'CL900i Advanced Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-019', - // 'type' => 'training', - // 'issuedate' => '2024-05-20', - // 'expirydate' => '2025-05-20', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Advanced training completion certificate.' - // ], - // [ - // 'certid' => 'CERT020', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-020', - // 'type' => 'maintenance', - // 'issuedate' => '2024-06-15', - // 'expirydate' => '2024-12-15', - // 'vendor' => 'External Service Provider', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT021', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-021', - // 'type' => 'calibration', - // 'issuedate' => '2024-07-10', - // 'expirydate' => '2025-07-10', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT022', - // 'certname' => 'CL900i Safety Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-022', - // 'type' => 'training', - // 'issuedate' => '2024-08-25', - // 'expirydate' => '2025-08-25', - // 'vendor' => 'External Safety Institute', - // 'description' => 'Safety training completion certificate.' - // ], - // [ - // 'certid' => 'CERT023', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-023', - // 'type' => 'maintenance', - // 'issuedate' => '2024-09-05', - // 'expirydate' => '2025-03-05', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT024', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-024', - // 'type' => 'calibration', - // 'issuedate' => '2024-10-15', - // 'expirydate' => '2025-10-15', - // 'vendor' => 'External Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT025', - // 'certname' => 'CL900i Technical Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-025', - // 'type' => 'training', - // 'issuedate' => '2024-11-10', - // 'expirydate' => '2025-11-10', - // 'vendor' => 'Summit Training Center', - // 'description' => 'Technical training completion certificate.' - // ], - // [ - // 'certid' => 'CERT026', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-026', - // 'type' => 'maintenance', - // 'issuedate' => '2024-12-20', - // 'expirydate' => '2025-06-20', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT027', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-027', - // 'type' => 'calibration', - // 'issuedate' => '2024-01-05', - // 'expirydate' => '2025-01-05', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT028', - // 'certname' => 'CL900i Operator Training', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-028', - // 'type' => 'training', - // 'issuedate' => '2024-02-20', - // 'expirydate' => '2025-02-20', - // 'vendor' => 'External Training Institute', - // 'description' => 'Operator training completion certificate.' - // ], - // [ - // 'certid' => 'CERT029', - // 'certname' => 'CL900i Maintenance Record', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-029', - // 'type' => 'maintenance', - // 'issuedate' => '2024-03-10', - // 'expirydate' => '2024-09-10', - // 'vendor' => 'Summit Service Team', - // 'description' => 'Regular maintenance record for CL900i equipment.' - // ], - // [ - // 'certid' => 'CERT030', - // 'certname' => 'CL900i Calibration Certificate', - // 'productname' => 'CL900i', - // 'productnumber' => 'SN-2024-030', - // 'type' => 'calibration', - // 'issuedate' => '2024-04-25', - // 'expirydate' => '2025-04-25', - // 'vendor' => 'Summit Calibration Lab', - // 'description' => 'Annual calibration certificate for CL900i equipment.' - // ] - // ]; - - // foreach ($certificates as $cert) { - // if ($cert['certid'] === $certid) { - // return $this->response->setJSON($cert); - // } - // } - - // return $this->response->setStatusCode(404)->setJSON(['error' => 'Certificate not found']); - // } - - // Untuk Tampilan List Sertifikat + // Halaman Utama + public function maintenanceIndex() { + return view('certificate_maintenance_index'); + } public function trainingIndex() { - - $certificates = [ - [ - 'certid' => 'CERT002', - 'certname' => 'Jokoh Calibration Certificate', - 'productname' => 'Jokoh', - 'productnumber' => 'SN-2024-001', - 'issuedate' => '2024-01-15', - 'expirydate' => '2025-01-15', - 'vendor' => 'Summit Calibration Lab' - ] - ]; - $data = ['certificates' => $certificates]; - - return view('certificate_training_index', $data); + return view('certificate_training_index'); } public function calibrateIndex() { $certificates = [ - [ - 'certid' => 'CERT001', - 'certname' => 'TMS50i Calibration Certificate', - 'productname' => 'tms50i', - 'productnumber' => 'SN-2024-001', - 'type' => 'calibration', - 'issuedate' => '2024-01-15', - 'expirydate' => '2025-01-15', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for TMS50i equipment.' - ], - [ - 'certid' => 'CERT002', - 'certname' => 'TMS24i Calibration Certificate', - 'productname' => 'tms24i', - 'productnumber' => 'SN-2024-002', - 'type' => 'calibration', - 'issuedate' => '2024-01-16', - 'expirydate' => '2025-01-16', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for tms24i equipment.' - ], - [ - 'certid' => 'CERT003', - 'certname' => 'tms30i Calibration Certificate', - 'productname' => 'tms30i', - 'productnumber' => 'SN-2024-003', - 'type' => 'calibration', - 'issuedate' => '2024-01-17', - 'expirydate' => '2025-01-17', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for tms30i equipment.' - ], - [ - 'certid' => 'CERT004', - 'certname' => 'BS430 Calibration Certificate', - 'productname' => 'bs430', - 'productnumber' => 'SN-2024-004', - 'type' => 'calibration', - 'issuedate' => '2024-01-18', - 'expirydate' => '2025-01-18', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for BS430 equipment.' - ], - [ - 'certid' => 'CERT005', - 'certname' => 'CL900i Calibration Certificate', - 'productname' => 'cl900i', - 'productnumber' => 'SN-2024-005', - 'type' => 'calibration', - 'issuedate' => '2024-01-19', - 'expirydate' => '2025-01-19', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for CL900i equipment.' - ], - [ - 'certid' => 'CERT006', - 'certname' => 'Jokoh Calibration Certificate', - 'productname' => 'jokoh', - 'productnumber' => 'SN-2024-006', - 'type' => 'calibration', - 'issuedate' => '2024-01-20', - 'expirydate' => '2025-01-20', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for Jokoh equipment.' - ], - [ - 'certid' => 'CERT007', - 'certname' => 'BC760R Calibration Certificate', - 'productname' => 'bc760r', - 'productnumber' => 'SN-2024-007', - 'type' => 'calibration', - 'issuedate' => '2024-01-21', - 'expirydate' => '2025-01-21', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for BC760R equipment.' - ], - [ - 'certid' => 'CERT008', - 'certname' => 'BC5140 Calibration Certificate', - 'productname' => 'bc5140', - 'productnumber' => 'SN-2024-008', - 'type' => 'calibration', - 'issuedate' => '2024-01-22', - 'expirydate' => '2025-01-22', - 'vendor' => 'Summit Calibration Lab', - 'description' => 'Annual calibration certificate for BC5140 equipment.' - ], + // [ + // 'certid' => 'CERT001', + // 'certname' => 'TMS50i Calibration Certificate', + // 'productname' => 'tms50i', + // 'productnumber' => 'SN-2024-001', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-15', + // 'expirydate' => '2025-01-15', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for TMS50i equipment.' + // ], + // [ + // 'certid' => 'CERT002', + // 'certname' => 'TMS24i Calibration Certificate', + // 'productname' => 'tms24i', + // 'productnumber' => 'SN-2024-002', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-16', + // 'expirydate' => '2025-01-16', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for tms24i equipment.' + // ], + // [ + // 'certid' => 'CERT003', + // 'certname' => 'tms30i Calibration Certificate', + // 'productname' => 'tms30i', + // 'productnumber' => 'SN-2024-003', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-17', + // 'expirydate' => '2025-01-17', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for tms30i equipment.' + // ], + // [ + // 'certid' => 'CERT004', + // 'certname' => 'BS430 Calibration Certificate', + // 'productname' => 'bs430', + // 'productnumber' => 'SN-2024-004', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-18', + // 'expirydate' => '2025-01-18', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for BS430 equipment.' + // ], + // [ + // 'certid' => 'CERT005', + // 'certname' => 'CL900i Calibration Certificate', + // 'productname' => 'cl900i', + // 'productnumber' => 'SN-2024-005', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-19', + // 'expirydate' => '2025-01-19', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for CL900i equipment.' + // ], + // [ + // 'certid' => 'CERT006', + // 'certname' => 'Jokoh Calibration Certificate', + // 'productname' => 'jokoh', + // 'productnumber' => 'SN-2024-006', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-20', + // 'expirydate' => '2025-01-20', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for Jokoh equipment.' + // ], + // [ + // 'certid' => 'CERT007', + // 'certname' => 'BC760R Calibration Certificate', + // 'productname' => 'bc760r', + // 'productnumber' => 'SN-2024-007', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-21', + // 'expirydate' => '2025-01-21', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for BC760R equipment.' + // ], + // [ + // 'certid' => 'CERT008', + // 'certname' => 'BC5140 Calibration Certificate', + // 'productname' => 'bc5140', + // 'productnumber' => 'SN-2024-008', + // 'type' => 'calibration', + // 'issuedate' => '2024-01-22', + // 'expirydate' => '2025-01-22', + // 'vendor' => 'Summit Calibration Lab', + // 'description' => 'Annual calibration certificate for BC5140 equipment.' + // ], ]; $data = ['certificates' => $certificates]; return view('certificate_calibration_index', $data); } - public function maintenanceIndex() { + + + // Untuk API Get Data + public function getDataIndexMaintenance() { + // $actid = $this->request->getVar('actid'); $certificates = [ [ @@ -880,14 +127,166 @@ class Certificates extends BaseController { 'productnumber' => 'SN-2024-001', 'issuedate' => '2024-01-15', 'expirydate' => '2025-01-15', - 'vendor' => 'Summit Calibration Lab' + 'vendor' => 'Summit Calibration Lab', + 'isval' => null + ], + [ + 'certid' => 'CERT002', + 'certname' => 'Installation Certificate - Sysmex XN', + 'productname' => 'Sysmex', + 'productnumber' => 'XN-1000-5521', + 'issuedate' => '2024-02-10', + 'expirydate' => '2026-02-10', + 'vendor' => 'Global Medika Indonesia', + 'isval' => '2026-03-01' + ], + [ + 'certid' => 'CERT003', + 'certname' => 'Maintenance Certificate Q3', + 'productname' => 'Mindray BC-5380', + 'productnumber' => 'MR-5380-BC88', + 'issuedate' => '2024-03-05', + 'expirydate' => '2024-09-05', + 'vendor' => 'Citra Sehat Teknik', + 'isval' => '2026-03-01' + ], + [ + 'certid' => 'CERT004', + 'certname' => 'User Training - Hematology Analyzer', + 'productname' => 'Beckman Coulter', + 'productnumber' => 'BC-DXH-900', + 'issuedate' => '2024-05-20', + 'expirydate' => '2027-05-20', + 'vendor' => 'Bio-Rad Laboratories', + 'isval' => '2026-03-01' + ], + [ + 'certid' => 'CERT005', + 'certname' => 'Electrical Safety Test', + 'productname' => 'GE Healthcare VIVID', + 'productnumber' => 'GE-VIV-Q992', + 'issuedate' => '2024-06-12', + 'expirydate' => '2026-03-01', + 'vendor' => 'Pramita Medika Service', + 'isval' => '2026-03-01' + ], + [ + 'certid' => 'CERT005', + 'certname' => 'Electrical Safety Test', + 'productname' => 'GE Healthcare VIVID', + 'productnumber' => 'GE-VIV-Q992', + 'issuedate' => '2024-06-12', + 'expirydate' => '2026-03-01', + 'vendor' => 'Pramita Medika Service', + 'isval' => null ] ]; - $data = ['certificates' => $certificates]; - return view('certificate_maintenance_index', $data); + // If actid is provided, return specific certificate + // if ($actid) { + // $result = null; + // foreach ($certificates as $cert) { + // if ($cert['certid'] === $actid) { + // $result = $cert; + // break; + // } + // } + // return $this->response->setJSON($result); + // } + + // If no actid, return all certificates + if (empty($certificates)) { + return $this->response->setJSON(null); + } + + return $this->response->setJSON($certificates); } + public function getDataIndexTraining() { + // $actid = $this->request->getVar('actid'); + + // Sample data - replace with actual database query + $certificates = [ + [ + 'certid' => 'CERT001', + 'certname' => 'Jokoh Calibration Certificate', + 'productname' => 'Jokoh', + 'productnumber' => 'SN-2024-001', + 'issuedate' => '2024-01-15', + 'expirydate' => '2025-01-15', + 'vendor' => 'Summit Calibration Lab', + 'type' => 'joko', + 'sitename' => 'Jakarta Office', + 'siteid' => 'SITE001' + ], + [ + 'certid' => 'CERT002', + 'certname' => 'TMS50i Calibration Certificate', + 'productname' => 'TMS50i', + 'productnumber' => 'SN-2024-002', + 'issuedate' => '2024-02-15', + 'expirydate' => '2025-02-15', + 'vendor' => 'Summit Calibration Lab', + 'type' => 'tms', + 'sitename' => 'Surabaya Office', + 'siteid' => 'SITE002' + ], + [ + 'certid' => 'CERT003', + 'certname' => 'Tokyo Boeki Calibration Certificate', + 'productname' => 'Tokyo Boeki', + 'productnumber' => 'SN-2024-003', + 'issuedate' => '2024-03-15', + 'expirydate' => '2025-03-15', + 'vendor' => 'Summit Calibration Lab', + 'type' => 'boeki', + 'sitename' => 'Bandung Office', + 'siteid' => 'SITE003' + ] + ]; + + // If actid is provided, return specific certificate + // if ($actid) { + // $result = null; + // foreach ($certificates as $cert) { + // if ($cert['certid'] === $actid) { + // $result = $cert; + // break; + // } + // } + // return $this->response->setJSON($result); + // } + + // If no actid, return all certificates + if (empty($certificates)) { + return $this->response->setJSON(null); + } + + return $this->response->setJSON($certificates); + } + + + public function validateCertificate() { + $certid = $this->request->getPost('certid'); + $certificateType = $this->request->getPost('certificateType'); + + // if (!$certid) { + // return $this->response->setJSON([ + // 'success' => false, + // 'message' => 'Certificate ID is required' + // ]); + // } + + } + + + + + + + + + public function createTraining($certid = null) { if (!$certid) { return $this->response->setStatusCode(400)->setJSON(['error' => 'Certificate ID is required']); @@ -896,7 +295,7 @@ class Certificates extends BaseController { // Get certificate data $certificates = [ [ - 'certid' => 'CERT002', + 'certid' => 'CERT001', 'certname' => 'Jokoh Training Certificate', 'productname' => 'Jokoh', 'productnumber' => 'SN-2024-001', diff --git a/app/Views/activities_editor.php b/app/Views/activities_editor.php index f099f4d..7530a17 100644 --- a/app/Views/activities_editor.php +++ b/app/Views/activities_editor.php @@ -174,8 +174,8 @@ if(isset($data)) {
- -
+
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
@@ -244,6 +293,7 @@ if(isset($data)) {
+
@@ -315,6 +365,7 @@ if(isset($data)) {
+
@@ -694,6 +745,13 @@ $('#status').change(function() { else { $(".closedate").prop('disabled', false); $("#opendate").prop('disabled', false);} }) +$("#maintenance").prop('disabled', true); $("#calibration").prop('disabled', true); $("#installation").prop('disabled', true); $("#offreport").prop('disabled', true); $("#training").prop('disabled', true); +$('#acttypeid').change(function() { + if (this.value=='5'){ $("#maintenance").prop('disabled', false); $("#calibration").prop('disabled', true); $("#installation").prop('disabled', true); $("#offreport").prop('disabled', true); $("#training").prop('disabled', true);} + else if (this.value=='3'){ $("#maintenance").prop('disabled', true); $("#calibration").prop('disabled', false); $("#installation").prop('disabled', false); $("#offreport").prop('disabled', false); $("#training").prop('disabled', false); } + else { $("#maintenance").prop('disabled', true); $("#calibration").prop('disabled', true); $("#installation").prop('disabled', true); $("#offreport").prop('disabled', true); $("#training").prop('disabled', true);} +}) + // reportdate change => opendate.value = reportdate.value $('#reportdate').change(function() { $('#opendate').val(this.value); diff --git a/app/Views/certificate_maintenance_index.php b/app/Views/certificate_maintenance_index.php index 50fccb3..ba6d027 100644 --- a/app/Views/certificate_maintenance_index.php +++ b/app/Views/certificate_maintenance_index.php @@ -28,6 +28,7 @@ +
@@ -45,105 +46,23 @@
-
- -
- -
- - - - - - - - - - - - - - - Expired'; - $statusClass = 'expired'; - } elseif($daysUntilExpiry <= 30) { - $statusBadge = 'Expiring Soon'; - $statusClass = 'expiring'; - } else { - $statusBadge = 'Active'; - $statusClass = 'active'; - } - } else { - $expirydate = '-'; - $statusBadge = 'N/A'; - $statusClass = ''; - } - ?> - - - - - - - - - - - - -
NoCertificate NameProduct/EquipmentIssue DateExpiry DateStatusVendorAction
- -
- ID: -
- - -
SN: - - -
-
- -
-
+ +
+ + + + + + + + + + + + + + +
Certificate NameProduct/EquipmentActivity ReportIssue DateExpiry DateStatusAction
@@ -152,210 +71,271 @@ - -