155 lines
7.0 KiB
PHP
155 lines
7.0 KiB
PHP
<?php
|
|
include("core/main.php");
|
|
$kondisi=$kbyr =$knama =$kno_nonreg=$knobill='';
|
|
|
|
|
|
if (array_key_exists('cnama', $_GET) && $_GET['cnama']!=""){
|
|
$knama=" and r.nama like '%".$_GET['cnama']."%'";
|
|
}
|
|
if (array_key_exists('cno_nonreg', $_GET) && $_GET['cno_nonreg']!=""){
|
|
$kno_nonreg=" and r.no_nonreg = '".$_GET['cno_nonreg']."'";
|
|
}
|
|
if (array_key_exists('nobill', $_GET) && $_GET['nobill']!=""){
|
|
$knobill=" and b.nobill = '".$_GET['nobill']."'";
|
|
}
|
|
$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 ('.get_date_sql('r.tgl_entri').' between \''.$start.'\' and \''.$end.'\')';
|
|
$cnama = array_key_exists('cnama', $_GET) ? $_GET['cnama'] : '';
|
|
$cno_nonreg = array_key_exists('cno_nonreg', $_GET) ? $_GET['cno_nonreg'] : '';
|
|
$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'] : '';
|
|
?>
|
|
<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 NON REGISTER HARI INI </h5></div>
|
|
<form name="cari" id="cari" method="get" action="<?php $_SERVER['PHP_SELF']; ?>">
|
|
<input type="hidden" name="link" value="billnonreg" />
|
|
<div class="row text-left">
|
|
<div class="col-md-6 offset-md-6" class="">
|
|
<div class="form-group row">
|
|
<label class="form-control-label col-sm-2"> No Non Reg </label>
|
|
<div class="col-sm-4">
|
|
<input type="text" name="cno_nonreg" size="10" class="form-control form-control-sm" value="<?php echo $cno_nonreg; ?>"/>
|
|
</div>
|
|
<label class="form-control-label col-sm-2"> Nama </label>
|
|
<div class="col-sm-4">
|
|
<input type="text" name="cnama" class="form-control form-control-sm" value="<?php echo $cnama; ?>" oninput="this.value = this.value.toUpperCase()"/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="form-control-label col-sm-2"> No Bill </label>
|
|
<div class="col-sm-4">
|
|
<input type="text" name="nobill" size="10" class="form-control form-control-sm" value="<?php echo $nobill; ?>"/>
|
|
</div>
|
|
<label class="form-control-label col-sm-2 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>
|
|
<div class="form-group row">
|
|
<label class="form-control-label col-sm-2 text-left"> Urutan </label>
|
|
<div class="col-sm-4">
|
|
<?php echo form_dropdown('order_by',['no_nonreg'=>'no_nonreg','nama'=>'nama','nobill'=>'nobill'],'','class="form-control form-control-sm"'); ?>
|
|
</div>
|
|
<div class="col-sm-4 offset-sm-2">
|
|
<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 class="col-sm-2">
|
|
<input type="submit" class="btn btn-secondary" value="Cari" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
<div id="cari_poly" class="container-fluid">
|
|
<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 NON REG</th>
|
|
<th >Nama </th>
|
|
<th >Alamat </th>
|
|
<th width="70px">Status</th>
|
|
<th width="200px">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
|
|
$kondisi=$knama.$kno_nonreg.$kbyr.$waktu.$knobill;
|
|
|
|
$sql_order = ($order_by != '') ? "order by " : '';
|
|
$sql_order .= ($order_by == 'no_nonreg') ? 'r.no_nonreg' : ( ($order_by == 'nama') ? 'r.nama' : ( ($order_by == 'nobill') ? '(select nobill from t_billnonreg br where br.no_nonreg = r.no_nonreg and br.idx_nonreg = r.idx_nonreg limit 1)' : '' ) );
|
|
|
|
$sql = "SELECT DISTINCT r.no_nonreg,(select nobill from t_billnonreg br where br.no_nonreg = r.no_nonreg and br.idx_nonreg = r.idx_nonreg limit 1) as nobill, r.idx_nonreg, r.nama,r.alamat
|
|
from m_nonreg r
|
|
where 1 = 1 $kondisi
|
|
$sql_order";
|
|
|
|
$link_page = "index.php?link=billnonreg";
|
|
$NO = 0;
|
|
$pager = paginate( $sql, 15, 5, "&start=".$start."&end=".$end."&cnama=".$cnama."&cno_nonreg=".$cno_nonreg."&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_bayarnonreg where idx_nonreg = \''.$data['idx_nonreg'].'\' 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['no_nonreg'];?></td>
|
|
<td align="left"><?php echo $data['nama']; ?></td>
|
|
<td align="left"><?php echo $data['alamat']; ?></td>
|
|
<td align="center"><?php echo $status_billing;?></td>
|
|
<td align="center">
|
|
<?php
|
|
$btn_proses = '<a href="index.php?link=cartbill_nonreg&no_nonreg='.$data['no_nonreg'].'&idx_nonreg='.$data['idx_nonreg'].'" class="btn btn-outline-secondary btn-sm"> PROSES </a>';
|
|
$btn_rincian = '<a href="index.php?link=33rekapnonreg&no_nonreg='.$data['no_nonreg'].'&idx_nonreg='.$data['idx_nonreg'].'" class="btn btn-outline-secondary btn-sm"> Rincian Bill </a>';
|
|
echo $btn_proses.$btn_rincian;
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
</tbody>
|
|
</table>
|
|
<?php
|
|
echo $pager['nav'];
|
|
?>
|
|
</div>
|
|
</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();';
|
|
?>
|