Update Fitur Installation

This commit is contained in:
mikael-zakaria 2026-03-10 09:38:42 +07:00
parent 035def9d33
commit d365e36dde
4 changed files with 49 additions and 65 deletions

View File

@ -19,7 +19,7 @@ class Certificates extends BaseController {
public function installationIndex() { // Index
return view('certificate_installation_index');
}
public function getDataIndexInstallation() { // Untuk API Get Data
public function getDataIndexMaintenance() {
$userPosId = session()->get('userposid');
$userId = session()->get('userid');
@ -43,7 +43,7 @@ class Certificates extends BaseController {
')
->join('activities', 'activities.actid = certificates.actid', 'left')
->join('users', 'users.userid = certificates.user_id', 'left')
->where('certificates.cert_type', 'BAI');
->where('certificates.cert_type', 'IC');;
// 2. Filter berdasarkan Role
if (in_array($userPosId, [1, 3, 5])) { // Manager & IT: Tidak perlu filter tambahan (lihat semua)
@ -64,31 +64,6 @@ class Certificates extends BaseController {
return $this->response->setJSON($allData);
}
public function createinstallationPreview($certid = null) { // Untuk Preview Sertifikat
//Melakukan search data dari database
if (!$certid) {
return $this->response->setStatusCode(400)->setJSON(['error' => 'Certificate ID is required']);
}
// Get certificate data Berdasarkan certid
$certificate = [
'certid' => 'f353ca91-4fc5-49f2-9b9e-304f83d11914',
'certname' => 'Jokoh Calibration Certificate',
'productname' => 'Jokoh',
'productnumber' => 'SN-2024-001',
'issuedate' => '2024-01-15',
'expirydate' => '2025-01-15',
'vendor' => 'Summit Calibration Lab',
'isval' => null
];
if (empty($certificate)) { // JIka Tidak Ada
return $this->response->setStatusCode(404)->setJSON(['error' => 'Maintenance certificate not found']);
}
return $this->previewPdf($certificate, 'installation'); // Preview PDF
}
// Untuk Sertifikat Maintenance [2]
@ -725,7 +700,8 @@ class Certificates extends BaseController {
'metadata_keywords' => $certificate['certtype'] . ' Certificate'
];
}
public function view($uuid) {
public function view($uuid) { // Untuk lihat Sertifikat
try {
$certificateModel = new CertificateModel();

View File

@ -395,7 +395,7 @@ $(function () {
'<?= base_url('certificates/api/showmaintenance') ?>',
{ certid },
function (data) {
console.log(data);
// console.log(data);
// Populate modal with data
$('#modalCertName').text(data.cert_name || '-');
$('#modalCertNumber').text(data.cert_number || '-');

View File

@ -2,14 +2,15 @@
<html>
<head>
<meta charset="utf-8">
<title>Maintenance Installation - <?= $certificate['certname'] ?></title>
<title><?= $certificate['certname'] ?></title>
<style>
@page {
margin: 0;
padding: 0;
}
body {
font-family: Arial;
/* font-family: Arial; */
font-family: Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
/* font-size: 12px; */
@ -51,8 +52,8 @@
text-align: center;
margin: 0;
padding: 0;
margin-top: 230px;
margin-bottom: 25px;
margin-top: 235px;
margin-bottom: 20px;
}
.site-name {
text-align: center;
@ -60,7 +61,8 @@
}
.detail-information {
text-align: center;
margin-bottom: 137px;
/* margin-bottom: 137px; */
margin-bottom: 26px;
}
h4 {
margin :0;
@ -73,7 +75,7 @@
.signature-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 0px;
margin-bottom: 23px;
}
.signature-table td {
width: 50%; /* Membagi dua sisi sama rata */
@ -97,87 +99,93 @@
</style>
</head>
<body>
<div class="bg-container">
<!-- Untuk DEV -->
<!-- <div class="bg-container">
<img src="<?=base_url();?>/assets/images/background_certificate/maintenance.jpeg">
</div> -->
<!-- Untuk PROD -->
<div class="bg-container">
<?php $bgPath = FCPATH . 'assets/images/background_certificate/maintenance.jpeg'; ?>
<img src="<?php echo($bgPath) ?>">
</div>
<div class="container">
<div class="instument-name">
<h1> &lt;&lt;Nama Alat&gt;&gt; </h1>
<h1><?= $certificate['productname'] ?></h1>
</div>
<div class="site-name">
<h1> at &lt;&lt;Nama Rumah Sakit / Laboratorium - Kota&gt;&gt; </h1>
<h1> at <?= $certificate['sitename'] ?> </h1>
</div>
<div class="detail-information">
<h4>Serial Number: &lt;&lt;Serial Number&gt;&gt;</h4>
<h4>Serial Number: <?= $certificate['productnumber'] ?></h4>
<h4>has completed through a series of &lt;&lt;Jenis Sertifikat&gt;&gt;</h4>
<h4>has completed through a series of <?= $certificate['certtype'] ?></h4>
<h4>and the final result:</h4>
<h2>PASSED</h2>
<h4>Date of &lt;&lt;Jenis Sertifikat&gt;&gt; and Inspection: &lt;&lt;Tanggal Terbit&gt;&gt;</h4>
<h4>&lt;&lt;Valid&gt;&gt; &lt;&lt;Tanggal Berakhir&gt;&gt;</h4>
<h4>Date of Instrument Maintenance and Inspection: <?= $certificate['issueddate'] ?></h4>
<!-- <h4>Valid until <?= $certificate['expireddate'] ?></h4> -->
</div>
<table class="signature-table">
<tr>
<td>
<img src="<?= $certificate['qrcode'] ?>">
</td>
<!-- <td>
<span class="name">Adhitya Pranata Putra</span>
<span class="position">Technical Support Manager</span>
</td>
</td> -->
<td>
<span class="name">&lt;&lt;Nama TSO&gt;&gt;</span>
<span class="position">&lt;&lt;Jabatan&gt;&gt;</span>
</td>
<!-- <td>
<span class="name"></span>
<span class="position"></span>
</td> -->
</tr>
</table>
<div class="fo-wrapper">
<p>&lt;&lt;FO&gt;&gt;</p>
<p>FO.IV.01/20.00/2020</p>
</div>
</div>
<!-- Untuk Tanda Export PDF atau tidak -->
<?php if (!isset($certificate['exportToPDF'])) : ?>
<div class="container">
<div class="instument-name">
<h1> &lt;&lt;Nama Alat&gt;&gt; </h1>
<h1><?= $certificate['productname'] ?></h1>
</div>
<div class="site-name">
<h1> at &lt;&lt;Nama Rumah Sakit / Laboratorium - Kota&gt;&gt; </h1>
<h1> at <?= $certificate['sitename'] ?> </h1>
</div>
<div class="detail-information">
<h4>Serial Number: &lt;&lt;Serial Number&gt;&gt;</h4>
<h4>Serial Number: <?= $certificate['productnumber'] ?></h4>
<h4>has completed through a series of &lt;&lt;Jenis Sertifikat&gt;&gt;</h4>
<h4>has completed through a series of <?= $certificate['certtype'] ?></h4>
<h4>and the final result:</h4>
<h2>PASSED</h2>
<h4>Date of &lt;&lt;Jenis Sertifikat&gt;&gt; and Inspection: &lt;&lt;Tanggal Terbit&gt;&gt;</h4>
<h4>&lt;&lt;Valid&gt;&gt; &lt;&lt;Tanggal Berakhir&gt;&gt;</h4>
<h4>Date of Instrument Maintenance and Inspection: <?= $certificate['issueddate'] ?></h4>
<!-- <h4>Valid until <?= $certificate['expireddate'] ?></h4> -->
</div>
<table class="signature-table">
<tr>
<td>
<span class="name">Adhitya Pranata Putra</span>
<span class="position">Technical Support Manager</span>
</td>
<td>
<span class="name">&lt;&lt;Nama TSO&gt;&gt;</span>
<span class="position">&lt;&lt;Jabatan&gt;&gt;</span>
<img src="<?= $certificate['qrcode'] ?>">
</td>
</tr>
</table>
<div class="fo-wrapper">
<p>&lt;&lt;FO&gt;&gt;</p>
<p>FO.IV.01/20.00/2020</p>
</div>
</div>
<?php endif ?>
</body>
</html>

View File

@ -40,8 +40,8 @@
<li> <a class="has-arrow waves-effect waves-dark" href='javascript:void(0)' aria-expanded="false"> <i class="fa-solid fa-certificate"></i><span class='hide-menu'>Certificates</span> </a>
<ul aria-expanded="false" class="collapse">
<li><a href="<?=base_url();?>certificates/maintenance">Maintenance</a></li>
<li><a href="<?=base_url();?>certificates/installation">Installation</a></li>
<li><a href="<?=base_url();?>certificates/maintenance">Maintenance</a></li>
<!-- <li><a href="<?=base_url();?>certificates/training">Training</a></li> -->
<!-- <li><a href="<?=base_url();?>certificates/calibration">Callibration</a></li> -->
<!-- <li><a href="<?=base_url();?>certificates/official-report">Official Report</a></li> -->