31 lines
4.5 KiB
PHP
31 lines
4.5 KiB
PHP
<?php
|
|
$inventory_title='Detail Peralatan Teknisi';
|
|
$inventory_subtitle='Saldo barang aktif dan riwayat perubahan status yang dapat ditelusuri.';
|
|
$this->load->view('inventory_professional/_module_nav',get_defined_vars());
|
|
?>
|
|
<div class="container-fluid px-3 mt-3">
|
|
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
|
|
<div><h4 class="mb-1">Detail Peralatan Teknisi</h4><p class="text-muted mb-0">Kelola barang dibawa, dipasang, dan dikembalikan tanpa menghilangkan histori.</p></div>
|
|
<div class="d-flex gap-2"><a href="<?=base_url('teknisi')?>" class="btn btn-outline-secondary"><i class="bi bi-arrow-left me-1"></i>Kembali</a><?php if($can_export):?><button type="button" id="technicianDetailPdf" class="btn btn-outline-danger"><i class="bi bi-file-earmark-pdf me-1"></i>PDF Riwayat</button><?php endif?></div>
|
|
</div>
|
|
<div class="card border-0 shadow-sm mb-3"><div class="card-body"><div class="row g-3">
|
|
<div class="col-sm-6 col-xl-3"><small class="text-muted d-block">Nama Teknisi</small><strong><?=html_escape($technician->full_name)?></strong></div>
|
|
<div class="col-sm-6 col-xl-3"><small class="text-muted d-block">Kode Karyawan</small><strong><?=html_escape($technician->employee_code?:'-')?></strong></div>
|
|
<div class="col-sm-6 col-xl-3"><small class="text-muted d-block">Jabatan</small><strong><?=html_escape($technician->position_name?:'-')?></strong></div>
|
|
<div class="col-sm-6 col-xl-3"><small class="text-muted d-block">Departemen</small><strong><?=html_escape($technician->department_name?:'-')?></strong></div>
|
|
</div></div></div>
|
|
<div class="card border-0 shadow-sm mb-3"><div class="card-header bg-white py-3"><h5 class="mb-1">Barang Aktif pada Teknisi</h5><small class="text-muted">Barcode QTY dapat memiliki sebagian jumlah dibawa dan sebagian dipasang.</small></div><div class="table-responsive"><table id="technicianCurrentItems" class="table align-middle mb-0 w-100"><thead><tr><th>No</th><th>Tanggal</th><th>Barcode</th><th>Barang</th><th>Serial Number</th><th>Jumlah Aktif</th><th>Status</th><th>Aksi</th></tr></thead><tbody></tbody></table></div></div>
|
|
<div class="card border-0 shadow-sm"><div class="card-header bg-white py-3"><h5 class="mb-1">Riwayat Perubahan Status</h5><small class="text-muted">Setiap perpindahan disimpan sebagai audit trail dan tidak menimpa kejadian sebelumnya.</small></div><div class="table-responsive"><table id="technicianStatusHistory" class="table align-middle mb-0 w-100"><thead><tr><th>No</th><th>Tanggal</th><th>Barang</th><th>Barcode</th><th>Perubahan</th><th>Jumlah</th><th>Customer</th><th>Keterangan</th><th>Diproses Oleh</th><th>Bukti</th></tr></thead><tbody></tbody></table></div></div>
|
|
</div>
|
|
<?php if($can_export):?><div class="modal fade" id="technicianDetailPdfModal" tabindex="-1"><div class="modal-dialog modal-xl modal-dialog-centered"><div class="modal-content" style="height:min(90vh,900px)"><div class="modal-header"><h5 class="modal-title">PDF Riwayat Peralatan <?=html_escape($technician->full_name)?></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body p-0"><iframe title="PDF riwayat peralatan teknisi" style="width:100%;height:100%;border:0"></iframe></div></div></div></div><?php endif?>
|
|
<script>
|
|
$(function(){
|
|
const current=$('#technicianCurrentItems').DataTable({processing:true,serverSide:true,ajax:{url:'<?=base_url('teknisi/get_teknisi_items')?>',data:{user_id:<?=(int)$technician->id?>}},columns:[0,1,2,3,4,5,6,7].map(i=>({data:i})),columnDefs:[{targets:[7],orderable:false,searchable:false}],order:[[1,'desc']],pageLength:25,responsive:true});
|
|
const history=$('#technicianStatusHistory').DataTable({processing:true,serverSide:false,ajax:{url:'<?=base_url('teknisi/get_status_history_data/'.(int)$technician->id)?>',dataSrc:r=>r&&r.status&&Array.isArray(r.data)?r.data:[]},columns:[0,1,2,3,4,5,6,7,8,9].map(i=>({data:i})),columnDefs:[{targets:[9],orderable:false,searchable:false}],order:[],pageLength:25,responsive:true});
|
|
window.afterTechnicianStatusChange=function(){current.ajax.reload(null,false);history.ajax.reload(null,false);};
|
|
<?php $this->load->view('peralatan_teknisi/_status_change_js',get_defined_vars());?>
|
|
$('#technicianDetailPdf').on('click',function(){const modal=document.getElementById('technicianDetailPdfModal');modal.querySelector('iframe').src='<?=base_url('teknisi/log_pdf')?>?user_id=<?=(int)$technician->id?>';bootstrap.Modal.getOrCreateInstance(modal).show();});
|
|
$('#technicianDetailPdfModal').on('hidden.bs.modal',function(){$(this).find('iframe').attr('src','about:blank')});
|
|
});
|
|
</script>
|