150 lines
8.2 KiB
PHP
150 lines
8.2 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$thn=$_POST['thn'];
|
|
$cari_ba=$_POST['cari_ba'];
|
|
$tm1=$_POST['m'];
|
|
$tm1=str_replace('/','-',$tm1);
|
|
$tt1=date('Y',strtotime($tm1));
|
|
$bb1=date('m',strtotime($tm1));
|
|
$hh1=date('d',strtotime($tm1));
|
|
|
|
$ts1=$_POST['s'];
|
|
$ts1=str_replace('/','-',$ts1);
|
|
$tt2=date('Y',strtotime($ts1));
|
|
$bb2=date('m',strtotime($ts1));
|
|
$hh2=date('d',strtotime($ts1));
|
|
$tempdata=$_POST['tempdata'];
|
|
?>
|
|
|
|
<style type="text/css">
|
|
input[type=checkbox] {
|
|
transform: scale(1.5);
|
|
}
|
|
|
|
.table > tbody > tr > td {
|
|
vertical-align: middle;
|
|
}
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
$("#tabel_data_laporan_ba").DataTable({"stateSave": true,"paging": false,"lengthChange": true,"searching": false,"ordering": false,"info": true,"autoWidth": false});
|
|
</script>
|
|
|
|
<input type="hidden" id="temp_data" style="width:600px" value="<?php echo $tempdata; ?>">
|
|
<table id="tabel_data_laporan_ba" class="table table-striped table-condensed table-bordered" style="font-size:13px" cellpadding="1">
|
|
<thead style="color:grey;font-family:InterSB">
|
|
<tr>
|
|
<td align="center" width="30">
|
|
<input type="checkbox" name="checkAll" id="checkAll" class="checkbox cb_data" aria-label="Single checkbox Two" >
|
|
</td>
|
|
<td align="center"width="150px;">Nomor BA</td>
|
|
<td align="center" width="90px;">Tanggal</td>
|
|
<td align="center">Pekerjaan</td>
|
|
<td align="center" width="150px;" style="display:none">Kwi/SP/SPK</td>
|
|
<td align="center" width="98px;" style="display:none">Periode</td>
|
|
<td align="center" width="90px;" style="display:none">Model</td>
|
|
<td align="center" width="110px;">Nilai BA</td>
|
|
<td align="center" width="70px;">PPn</td>
|
|
<td align="center" width="110px;">Realisasi</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black;font-family:Inter">
|
|
<?php
|
|
$d=pg_query("SELECT b.nomor_ba,b.tanggal_ba,s.sub_kegiatan,s.kegiatan,p.kegiatan_pengadaan,p.no_sp,p.tgl_mulai_sp,p.tgl_selesai_sp,
|
|
COALESCE(n.nama,p.cad1),'Direktur',b.nilai_ba,l.ppn,l.nilai_pelunasan,b.id,
|
|
CASE WHEN r.st_termin='termin' THEN
|
|
l.data_ke
|
|
ELSE '0' END,r.st_buku,r.st_termin,r.stum
|
|
FROM riwayat_ba b
|
|
INNER JOIN pekerjaan p ON (p.id=b.pekerjaan_id)
|
|
INNER JOIN sub_kegiatan s ON (s.id=p.sub_kegiatan_id)
|
|
LEFT OUTER JOIN rekanan n ON (n.id=p.rekanan_id)
|
|
LEFT OUTER JOIN vr_pelunasan l ON (l.id=b.vr_pelunasan_id)
|
|
LEFT OUTER JOIN vr_realisasi r ON (r.id=l.vr_realisasi_id)
|
|
WHERE s.thn='$thn' AND b.berita_acara_id=$cari_ba AND p.no_sp NOT LIKE 'SPPD%'
|
|
".($tm1 == null ? "" : "AND b.tanggal_ba::DATE BETWEEN '$tt1-$bb1-$hh1' AND '$tt2-$bb2-$hh2'")."
|
|
ORDER BY p.no_sp ASC,b.tanggal_ba ASC,CASE WHEN r.st_termin='termin' THEN
|
|
l.data_ke
|
|
ELSE '0' END ASC
|
|
");
|
|
while($r=pg_fetch_array($d)) {
|
|
// if ($r[14]=='0') {$trm='';} else {$trm=' - '.strtoupper(($r['st_termin'].' '.$r[14]));}
|
|
|
|
$stum=$r['stum'];
|
|
if ($r[14]=='0') {
|
|
if ($stum=='uang_muka') {$trm='UANG MUKA';} else {$trm='';}
|
|
} else {$trm=strtoupper(($r['st_termin'].' '.$r[14]));}
|
|
|
|
if (($r['tgl_mulai_sp']==null) || ($r['tgl_mulai_sp']=='1970-01-01 00:00:00')) {$tglkn='';} else {
|
|
$tglkn=date('d-m-Y',strtotime($r['tgl_mulai_sp'])).' s/d '.date('d-m-Y',strtotime($r['tgl_selesai_sp'])); }
|
|
?>
|
|
<tr>
|
|
<td align="center" class="kiri">
|
|
<input type="checkbox" id='checkDelete' name='checkDelete[]' class="checkbox cb_data" value="<?php echo $r['id']; ?>"
|
|
aria-label="Single checkbox Two">
|
|
</td>
|
|
|
|
<td align="center"><?php echo $r['nomor_ba'];?></td>
|
|
<td align="center"><?php if ($r['tanggal_ba']==NULL) {} else {echo date('d-m-Y',strtotime($r['tanggal_ba']));} ?></td>
|
|
<!--<td><?php echo strtoupper($r['kegiatan'].' - '.$r['kegiatan_pengadaan'].' - '.$r[8]);?></td>-->
|
|
<td>
|
|
<span style="color:black;font-family:InterSB"><?php echo $r[8]; ?></span><br>
|
|
<span><?php echo $r['sub_kegiatan'].' - '.$r['kegiatan'].' - '.$r['kegiatan_pengadaan'];?></span><br>
|
|
<span style="color:blue;font-family:InterSB"><i class="mdi mdi-apps m-r-5"></i><?php echo $r['no_sp'].' <span style="color:green"><i class="mdi mdi-play m-r-5"></i>'.$tglkn.'</span>';?>
|
|
<?php if (($trm==NULL) || ($trm=='')) {} else { ?><br><span style="font-family:InterSB;color:red"><?php echo $trm; ?></span><?php }?>
|
|
</span>
|
|
</td>
|
|
<td align="center" style="display:none"><?php echo $r['no_sp'];?></td>
|
|
<td align="center" style="display:none"><?php
|
|
if (($r['tgl_mulai_sp']==null) || ($r['tgl_mulai_sp']=='1970-01-01 00:00:00')) {} else {
|
|
echo date('d-m-Y',strtotime($r['tgl_mulai_sp'])).' s/d '.date('d-m-Y',strtotime($r['tgl_selesai_sp'])); }
|
|
?></td>
|
|
|
|
<td align="center" style="display:none"><?php
|
|
if ($r[14]=='0') {echo strtoupper($r['st_buku']);} else {
|
|
echo strtoupper($r['st_buku'].' - '.$r['st_termin'].' '.$r[14]);
|
|
}
|
|
|
|
?></td>
|
|
<td align="right"><?php echo number_format($r['nilai_ba'],0,',','.'); ?></td>
|
|
<td align="right" style="color:#D1D1D1"><?php echo number_format($r['ppn'],0,',','.'); ?></td>
|
|
<td align="right" style="color:#D1D1D1" class="kanan"><?php echo number_format($r['nilai_pelunasan'],0,',','.'); ?></td>
|
|
|
|
</tr>
|
|
<?php } ?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<script>
|
|
/*
|
|
function getSelectedVal(){
|
|
var ID={};
|
|
ID.values=[];
|
|
$("input#checkDelete").each(function(){
|
|
var $this = $(this);
|
|
if($this.is(":checked")){
|
|
ID.values.push($this.attr("value"));
|
|
}
|
|
$("#temp_data").val(ID.values);
|
|
});
|
|
}
|
|
*/
|
|
|
|
function getSelectedVal(){
|
|
let table=$('#tabel_data_laporan_ba').DataTable();
|
|
let arr= [];
|
|
let checkedvalues = table.$('input:checked').each(function () {
|
|
arr.push($(this).attr('value'))
|
|
});
|
|
arr=arr.toString();
|
|
$("#temp_data").val(arr);
|
|
}
|
|
|
|
$("#checkAll").click(function () {
|
|
$('input:checkbox').not(this).prop('checked', this.checked);
|
|
});
|
|
|
|
$("input[type='checkbox']").change(function() {
|
|
getSelectedVal();
|
|
});
|
|
</script>
|