Split glass report into three tables
This commit is contained in:
@@ -9,52 +9,41 @@
|
||||
<div class="ribbon ribbon-danger">Rekapitulasi Data Bulan {{$bulan}} Tahun {{$tahun}}</div>
|
||||
<p></p>
|
||||
<div class="mt-3 mb-3">
|
||||
<a href="{{ route('exportGlassReport', ['bulan' => $bulan, 'tahun' => $tahun]) }}" class="btn btn-success">
|
||||
<a href="{{ route('exportGlassReport', ['bulan' => $bulan, 'tahun' => $tahun]) }}" class="btn btn-success">
|
||||
<i class="fa fa-file-excel-o"></i> Download Full Excel (CSV)
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered" id="datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Pasien</th>
|
||||
<th>No RM</th>
|
||||
<th>Bakteri</th>
|
||||
@foreach($jsonantibiotik as $antibiotic)
|
||||
<th title="{{ $antibiotic }}">{{ $antibiotic }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($orderbydate as $data)
|
||||
@foreach (['A', 'B', 'C'] as $tableKey)
|
||||
<div class="table-responsive" style="margin-bottom: 24px;">
|
||||
<h4>TABEL {{ $tableKey }}</h4>
|
||||
<table class="table table-bordered table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ $data->nmpasien }}</td>
|
||||
<td>{{ $data->noregister }}</td>
|
||||
<td>{{ $data->nm_spesimen }}</td> @foreach($jsonantibiotik as $headerAntibiotik)
|
||||
@php
|
||||
// LOGIC UTAMA:
|
||||
// Cek di array lookup: [id_pasien][nama_antibiotik]
|
||||
// Jika ada, ambil nilainya. Jika tidak, kosong.
|
||||
$interpretasi = $antibiotikLookup[$data->id][$headerAntibiotik] ?? '';
|
||||
@endphp
|
||||
<td class="text-center" style="{{ $interpretasi == 'R' ? 'background-color:#ffcccc' : '' }}">
|
||||
{{ $interpretasi }}
|
||||
</td>
|
||||
@foreach (($glassHeaders[$tableKey] ?? []) as $header)
|
||||
<th>{{ $header }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="{{ count($jsonantibiotik) + 3 }}">Data tidak ditemukan</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse (($glassTables[$tableKey] ?? []) as $row)
|
||||
<tr>
|
||||
@foreach ($row as $cell)
|
||||
<td>{{ $cell }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="{{ count($glassHeaders[$tableKey] ?? []) }}">Data tidak ditemukan</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
Reference in New Issue
Block a user