215 lines
11 KiB
PHP
215 lines
11 KiB
PHP
<?php
|
|
include("core/main.php");
|
|
$st_aps = (array_key_exists('aps', $_REQUEST) && $_REQUEST['aps'] == 1) ? true : false;
|
|
|
|
$kondisi=$kpoly =$kbyr =$knama =$knomr=$knobill='';
|
|
if (array_key_exists('poly', $_GET) && $_GET['poly']!=0){
|
|
$kpoly=' and r.kdpoly = '.$_GET['poly'];
|
|
}
|
|
if(array_key_exists('crbayar', $_GET) && $_GET['crbayar'] !=''){
|
|
$kbyr=' and r.kdcarabayar = '.$_GET['crbayar'];
|
|
}
|
|
if (array_key_exists('cnama', $_GET) && $_GET['cnama']!=""){
|
|
$knama=" and x.nama like '%".$_GET['cnama']."%'";
|
|
}
|
|
if (array_key_exists('cnomr', $_GET) && $_GET['cnomr']!=""){
|
|
$knomr=" and r.nomr = '".$_GET['cnomr']."'";
|
|
}
|
|
if (array_key_exists('nobill', $_GET) && $_GET['nobill']!=""){
|
|
$knobill=" and (select nobill from t_billrajal br where br.nomr = x.nomr and br.idxdaftar = r.idxdaftar limit 1) = '".$_GET['nobill']."'";
|
|
}
|
|
if (array_key_exists('asal', $_GET) && $_GET['asal']!=""){
|
|
$kasal= ($st_aps == true) ? '' : " and r.st_asal_masuk = '".$_GET['asal']."'";
|
|
}
|
|
$start = date('Y-m-d');
|
|
$end = date('Y-m-d');
|
|
if (array_key_exists('start', $_GET) && $_GET['start']!=""){
|
|
$start = $_REQUEST['start'];
|
|
}
|
|
if (array_key_exists('end', $_GET) && $_GET['end']!=""){
|
|
$end = $_REQUEST['end'];
|
|
}
|
|
$waktu = ' and (r.tglreg between \''.$start.'\' and \''.$end.'\')';
|
|
$poly = array_key_exists('poly', $_GET) ? $_GET['poly'] : '';
|
|
$asal = array_key_exists('asal', $_GET) ? $_GET['asal'] : '';
|
|
$crbayar = array_key_exists('crbayar', $_GET) ? $_GET['crbayar'] : '';
|
|
$cnama = array_key_exists('cnama', $_GET) ? $_GET['cnama'] : '';
|
|
$cnomr = array_key_exists('cnomr', $_GET) ? $_GET['cnomr'] : '';
|
|
$f_start = array_key_exists('start', $_GET) ? $_GET['start'] : date('Y-m-d');
|
|
$f_end = array_key_exists('end', $_GET) ? $_GET['end'] : date('Y-m-d');
|
|
$nobill = array_key_exists('nobill', $_GET) ? $_GET['nobill'] : '';
|
|
$order_by = array_key_exists('order_by', $_GET) ? $_GET['order_by'] : '';
|
|
|
|
$qrypoly = $db->query("SELECT no as kode,nama FROM m_ruang where subsistem like 'RAWAT JALAN%' ORDER BY no ASC");
|
|
$arr_poly = [''=>'Pilih Klinik'];
|
|
foreach($qrypoly->fetchAll() as $listpoly){
|
|
$arr_poly[$listpoly['kode']] = $listpoly['nama'];
|
|
}
|
|
$sql_carabayar = $db->query('SELECT * FROM m_carabayar');
|
|
$arr_carabayar = [''=>'Pilih Cara Bayar'];
|
|
foreach($sql_carabayar->fetchAll() as $data){
|
|
$arr_carabayar[$data['kode']] = $data['nama'];
|
|
}
|
|
$ss = $db->query('SELECT * from m_subsistem where sistem=\'IRJA\' or sistem =\'R.JALAN\' order by id_subsistem ASC');
|
|
$arr_asal = array(''=>'Pilih Subsistem');
|
|
foreach($ss->fetchAll() as $ds){
|
|
$arr_asal[$ds['nama_subsistem']] = $ds['nama_subsistem'];
|
|
}
|
|
$link = ($st_aps == true) ? '33aps' : '33';
|
|
$title = ($st_aps == true) ? '(Non Kunjungan)' : '';
|
|
?>
|
|
<style type="text/css">
|
|
div.dataTables_wrapper div.dataTables_filter { text-align: left !important; }
|
|
</style>
|
|
<div align="center">
|
|
<div id="frame">
|
|
<div id="frame_title"> <h5>TAGIHAN RAWAT JALAN HARI INI <?=$title?></h5></div>
|
|
<div class="container-fluid">
|
|
<form name="cari" id="cari" method="get" action="<?php $_SERVER['PHP_SELF']; ?>">
|
|
<input type="hidden" name="link" value="<?php echo $link; ?>" />
|
|
<input type="hidden" name="aps" value="<?php echo $st_aps; ?>" />
|
|
<div class="row text-left">
|
|
<div class="col-md-4" class="">
|
|
<div class="form-group row">
|
|
<label class="form-control-label col-sm-4"> No MR </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" name="cnomr" size="10" class="form-control form-control-sm" value="<?php echo $cnomr; ?>"/>
|
|
</div>
|
|
<label class="form-control-label col-sm-4"> Nama </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" name="cnama" class="form-control form-control-sm" value="<?php echo $cnama; ?>" oninput="this.value = this.value.toUpperCase()"/>
|
|
</div>
|
|
<label class="form-control-label col-sm-4"> No Bill </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" name="nobill" size="10" class="form-control form-control-sm" value="<?php echo $nobill; ?>"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" class="">
|
|
<div class="form-group row">
|
|
<label class="form-control-label col-sm-4"> Cara bayar </label>
|
|
<div class="col-sm-8">
|
|
<?php echo form_dropdown('crbayar',$arr_carabayar,$crbayar,'class="form-control form-control-sm" id="crbayar" style="width:100%"'); ?>
|
|
</div>
|
|
<label class="form-control-label col-sm-4"> Poliklinik </label>
|
|
<div class="col-sm-8">
|
|
<?php echo form_dropdown('poly',$arr_poly,$poly,'class="form-control form-control-sm" id="poly" style="width:100%"'); ?>
|
|
</div>
|
|
<label class="form-control-label col-sm-4"> Sub Sistem </label>
|
|
<div class="col-sm-8">
|
|
<?php echo form_dropdown('asal',$arr_asal,$asal,'class="form-control form-control-sm" id="subsistem" style="width:100%"'); ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" class="">
|
|
<div class="form-group row">
|
|
<label class="form-control-label col-sm-4 text-left"> Tanggal </label>
|
|
<div class="col-sm-4">
|
|
<input type="text" size="10" class="form-control datepicker-default mask-date-default form-control-sm" id="TGLREG" name="start" value="<?php echo $f_start; ?>" readonly/>
|
|
</div>
|
|
<div class="col-sm-4">
|
|
<input type="text" size="10" class="form-control datepicker-default mask-date-default form-control-sm" id="TGLREG2" name="end" value="<?php echo $f_end; ?>" readonly />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="form-control-label col-sm-4 text-left"> Urutan </label>
|
|
<div class="col-sm-8">
|
|
<?php echo form_dropdown('order_by',['nomr'=>'nomr','nama'=>'nama','nobill'=>'nobill'],'','class="form-control form-control-sm"'); ?>
|
|
</div>
|
|
|
|
<div class="col-sm-2">
|
|
<input type="submit" class="btn btn-secondary btn-sm" value="Cari" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<div id="cari_poly">
|
|
<table class="table table-sm table-bordered table-striped" id="datalist_sort">
|
|
<thead>
|
|
<tr align="center" class="bg-success text-white">
|
|
<th width="20px">NO</th>
|
|
<th width="100px">NO BILL</th>
|
|
<th width="100px">NO RM</th>
|
|
<th style="text-align:left;">Nama Pasien</th>
|
|
<th style="text-align:left;">Alamat Pasien</th>
|
|
<th width="100px">Klinik</th>
|
|
<th width="100px">Jenis Bayar</th>
|
|
<th width="70px">Status</th>
|
|
<th width="200px">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
|
|
$kondisi=$knama.$knomr.$kpoly.$kbyr.$waktu.$knobill.$kasal;
|
|
$t_pendaftaran = ($st_aps == true) ? 't_pendaftaran_aps' : 't_pendaftaran';
|
|
$m_pasien = ($st_aps == true) ? 'm_pasien_aps' : 'm_pasien';
|
|
|
|
$kondisi .= ($st_aps == true) ? '' : " and (x.PARENT_NOMR is NULL OR x.PARENT_NOMR = '')";
|
|
$sql_order = ($order_by != '') ? "order by " : '';
|
|
$sql_order .= ($order_by == 'nomr') ? 'r.nomr' : ( ($order_by == 'nama') ? 'x.nama' : ( ($order_by == 'nobill') ? '(select nobill from t_billrajal br where br.nomr = x.nomr and br.idxdaftar = r.idxdaftar limit 1)' : '' ) );
|
|
|
|
$sql = "SELECT DISTINCT r.nomr,(select nobill from t_billrajal br where br.nomr = x.nomr and br.idxdaftar = r.idxdaftar limit 1) as nobill, r.idxdaftar, x.nama,x.alamat, 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
|
|
left join m_ruang ON m_ruang.no = r.KDPOLY
|
|
join m_carabayar ON m_carabayar.KODE = r.KDCARABAYAR
|
|
where r.status != 2 $kondisi
|
|
$sql_order";
|
|
|
|
$link_page = ($st_aps == true) ? "index.php?link=33aps&aps=1" : "index.php?link=33";
|
|
$NO = 0;
|
|
$pager = paginate( $sql, 15, 5, "&start=".$start."&end=".$end."&poly=".$poly."&cnama=".$cnama."&cnomr=".$cnomr."&crbayar=".$crbayar."&nobill=".$nobill, $link_page);
|
|
|
|
$count = 0;
|
|
$page = (array_key_exists('page', $_GET)) ? $_GET['page'] : '';
|
|
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['nobill'];?></td>
|
|
<td align="center"><?php echo $data['nomr'];?></td>
|
|
<td align="left"><?php echo $data['nama']; ?></td>
|
|
<td align="left"><?php echo $data['alamat']; ?></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 align="center">
|
|
<?php
|
|
$btn_proses = ($st_aps == true) ? '<a href="index.php?link=cartbill_aps&nomr='.$data['nomr'].'&poly='.$data['kdpoly'].'&idxdaftar='.$data['idxdaftar'].'" class="btn btn-outline-secondary btn-sm"> PROSES </a>' : '<a href="index.php?link=34&nomr='.$data['nomr'].'&poly='.$data['kdpoly'].'&idxdaftar='.$data['idxdaftar'].'" class="btn btn-outline-secondary btn-sm"> PROSES </a>';
|
|
$btn_rincian = ($st_aps == true) ? '<a href="index.php?link=cartbill_aps&nomr='.$data['nomr'].'&poly='.$data['kdpoly'].'&idxdaftar='.$data['idxdaftar'].'" class="btn btn-outline-secondary btn-sm"> Rincian Bill </a>' : '<a href="index.php?link=33rekapbill&nomr='.$data['nomr'].'&poly='.$data['kdpoly'].'&idxdaftar='.$data['idxdaftar'].'" class="btn btn-outline-secondary btn-sm"> Rincian Bill </a>';
|
|
echo $btn_proses.$btn_rincian;
|
|
?>
|
|
<!-- <a href="index.php?link=33detail&nomr=<?php echo $data['nomr'];?>&poli=<?php echo $data['KDPOLY'];?>&idxdaftar=<?php echo $data['idxdaftar'];?>" class="btn btn-outline-secondary btn-sm">DETAIL</a> -->
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
</tbody>
|
|
</table>
|
|
<?php
|
|
echo $pager['nav'];
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
echo implode("\n", $list_plugin['ui_plugins_css']);
|
|
$form_plugin['ui_plugins_js'] = array_merge($form_plugin['ui_plugins_js'],$list_plugin['ui_plugins_js']);
|
|
|
|
$js_init .= 'mainlist();';
|
|
?>
|