Files
simrs-jatim/billrajal_detail.php
2024-04-19 14:04:41 +07:00

98 lines
3.8 KiB
PHP

<?php
include("core/main.php");
$nomr = (array_key_exists('nomr', $_REQUEST)) ? $_REQUEST['nomr'] : '';
$poli = (array_key_exists('poli', $_REQUEST)) ? $_REQUEST['poli'] : '';
$idxdaftar = (array_key_exists('idxdaftar', $_REQUEST)) ? $_REQUEST['idxdaftar'] : '';
$start = (array_key_exists('start', $_REQUEST)) ? $_REQUEST['start'] : '';
$end = (array_key_exists('end', $_REQUEST)) ? $_REQUEST['end'] : '';
$cnama = (array_key_exists('cnama', $_GET)) ? $_GET['cnama'] : '';
$cnomr = (array_key_exists('cnomr', $_GET)) ? $_GET['cnomr'] : '';
$crbayar = (array_key_exists('crbayar', $_GET)) ? $_GET['crbayar'] : '';
?>
<div align="center">
<div id="frame">
<div id="frame_title">
<h5>TAGIHAN RAWAT JALAN NO RM <?php echo $nomr ?></h5></div>
<table class="tb" width="95%" style="margin:10px;" border="0" cellspacing="0" cellspading="0" title="Tagihan Data Pasien Per Hari Ini">
<tr align="center">
<th width="20px">NO</th>
<th width="100px">NO RM</th>
<th style="text-align:left;">Nama Pasien</th>
<th width="100px">Poly</th>
<th width="100px">Cara Bayar</th>
<th width="70px">Status</th>
<!--<th width="100px">Billing</th>-->
<th width="100px">Aksi</th>
</tr>
<?php
$nomrsing = substr($nomr,0,4);
$sql = 'select DISTINCT r.NOMR,r.IDXDAFTAR, x.NAMA, r.KDPOLY, m_ruang.nama as POLY1, m_carabayar.NAMA as CARABAYAR1
from t_pendaftaran r
join m_pasien x ON r.NOMR = x.NOMR
join t_bayarrajal b ON b.idxdaftar = r.idxdaftar
join m_ruang ON m_ruang.no = r.KDPOLY
join m_carabayar ON m_carabayar.KODE = r.KDCARABAYAR
where r.STATUS != 2 AND 1 = 1
and r.NOMR = '.$nomr.' and r.KDPOLY = '.$poli.' and r.idxdaftar = '.$idxdaftar.'
UNION ALL
select DISTINCT r.NOMR,r.IDXDAFTAR, x.NAMA, r.KDPOLY, m_ruang.nama as POLY1, m_carabayar.NAMA as CARABAYAR1
from t_pendaftaran r
join m_pasien x ON r.NOMR = x.NOMR
join t_bayarrajal b ON b.idxdaftar = r.idxdaftar
join m_ruang ON m_ruang.no = r.KDPOLY
join m_carabayar ON m_carabayar.KODE = r.KDCARABAYAR
where r.STATUS != 2 AND 1 = 1
and x.PARENT_NOMR = '.$nomr.' and r.KDPOLY = '.$poli.'
';
$NO=0;
$pager = paginate( $sql, 15, 5, "start=".$start."&end=".$end."&poly=".$poli."&cnama=".$cnama."&cnomr=".$cnomr."&crbayar=".$crbayar,"index.php?link=33&");
$count=0;
$page = (array_key_exists('page', $_GET)) ? $_GET['page'] : 0;
foreach($pager['list'] as $data) {
$count++;
if ($count % 2){
echo '<tr class="tr1">';
}else {
echo '<tr class="tr2">';
}
$ssql = $db->query('select COUNT(*) as tagihan from t_bayarrajal where NOMR = "'.$data['NOMR'].'" and IDXDAFTAR = "'.$data['IDXDAFTAR'].'" AND LUNAS = 0');
$sqry = $ssql->fetchAll()[0];
if($sqry['tagihan'] == 0){
$status_billing = 'Lunas';
}else{
$status_billing = '';
}
?>
<td align="center"><?php $NO=($NO+1);if ($page==0){$hal=0;}else{$hal=$page-1;} echo ($hal*15)+$NO;?></td>
<td align="center"><?php echo $data['NOMR'];?></td>
<td align="left"><?php echo $data['NAMA']; ?></td>
<td align="center"><?php echo $data['POLY1']; ?></td>
<td align="center"><?php echo $data['CARABAYAR1'];?></td>
<td align="center"><?php echo $status_billing;?></td>
<td>
<a href="index.php?link=34&nomr=<?php echo $data['NOMR']; ?>&poly=<?php echo $data['KDPOLY'];?>&idxdaftar=<?php echo $data['IDXDAFTAR'];?>"> <input type="button" class="text" value="Prosess" /></a>
</td>
</tr>
<?php }
?>
</table>
<?php
//Display the full navigation in one go
echo $pager['nav'];
?>
</div>
</div>
</div>
</div>