This commit is contained in:
Duidev Software
2026-01-02 16:42:43 +07:00
parent 98d6b688e9
commit 4583ac6cd7
4 changed files with 385 additions and 274 deletions

No files matched your search

@@ -7,10 +7,17 @@
<div class="card-box ribbon-box">
<div class="ribbon ribbon-danger">Rekapitulasi Data Bulan {{$bulan}} Tahun {{$tahun}}</div>
<p></p>
<div class="table-responsive">
<button type="button" class="btn btn-primary" id="btnexport"><i class="fa fa-print"></i> Export</button>
<div class="d-flex justify-content-between mb-2">
<a href="{{ route('exportRekapAntibiotik', ['bulan' => $bulan, 'tahun' => $tahun]) }}" class="btn btn-primary">
<i class="fa fa-print"></i> Export Excel (CSV)
</a>
<div>Halaman {{ $orderbydate->currentPage() }} dari {{ $orderbydate->lastPage() }}</div>
</div>
<table id="rekapantibiotik" class="table table-bordered display">
<div class="table-responsive">
<table class="table table-bordered table-sm table-striped display" id="datatable">
<thead>
<tr>
<th>No</th>
@@ -25,89 +32,74 @@
<th>Code</th>
<th>Spesimen</th>
<th>Finish</th>
<th>bhp_media</th>
<th>bhp_potsputum</th>
<th>bhp_poturine</th>
<th>bhp_oshe</th>
<th>bhp_obyekglass</th>
<th>bhp_botolbd</th>
<th>bhp_parafilm</th>
<th>bhp_tips</th>
<th>bhp_cottonswab</th>
<th>bhp_antibiotiktambahan</th>
<th>id_esbl</th>
<th>id_mrsa</th>
@if(isset($jsonantibiotik) && !empty($jsonantibiotik))
@foreach($jsonantibiotik->first() as $antibiotic)
<th>{{ $antibiotic->antibiotic }}</th>
@endforeach
@endif
<th>Media</th>
<th>Sputum</th>
<th>Urine</th>
<th>Oshe</th>
<th>Glass</th>
<th>Botol</th>
<th>Paraf</th>
<th>Tips</th>
<th>Swab</th>
<th>Ab+</th>
<th>ESBL</th>
<th>MRSA</th>
@foreach($listAntibiotik as $antibiotic)
<th>{{ $antibiotic }}</th>
@endforeach
</tr>
</thead>
<tbody>
@if(isset($orderbydate) && !empty($orderbydate))
@foreach($orderbydate as $data)
<tr>
<td>{{ $data->noloket }}</td>
<td>{{ $data->status }}</td>
<td>{{ $data->noregister }}</td>
<td>{{ $data->nmpasien }}</td>
<td>{{ $data->reques }}</td>
<td>{{ $data->jkpasien }}</td>
<td>{{ $data->daftar }}</td>
<td>{{ $data->urgensi }}</td>
<td>{{ $data->asalpasien }}</td>
<td>{{ $data->kd_spesimen }}</td>
<td>{{ $data->nm_spesimen }}</td>
<td>{{ $data->updated_at }}</td>
<td>{{ $data->bhp_media}} </td>
<td>{{ $data->bhp_potsputum}} </td>
<td>{{ $data->bhp_poturine}} </td>
<td>{{ $data->bhp_oshe}} </td>
<td>{{ $data->bhp_obyekglass}} </td>
<td>{{ $data->bhp_botolbd}} </td>
<td>{{ $data->bhp_parafilm}} </td>
<td>{{ $data->bhp_tips}} </td>
<td>{{ $data->bhp_cottonswab}} </td>
<td>{{ $data->bhp_antibiotiktambahan}} </td>
<td>{{ $data->id_esbl}} </td>
<td>{{ $data->id_mrsa}} </td>
@if(isset($jsonantibiotik[$data->id]) && !empty($jsonantibiotik[$data->id]))
@foreach($jsonantibiotik[$data->id] as $antibiotic)
<td>{{ $antibiotic->interpretation }}</td>
@endforeach
@else
<td>&nbsp;</td>
@endif
</tr>
@endforeach
@endif
@forelse($orderbydate as $data)
<tr>
<td>{{ $data->noloket }}</td>
<td>{{ $data->status }}</td>
<td>{{ $data->noregister }}</td>
<td>{{ $data->nmpasien }}</td>
<td>{{ $data->reques }}</td>
<td>{{ $data->jkpasien }}</td>
<td>{{ $data->daftar }}</td>
<td>{{ $data->urgensi }}</td>
<td>{{ $data->asalpasien }}</td>
<td>{{ $data->kd_spesimen }}</td>
<td>{{ $data->nm_spesimen }}</td>
<td>{{ $data->updated_at }}</td>
<td>{{ $data->bhp_media}} </td>
<td>{{ $data->bhp_potsputum}} </td>
<td>{{ $data->bhp_poturine}} </td>
<td>{{ $data->bhp_oshe}} </td>
<td>{{ $data->bhp_obyekglass}} </td>
<td>{{ $data->bhp_botolbd}} </td>
<td>{{ $data->bhp_parafilm}} </td>
<td>{{ $data->bhp_tips}} </td>
<td>{{ $data->bhp_cottonswab}} </td>
<td>{{ $data->bhp_antibiotiktambahan}} </td>
<td>{{ $data->id_esbl}} </td>
<td>{{ $data->id_mrsa}} </td>
@foreach($listAntibiotik as $headerAb)
@php
// Ambil nilai dari Lookup Array
// Jika pasien ini tidak tes antibiotik tersebut, tampilkan kosong
$val = $antibiotikLookup[$data->id][$headerAb] ?? '';
@endphp
<td class="text-center">{{ $val }}</td>
@endforeach
</tr>
@empty
<tr>
<td colspan="{{ 24 + count($listAntibiotik) }}" class="text-center">
Tidak ada data tersedia.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="card-footer">
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" name="_token" id="token" value="{{ csrf_token() }}">
@endsection
@push('script')
<!-- SIGNATURE PAD -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('btnexport').addEventListener('click', function() {
var table = document.getElementById('rekapantibiotik');
if (table) {
var wb = XLSX.utils.table_to_book(table, { sheet: "Report" });
XLSX.writeFile(wb, "RekapanAntiBiotik_{{$bulan}}_Tahun{{$tahun}}.xlsx");
} else {
console.error('Tabel dengan ID "tblkeaktifankelas" tidak ditemukan.');
}
});
});
</script>
@endpush
@endsection