first commit
This commit is contained in:
92
rekap_pembayaran_ranap.php
Normal file
92
rekap_pembayaran_ranap.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
include("core/main.php");
|
||||
|
||||
if($_REQUEST['tgl_reg'] != ''){
|
||||
$start = $_GET['tgl_reg'];
|
||||
$end = $_GET['tgl_reg2'];
|
||||
if($start == ''){
|
||||
$start = date('Y-m-d');
|
||||
}
|
||||
if($end == ''){
|
||||
$end = date('Y-m-d');
|
||||
}
|
||||
$search = 'and (tglbayar between \''.$start.'\' and \''.$end.'\')';
|
||||
}else{
|
||||
$search = 'and (tglbayar between \''.date('Y-m-d').'\' and \''.date('Y-m-d').'\')';
|
||||
}
|
||||
?>
|
||||
|
||||
<div align="center">
|
||||
<div id="frame">
|
||||
<div id="frame_title">
|
||||
<h5>REKAP PENDAPATAN RANAP</h5></div>
|
||||
<div align="right" style="margin:5px;">
|
||||
<form name="formsearch" method="get" action="<?php $_SERVER['PHP_SELF']; ?>" >
|
||||
<input type="hidden" name="link" value="35" />
|
||||
<div class="row">
|
||||
<div class="col-md-4 offset-md-7" style="text-align: left">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label" style="text-align:left">Tanggal </label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="tgl_reg" id="tgl_pesan" readonly="readonly" class="form-control datepicker-default mask-date-default"value="<?php if(array_key_exists('tgl_reg', $_REQUEST) && $_REQUEST['tgl_reg'] !=""): echo $_REQUEST['tgl_reg']; else: echo date('Y-m-d'); endif; ?>"/>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="tgl_reg2" id="tgl_reg2" readonly="readonly" class="form-control datepicker-default mask-date-default"value="<?php if(array_key_exists('tgl_reg2', $_REQUEST) && $_REQUEST['tgl_reg2'] !=""): echo $_REQUEST['tgl_reg2']; else: echo date('Y-m-d'); endif; ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4 col-form-label"> </label>
|
||||
<div class="col-sm-4">
|
||||
<button name="filter" class="btn btn-primary ">Cari</button>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
$sql = 'SELECT tglbayar, t_bayarranap.shift from t_bayarranap
|
||||
JOIN t_billranap ON t_billranap.idxdaftar=t_bayarranap.idxdaftar AND t_billranap.carabayar=1
|
||||
where tglbayar is not null and t_bayarranap.STATUS = \'LUNAS\' '.$search;
|
||||
$qry = $db->query($sql);
|
||||
?>
|
||||
<div id="table_search" style="min-height:300px;">
|
||||
<table width="95%" border="0" class="table table-bordered table-striped table-sm" cellspacing="0" cellspading="0">
|
||||
<tr align="center" class="bg-success text-white"><th width="156">TGL BAYAR</th><th width="129">SHIFT I</th><th width="130">SHIFT II</th><th width="116">SHIFT III</th><th width="204">Total Pendapatan Perhari</th></tr>
|
||||
<?php
|
||||
foreach($qry->fetchAll() as $data){
|
||||
$sql_1 = $db->query('SELECT tglbayar, t_bayarranap.shift,tottarifrs,SUM((t_billranap.tarifrs*t_billranap.qty)-t_billranap.costsharing_pelayanan-t_billranap.costsharing_anastesi-t_billranap.askes) AS total
|
||||
FROM t_bayarranap
|
||||
INNER JOIN t_billranap ON t_billranap.idxbill=t_bayarranap.idxbill AND t_billranap.carabayar=1
|
||||
WHERE tglbayar =\''.$data['tglbayar'].'\' AND t_bayarranap.shift = 1 AND t_bayarranap.status = \'LUNAS\'
|
||||
GROUP BY t_bayarranap.tglbayar,t_bayarranap.shift,t_bayarranap.tottarifrs');
|
||||
$shift_1= $sql_1->fetchAll()[0];
|
||||
|
||||
$sql_2 = $db->query('SELECT tglbayar, t_bayarranap.shift,tottarifrs,sum((t_billranap.tarifrs*t_billranap.qty)-t_billranap.costsharing_pelayanan-t_billranap.costsharing_anastesi-t_billranap.askes) AS total
|
||||
FROM t_bayarranap
|
||||
INNER JOIN t_billranap ON t_billranap.idxbill=t_bayarranap.idxbill AND t_billranap.carabayar=1
|
||||
WHERE tglbayar =\''.$data['tglbayar'].'\' AND t_bayarranap.shift = 2 AND t_bayarranap.status = \'LUNAS\'
|
||||
GROUP BY t_bayarranap.tglbayar,t_bayarranap.shift,t_bayarranap.tottarifrs');
|
||||
$shift_2= $sql_2->fetchAll()[0];
|
||||
|
||||
$sql_3 = $db->query('SELECT tglbayar, t_bayarranap.shift,tottarifrs,sum((t_billranap.tarifrs*t_billranap.qty)-t_billranap.costsharing_pelayanan-t_billranap.costsharing_anastesi-t_billranap.askes) AS total
|
||||
FROM t_bayarranap
|
||||
INNER JOIN t_billranap ON t_billranap.idxbill=t_bayarranap.idxbill AND t_billranap.carabayar=1
|
||||
WHERE tglbayar =\''.$data['tglbayar'].'\' AND t_bayarranap.shift = 3 AND t_bayarranap.status = \'LUNAS\'
|
||||
GROUP BY t_bayarranap.tglbayar,t_bayarranap.shift,t_bayarranap.tottarifrs');
|
||||
$shift_3= $sql_3->fetchAll()[0];
|
||||
|
||||
echo '<tr>
|
||||
<td>'.$data['tglbayar'].' ['.'<a href="index.php?link=35pertanggal&tgl='.$data['tglbayar'].'">Rekap</a>
|
||||
<a href="index.php?link=35pertanggal_det&tgl='.$data['tglbayar'].'"> | Det ]</a>
|
||||
</td>
|
||||
<td align="right">'.format_uang($shift_1['total']).'</td>
|
||||
<td align="right">'.format_uang($shift_2['total']).'</td>
|
||||
<td align="right">'.format_uang($shift_3['total']).'</td>
|
||||
<td align="right">'.format_uang($shift_1['total']+$shift_2['total']+$shift_3['total']).'</td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user