pbmc-cmod/app/Views/dashboard_viewAccess.php

106 lines
3.6 KiB
PHP
Raw Normal View History

<?php
if(isset($data[0])) {
$row = $data[0];
$patnumber = $row['PATNUMBER'];
$host = $row['HOSTORDERNUMBER'];
$name = $row['NAME'];
?>
<style>
span.badge { cursor:pointer; }
</style>
<div class="modal-header bg-orange">
<h1 class="modal-title fs-5" id="exampleModalToggleLabel">Detail Request </h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" ></button>
</div>
2024-11-13 10:54:24 +07:00
<div class="modal-body" style='background-color:#F4F6FF'>
<div class="row">
2024-11-13 10:54:24 +07:00
<div class="col-6">
2024-11-12 16:45:01 +07:00
<table class="table table-sm table-borderless">
<tr> <th>Pat#</th> <th>:</th> <td><?=$patnumber;?></td> </tr>
<tr> <th>Nama</th> <th>:</th> <td><?=$name;?></td> </tr>
2024-11-13 10:54:24 +07:00
</table>
</div>
<div class="col-6">
<table class="table table-sm table-borderless">
<tr> <th>Access#</th> <th>:</th> <td><?=$accessnumber;?></td> </tr>
2024-11-12 16:45:01 +07:00
<tr> <th>Status</th> <th>:</th> <td><span class="badge bg-orange">Pending</span></td> </tr>
</table>
</div>
2024-11-13 10:54:24 +07:00
</div>
<div class='row'>
<div class="col-12">
2024-11-13 10:54:24 +07:00
<div class="card bg-white">
<div class="card-body">
2024-11-12 16:45:01 +07:00
<div class="card-title"><h3>Sample List</h3></div>
<table class='table'>
2024-11-12 16:45:01 +07:00
<tr> <th class='text-center'>Coll.</th> <th class='text-center'>Recv.</th> <th>Sample Name</th> <th></th> </tr>
<?php
foreach($data as $row) {
$sampletype = $row['SAMPLETYPE'];
$sampletext = $row['SHORTTEXT'];
$tubestatus = $row['TUBESTATUS'];
$collstatus = $row['COLLSTATUS'];
2024-11-12 16:45:01 +07:00
echo "\r\n <tr>";
2024-11-13 10:54:24 +07:00
if($collstatus==1) {
echo " <td class='text-center'><input type='checkbox' class='form-check-input' id='coll$sampletype' checked disabled></td>";
} else {
echo " <td class='text-center'><input type='checkbox' class='form-check-input' id='coll$sampletype' disabled></td>";
}
if($tubestatus==4) {
echo "<td class='text-center'><input type='checkbox' class='form-check-input' id='recv$sampletype' checked disabled></td>";
} else {
echo "<td class='text-center'><input type='checkbox' class='form-check-input' id='recv$sampletype' disabled></td>";
}
2024-11-12 16:45:01 +07:00
echo "<td>$sampletext</td>";
2024-11-13 10:54:24 +07:00
echo "<td>
2024-11-12 16:45:01 +07:00
<span class='badge bg-black text-white'>reprint</span>
2024-11-13 10:54:24 +07:00
<span class='badge bg-black text-white' onclick='collect($sampletype, $accessnumber)'>collect</span>
2024-11-12 16:45:01 +07:00
<span class='badge bg-black text-white'>un-collect</span>
<span class='badge bg-black text-white'>un-receive</span>
</td> ";
echo " </tr>";
}
?>
2024-11-12 16:45:01 +07:00
<tr>
<td></td> <td></td> <td>Collection</td>
2024-11-13 10:54:24 +07:00
<td> <span class='badge bg-black text-white'>reprint</span> </td>
2024-11-12 16:45:01 +07:00
</tr>
<tr>
<td></td> <td></td> <td>All</td>
2024-11-13 10:54:24 +07:00
<td>
2024-11-12 16:45:01 +07:00
<span class='badge bg-black text-white'>reprint</span>
2024-11-13 10:54:24 +07:00
<span class='badge bg-black text-white' onclick='collectAll(<?=$accessnumber;?>)'>collect</span>
2024-11-12 16:45:01 +07:00
<span class='badge bg-black text-white'>un-collect</span>
<span class='badge bg-black text-white'>un-receive</span>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
2024-11-13 10:54:24 +07:00
<script>
function collect(sample, access) {
const url = '<?=base_url();?>tubes/collect/'+access+'/'+sample;
$("#coll"+sample).prop("checked", true);
}
function collectAll(access) {
const url = '<?=base_url();?>tubes/collectAll/'+access;
$('input[id^="coll"]').prop('checked', true);
}
</script>
<?php
} else {
?>
<div class="modal-header bg-black text-white">
<h1 class="modal-title fs-5" id="exampleModalToggleLabel">Detail Request </h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" ></button>
</div>
<div class="modal-body">
<h3>Data not found</h3>
</div>
<?php
}
?>