Files
simak/app/input_ba/modal_cari_ba.php
2025-10-10 09:25:05 +07:00

82 lines
4.2 KiB
PHP

<?php
include('../koneksi.php');
$pekerjaan_id=$_POST['pekerjaan_id'];
$vr_pelunasan_id=$_POST['vr_pelunasan_id'];
?>
<input type="hidden" id="pekerjaan_idx_cari" value="<?php echo $pekerjaan_id; ?>">
<input type="hidden" id="vr_pelunasan_idx_cari" value="<?php echo $vr_pelunasan_id; ?>">
<script type="text/javascript">
$("#tabel_data_databa_cari").DataTable({"stateSave": true,"paging": false,"lengthChange": false,"searching": true,"ordering": false,"info": false,"autoWidth": false});
</script>
<br>
<input type="hidden" id="temp_data_c" style="width:600px" value="<?php echo $tempdata; ?>">
<table id="tabel_data_databa_cari" class="table table-striped table-condensed table-bordered" cellpadding="1" style="font-family:Inter;font-size:13px">
<thead style="font-family:InterSB">
<tr align="center">
<td>#</td>
<td>Berita Acara</td>
<td width="180px;">Nomor BA</td>
<td width="120px;">Nilai BA</td>
<td width="100px;">Tgl BA</td>
<td width="120px;" align="center">Status</td>
</tr>
</thead>
<tbody>
<?php
$n=0;
$data=pg_query("SELECT b.nama,r.nomor_ba,r.tanggal_ba,r.created_at,r.id,r.nilai_ba,r.vr_pelunasan_id,
r.st_termin,r.termin_ke
FROM riwayat_ba r
INNER JOIN berita_acara b ON (b.id=r.berita_acara_id)
WHERE r.pekerjaan_id='$pekerjaan_id'
ORDER BY r.id DESC
");
while($r=pg_fetch_array($data)) {
?>
<tr style="color:#BBBBBB">
<td align="center" class="kiri">
<input type="checkbox" id='checkDelete_c' name='checkDelete_c[]' class="checkbox_c cb_data_c" value="<?php echo $r['id']; ?>"
aria-label="Single checkbox Two">
</td>
<td><?php echo $r[0]; ?></td>
<td align="center"><?php echo $r[1]; ?></td>
<td align="right"><?php echo number_format($r['nilai_ba'],0,',','.'); ?></td>
<td align="center"><?php echo date('d-m-Y',strtotime($r['tanggal_ba'])); ?></td>
<td class="kanan" align="center"><?php
if ($r['st_termin']=='termin') {echo strtoupper($r['st_termin']).' '.$r['termin_ke'];} else {
if ($r['st_termin']=='uang muka') {echo strtoupper($r['st_termin']);} else {}
}
?></td>
</tr>
<?php
$n=$n+$r[6];
}
?>
</tbody>
</table>
<script>
$('#simpan_databa_caric').prop("disabled", true);
function getSelectedVal(){
var ID={};
ID.values=[];
$("input#checkDelete_c").each(function(){
var $this = $(this);
if($this.is(":checked")){
ID.values.push($this.attr("value"));
$(this).closest('tr').find('td').css('color', 'black');
} else {$(this).closest('tr').find('td').css('color', '#BBBBBB')}
$("#temp_data_c").val(ID.values);
});
}
$("input[type='checkbox']").change(function() {
getSelectedVal();
var indah = $("#temp_data_c").val();
if (!indah) {$('#simpan_databa_caric').prop("disabled", true);} else {$('#simpan_databa_caric').prop("disabled", false);}
});
</script>