Update
This commit is contained in:
No files matched your search
@@ -87,71 +87,150 @@
|
||||
<td colspan="8">
|
||||
@php
|
||||
$cekketerangan = explode('/table', $keterangan);
|
||||
$cetakjudul = false;
|
||||
$sudahcetak1= 0;
|
||||
$sudahcetak2= 0;
|
||||
$sudahcetak3= 0;
|
||||
$namakuman = '';
|
||||
@endphp
|
||||
|
||||
@if (!isset($cekketerangan[1]) && isset($antibiotiks) && $antibiotiks->isNotEmpty())
|
||||
@if (isset($antibiotiks) && $antibiotiks->isNotEmpty())
|
||||
@php
|
||||
// Filter antibiotik yang printrow == true
|
||||
$filtered = $antibiotiks->filter(function($row) {
|
||||
return $row->printrow;
|
||||
})->values(); // reset index
|
||||
|
||||
$total = $filtered->count();
|
||||
$half = ceil($total / 2);
|
||||
$left = $filtered->slice(0, $half)->values();
|
||||
$right = $filtered->slice($half)->values();
|
||||
$grouped = $antibiotiks->filter(function ($row) {
|
||||
return $row->printrow; // hanya yang perlu dicetak
|
||||
})->groupBy('kuman');
|
||||
if (empty($grouped) OR $grouped->isEmpty()) {
|
||||
if (isset($data['bakteri'])) {
|
||||
if (isset($data['id_baktericetak']) AND $data['id_baktericetak'] == 'TIDAK') {
|
||||
} else {
|
||||
echo "<p>Bakteri Yang ditemukan : <strong><i>" . $data['bakteri'] . "</i></strong> " . ($data['bakterisir'] ?? '') . "</p>";
|
||||
}
|
||||
}
|
||||
if (isset($data['id_bakteri01'])) {
|
||||
echo "<p>Bakteri Yang ditemukan : <strong><i>" . $data['id_bakteri01'] . "</i></strong> " . ($data['id_bakterisir01'] ?? '') . "</p>";
|
||||
}
|
||||
if (isset($data['id_bakteri02'])) {
|
||||
echo "<p>Bakteri Yang ditemukan : <strong><i>" . $data['id_bakteri02'] . "</i></strong> " . ($data['id_bakterisir02'] ?? '') . "</p>";
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
@foreach ($grouped as $kuman => $items)
|
||||
@if (isset($data['bakteri']) AND $data['bakteri'] == $kuman)
|
||||
@if (isset($data['id_baktericetak']) AND $data['id_baktericetak'] == 'TIDAK')
|
||||
@else
|
||||
@if ($sudahcetak1 == 0)
|
||||
<p>Bakteri Yang ditemukan : <strong><i>{{ $data['bakteri'] }}</i></strong> {{ $data['bakterisir'] ?? '' }}</p>
|
||||
@if (isset($data['id_bakterihitungkolteks']))
|
||||
<p>Jumlah Koloni : <strong><i>{{ $data['id_bakterihitungkolteks'] }}</i></strong></p>
|
||||
@elseif (isset($data['id_bakterihitungkol']))
|
||||
<p>Jumlah Koloni : <strong><i>{{ $data['id_bakterihitungkol'] }}</i></strong></p>
|
||||
@endif
|
||||
@php
|
||||
$sudahcetak1 = 1;
|
||||
$cetakjudul = true;
|
||||
$namakuman = $data['bakteri'];
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@endif
|
||||
@if (isset($data['id_bakteri01']) AND $data['id_bakteri01'] == $kuman)
|
||||
@if ($sudahcetak2 == 0)
|
||||
<p>Bakteri Yang ditemukan : <strong><i>{{ $data['id_bakteri01'] }}</i></strong> {{ $data['id_bakterisir01'] ?? '' }}</p>
|
||||
@if (isset($data['id_bakterihitungkolteks01']))
|
||||
<p>Jumlah Koloni : <strong><i>{{ $data['id_bakterihitungkolteks01'] }}</i></strong></p>
|
||||
@elseif (isset($data['id_bakterihitungkol01']))
|
||||
<p>Jumlah Koloni : <strong><i>{{ $data['id_bakterihitungkol01'] }}</i></strong></p>
|
||||
@endif
|
||||
@php
|
||||
$sudahcetak2 = 1;
|
||||
$cetakjudul = true;
|
||||
$namakuman = $data['id_bakteri01'];
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
@if (isset($data['id_bakteri02']) AND $data['id_bakteri02'] == $kuman)
|
||||
@if ($sudahcetak3 == 0)
|
||||
<p>Bakteri Yang ditemukan : <strong><i>{{ $data['id_bakteri02'] }}</i></strong> {{ $data['id_bakterisir02'] ?? '' }}</p>
|
||||
@if (isset($data['id_bakterihitungkolteks02']))
|
||||
<p>Jumlah Koloni : <strong><i>{{ $data['id_bakterihitungkolteks02'] }}</i></strong></p>
|
||||
@elseif (isset($data['id_bakterihitungkol02']))
|
||||
<p>Jumlah Koloni : <strong><i>{{ $data['id_bakterihitungkol02'] }}</i></strong></p>
|
||||
@endif
|
||||
@php
|
||||
$sudahcetak3 = 1;
|
||||
$cetakjudul = true;
|
||||
$namakuman = $data['id_bakteri02'];
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
@php
|
||||
$total = $items->count();
|
||||
$half = ceil($total / 2);
|
||||
$left = $items->slice(0, $half)->values();
|
||||
$right = $items->slice($half)->values();
|
||||
@endphp
|
||||
@if ($cetakjudul)
|
||||
<table style="width:100%; border-collapse: collapse;" border="1" cellpadding="3" cellspacing="0">
|
||||
<thead>
|
||||
<tr style="background-color: #f2f2f2;">
|
||||
<th>No</th>
|
||||
<th>Antibiotik</th>
|
||||
<th>Value</th>
|
||||
<th>Interpretation</th>
|
||||
<th> </th>
|
||||
<th>No</th>
|
||||
<th>Antibiotik</th>
|
||||
<th>Value</th>
|
||||
<th>Interpretation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for ($i = 0; $i < $half; $i++)
|
||||
<tr>
|
||||
{{-- Kolom kiri --}}
|
||||
@if (isset($left[$i]) AND $left[$i]->printrow)
|
||||
<td>{{ $i + 1 }}</td>
|
||||
<td>{{ $left[$i]->antibiotic }}</td>
|
||||
<td>{{ $left[$i]->printcol == 1 ? $left[$i]->value : '' }}</td>
|
||||
<td align="center">{{ $left[$i]->interpretation }}</td>
|
||||
@else
|
||||
<td colspan="4"> </td>
|
||||
@endif
|
||||
|
||||
<table style="width:100%" border="1" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong>No</strong></th>
|
||||
<th><strong>Antibiotik</strong></th>
|
||||
<th><strong>Value</strong></th>
|
||||
<th><strong>Interpretation</strong></th>
|
||||
<th> </th>
|
||||
<th><strong>No</strong></th>
|
||||
<th><strong>Antibiotik</strong></th>
|
||||
<th><strong>Value</strong></th>
|
||||
<th><strong>Interpretation</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for ($i = 0; $i < $half; $i++)
|
||||
<tr>
|
||||
{{-- Kolom kiri --}}
|
||||
@if (isset($left[$i]))
|
||||
<td>{{ $i + 1 }}</td>
|
||||
<td>{{ $left[$i]->antibiotic }}</td>
|
||||
@if (isset($left[$i]->printcol) && $left[$i]->printcol == 1)
|
||||
<td>{{ $left[$i]->value }}</td>
|
||||
@else
|
||||
<td> </td>
|
||||
@endif
|
||||
<td align="center">{{ $left[$i]->interpretation }}</td>
|
||||
@else
|
||||
<td colspan="4"> </td>
|
||||
@endif
|
||||
<td> </td> {{-- Pemisah tengah --}}
|
||||
|
||||
<td> </td> {{-- Spacer kolom tengah --}}
|
||||
|
||||
{{-- Kolom kanan --}}
|
||||
@if (isset($right[$i]))
|
||||
<td>{{ $i + 1 + $half }}</td>
|
||||
<td>{{ $right[$i]->antibiotic }}</td>
|
||||
@if (isset($right[$i]->printcol) && $right[$i]->printcol == 1)
|
||||
<td>{{ $right[$i]->value }}</td>
|
||||
@else
|
||||
<td> </td>
|
||||
@endif
|
||||
<td align="center">{{ $right[$i]->interpretation }}</td>
|
||||
@else
|
||||
<td colspan="4"> </td>
|
||||
@endif
|
||||
</tr>
|
||||
@endfor
|
||||
</tbody>
|
||||
</table>
|
||||
{{-- Kolom kanan --}}
|
||||
@if (isset($right[$i]) AND $right[$i]->printrow)
|
||||
<td>{{ $i + 1 + $half }}</td>
|
||||
<td>{{ $right[$i]->antibiotic }}</td>
|
||||
<td>{{ $right[$i]->printcol == 1 ? $right[$i]->value : '' }}</td>
|
||||
<td align="center">{{ $right[$i]->interpretation }}</td>
|
||||
@else
|
||||
<td colspan="4"> </td>
|
||||
@endif
|
||||
</tr>
|
||||
@endfor
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@endforeach
|
||||
@php
|
||||
if ($namakuman == ''){
|
||||
if (isset($data['bakteri'])) {
|
||||
if (isset($data['id_baktericetak']) AND $data['id_baktericetak'] == 'TIDAK') {
|
||||
} else {
|
||||
echo "<p>Bakteri Yang ditemukan : <strong><i>" . $data['bakteri'] . "</i></strong> " . ($data['bakterisir'] ?? '') . "</p>";
|
||||
}
|
||||
}
|
||||
if (isset($data['id_bakteri01'])) {
|
||||
echo "<p>Bakteri Yang ditemukan : <strong><i>" . $data['id_bakteri01'] . "</i></strong> " . ($data['id_bakterisir01'] ?? '') . "</p>";
|
||||
}
|
||||
if (isset($data['id_bakteri02'])) {
|
||||
echo "<p>Bakteri Yang ditemukan : <strong><i>" . $data['id_bakteri02'] . "</i></strong> " . ($data['id_bakterisir02'] ?? '') . "</p>";
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user