gdc_cmod/app/Views/admin/modal_result.php
2025-11-25 08:53:52 +07:00

43 lines
1.2 KiB
PHP

<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>