prework
This commit is contained in:
parent
4f1d3e1097
commit
05846f4344
@ -71,6 +71,8 @@ class Admin extends BaseController
|
||||
'isval' => $row['ISVAL'] ?? 0,
|
||||
'isdelete' => $isDelete,
|
||||
'val' => $row['VAL'] ?? 0,
|
||||
'val1user' => $row['VAL1USER'] ?? '-',
|
||||
'val2user' => $row['VAL2USER'] ?? '-',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@ -128,9 +128,8 @@
|
||||
background-color: purple;
|
||||
}
|
||||
|
||||
.btn-xs {
|
||||
font-size : 0.7rem;
|
||||
}
|
||||
.btn-xs { font-size : 0.7rem; }
|
||||
.text-xs { font-size : 0.7rem; }
|
||||
</style>
|
||||
|
||||
<?= $this->renderSection('css'); ?>
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
<th style='width:8%;'>Doctor</th>
|
||||
<th style='width:15%;'>Tests</th>
|
||||
<th style='width:5%;'>Result To</th>
|
||||
<th style='width:10%;'>Validation</th>
|
||||
<th style='width:5%;'>Validation</th>
|
||||
<th style='width:4%;'>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -115,13 +115,24 @@
|
||||
<?= esc($row['odr_cresult_to']) ?> <br/>
|
||||
<input type="checkbox" name="printed"> Printed
|
||||
</td>
|
||||
<td data-acc="<?=$row['sp_accessnumber'];?>">
|
||||
<span class="border border-success rounded p-1 mb-2 me-2"> <?=$row['val'];?> </span>
|
||||
<?php if($row['val'] != 2) { ?>
|
||||
<!-- <a href="<?=base_url('result/'.$row['sp_accessnumber']);?>" target="_blank" class="btn btn-xs btn-outline-primary px-1 py-0 mb-1">Verify</a> -->
|
||||
<button class='btn btn-xs btn-outline-success px-1 py-0 mb-1' onclick="verify(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#verifyModal">Verify</button>
|
||||
<br/>
|
||||
<?php } else { echo "<br />"; } ?>
|
||||
<td data-acc="<?=$row['sp_accessnumber'];?>" class="text-center">
|
||||
<table class='mx-auto'>
|
||||
<tr>
|
||||
<td>1 : <?=$row['val1user'];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2 : <?=$row['val2user'];?></td>
|
||||
</tr>
|
||||
<?php if($row['val'] != 2) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<button class='btn btn-xs btn-outline-secondary px-1 py-0 mb-1' onclick="unverify(<?=$row['sp_accessnumber'];?>)"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
<button class='btn btn-xs btn-outline-success px-1 py-0 mb-1' onclick="verifyShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#verifyModal"><i class="bi bi-check-lg"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<!--
|
||||
<?php if($row['val'] == 2) { ?>
|
||||
<a href="http://glenlis/spooler_db/main_dev.php?acc=<?=$row['sp_accessnumber'];?>" target="_blank" class="btn btn-xs btn-primary py-0 px-1">Ind</a> |
|
||||
<a href="http://glenlis/spooler_db/main_dev.php?acc=<?=$row['sp_accessnumber'];?>&eng=1" target="_blank" class="btn btn-xs btn-primary py-0 px-1">Eng</a> |
|
||||
@ -130,7 +141,7 @@
|
||||
<?php if ($row['val'] != 0) {?>
|
||||
<a href="#" class="btn btn-xs btn-secondary py-0 px-2 invalidate-btn" onclick="invalidate('<?=$row['sp_accessnumber'];?>'); return false;">Invalidate</a><br>
|
||||
<?php }?>
|
||||
|
||||
-->
|
||||
</td>
|
||||
<td class="pointercol <?= esc($class) ?>" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['stats']) ?> </td>
|
||||
</tr>
|
||||
@ -138,8 +149,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Modal Specimen Collection-->
|
||||
@ -249,14 +258,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
window.verify = function(accessNumber) {
|
||||
function verifyShow(accessNumber) {
|
||||
const modalBody = $('#verifyModal .modal-body');
|
||||
modalBody.html('<div class="text-center py-5"><div class="spinner-border text-primary" role="status"><span class="visually-hidden">Loading...</span></div><p class="mt-2">Fetching verification details for #' + accessNumber + '...</p></div>');
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url('api/result/'); ?>'+accessNumber,
|
||||
method: 'GET', // Or 'POST', depending on your server setup
|
||||
data: { access_number: accessNumber },
|
||||
method: 'GET',
|
||||
dataType: 'html',
|
||||
success: function(response) {
|
||||
modalBody.html(response);
|
||||
@ -273,19 +281,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
function verify(accessnumber) {
|
||||
// toggle checkbox
|
||||
const row = document.getElementById(`row-${accessnumber}-${samplenumber}`);
|
||||
const checkbox = row.querySelector('.coll-checkbox');
|
||||
checkbox.checked = status;
|
||||
const row = document.getElementById(`row-${accessnumber}`);
|
||||
|
||||
$.ajax({
|
||||
url: `<?=base_url('api/request/collect');?>/${accessnumber}`,
|
||||
url: `<?=base_url('api/request/verify');?>/${accessnumber}`,
|
||||
type: "POST",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
data: JSON.stringify({ samplenumber:samplenumber, status:status, userid:"<?=session('userid');?>" }),
|
||||
data: JSON.stringify({ userid:"<?=session('userid');?>" }),
|
||||
success: function(response) {
|
||||
console.log("Success:", response);
|
||||
},
|
||||
@ -294,7 +299,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
function unreceive(accessnumber, samplenumber) {
|
||||
// toggle checkbox
|
||||
@ -351,5 +355,6 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,8 +1,43 @@
|
||||
<iframe
|
||||
id="result-iframe"
|
||||
title="PHP Embedded Content Demo"
|
||||
class="flex-1"
|
||||
src="http://glenlis/spooler_db/main_dev.php?acc=<?=$accessnumber;?>">
|
||||
|
||||
<p>Your browser does not support iframes. Please contact the technical support.</p>
|
||||
</iframe>
|
||||
<div class='row mt-1'>
|
||||
<div class="col"></div>
|
||||
<div class='col text-end'>
|
||||
<button id='result-button' class='btn btn-xs btn-success' onclick='verify(<?=$accessnumber;?>)' disabled>Verify</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mx-auto">
|
||||
<iframe
|
||||
id="result-iframe"
|
||||
class="embed-responsive-item"
|
||||
src="http://glenlis/spooler_db/main_dev.php?acc=<?=$accessnumber;?>"
|
||||
width="750px" height="600px"
|
||||
>
|
||||
|
||||
<p>Your browser does not support iframes. Please contact the technical support.</p>
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
{
|
||||
// verifymodal
|
||||
let iframe = document.getElementById('result-iframe');
|
||||
let button = document.getElementById('result-button');
|
||||
|
||||
iframe.addEventListener('load', () => {
|
||||
//console.log('loaded');
|
||||
let iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
||||
let scrollElement = iframeDoc.scrollingElement || iframeDoc.documentElement;
|
||||
|
||||
iframeDoc.addEventListener('scroll', () => {
|
||||
let scrollTop = scrollElement.scrollTop;
|
||||
let scrollHeight = scrollElement.scrollHeight;
|
||||
let clientHeight = scrollElement.clientHeight;
|
||||
|
||||
// Check if scrolled to bottom
|
||||
if (scrollTop + clientHeight >= scrollHeight - 2) {
|
||||
button.disabled = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user