106 lines
4.0 KiB
PHP
106 lines
4.0 KiB
PHP
<?php
|
|
include('../koneksi.php');
|
|
$thn=$_POST['thn'];
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
/*$('button[name="sub"]').popover();
|
|
$('button[name="revisi_kd_panggil"]').popover();
|
|
$('button[name="detail"]').popover();*/
|
|
$('button[name="batalkan"]').popover();
|
|
$('button[name="tentukan"]').popover();
|
|
$("#tabel_data_msb_hasil").DataTable({"stateSave": true,"paging": false,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});
|
|
</script>
|
|
|
|
<table id="tabel_data_msb_hasil" class="table table-condensed table-striped table-bordered" style="font-size:13px">
|
|
<thead style="color:grey;font-family:InterSB">
|
|
<tr width="40">
|
|
<td align="center" width="30">No</td>
|
|
<td align="center" width="400">Belanja</td>
|
|
<td align="center" width="30">H</td>
|
|
<td align="center" width="400">Kategori Persyaratan</td>
|
|
<td align="center" width="60">Tools</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black;font-family:Inter">
|
|
<?php
|
|
$no=1;
|
|
$d=pg_query("SELECT DISTINCT k.kegiatan,CASE WHEN k.rh!='' THEN CONCAT(k.rh,' - ') ELSE '' END,
|
|
k.rh, NULLIF(regexp_replace(k.rh,'\D','','g'),'')::numeric, k.msb_kategori_id,m.nama,m.jenis
|
|
FROM sub_kegiatan k
|
|
LEFT OUTER JOIN msb_kategori m ON (m.id=k.msb_kategori_id)
|
|
WHERE k.thn='$thn' ORDER BY NULLIF(regexp_replace(k.rh,'\D','','g'),'')::numeric ASC,k.kegiatan ASC");
|
|
while($r=pg_fetch_array($d)) {
|
|
?>
|
|
<tr>
|
|
<td align="center" class="kiri"><?php echo $no; ?></td>
|
|
<td><?php echo $r[0]; ?></td>
|
|
<td align="center"><?php echo $r[2]; ?></td>
|
|
<td><?php if (($r[5]==NULL) || ($r[5]=='')) {} else {echo $r[6].' - '.$r[5];} ?></td>
|
|
<td align="center" class="kanan">
|
|
<?php
|
|
if (($r[5]==NULL) || ($r[5]=='')) {
|
|
?>
|
|
<button type="button" name="tentukan" style="height:22px;"class="btn btn-default btn-xs tentukan" id="<?php echo $r['kegiatan'].'$%^'.$r['rh'];?>" data-content="Tentukan Kategori" rel="popover" data-placement="top" data-trigger="hover">
|
|
<i class="fa fa-question"></i>
|
|
</button>
|
|
<?php } else { ?>
|
|
<button type="button" name="batalkan" style="height:22px;"class="btn btn-danger btn-xs batalkan" id="<?php echo $r['kegiatan'].'$%^'.$r['rh'];?>" data-content="Batalkan Kategori" rel="popover" data-placement="top" data-trigger="hover">
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
<?php } ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
$no++;
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<script>
|
|
$("#tabel_data_msb_hasil").on('click','.tentukan',function(){
|
|
var data_id = $(this).attr('id');
|
|
var currentRow=$(this).closest("tr");
|
|
var belanja = currentRow.find("td:eq(1)").text();
|
|
var thn_dpa = $("#thn_dpa option:selected").text();
|
|
var chars = data_id.split('$%^');
|
|
var rh = chars[1];
|
|
$('#modal_terapkan').modal('show');
|
|
$('#modal_body_terapkan').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/msb_syarat/modal.php",
|
|
data: 'data_id='+data_id
|
|
+'&belanja='+belanja
|
|
+'&rh='+rh
|
|
+'&thn='+thn_dpa,
|
|
success: function(data){
|
|
$('#modal_body_terapkan').html(data);
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_msb_hasil").on('click','.batalkan',function(){
|
|
var data_id = $(this).attr('id');
|
|
var currentRow=$(this).closest("tr");
|
|
var belanja = currentRow.find("td:eq(1)").text();
|
|
var thn_dpa = $("#thn_dpa option:selected").text();
|
|
var chars = data_id.split('$%^');
|
|
var rh = chars[1];
|
|
var key = 'batal_terapkan';
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/msb_syarat/crud.php",
|
|
data: 'belanja='+belanja
|
|
+'&rh='+rh
|
|
+'&thn='+thn_dpa
|
|
+'&key='+key,
|
|
success: function(data){
|
|
alert('tersimpan..');
|
|
var thn_dpa = $("#thn_dpa option:selected").text();
|
|
$('#tabel_msb_hasil').load('app/msb_syarat/tabel_hasil.php', {thn:thn_dpa});
|
|
}
|
|
});
|
|
});
|
|
</script>
|