127 lines
7.0 KiB
PHP
127 lines
7.0 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$filter_status=$_POST['filter_status'];
|
|
$jenis=$_POST['jenis'];
|
|
$satker_id=$_POST['satker_id'];
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
var sess_satker = $('#cek_satker').val();
|
|
var sess_jenis = $('#cek_jenis').val();
|
|
if (sess_jenis=='Kordik') {$('.hiddik').hide();} else {$('.hiddik').show();}
|
|
$('button[name="proses_verifikasi"]').popover();
|
|
$('button[name="hapus_verifikasi"]').popover();
|
|
$("#tabel_data_inbox").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});
|
|
</script>
|
|
<table id="tabel_data_inbox" class="table table-striped table-condensed table-bordered" cellpadding="1" style="font-family:'RubReg';font-size:13px">
|
|
<thead>
|
|
<tr style="text-align:center;color:gray;font-family:InterSB">
|
|
<td align="center"width="30px;">NO</td>
|
|
<td align="center" width="250px;">NAMA</td>
|
|
<td align="center" width="100px;">TGL USULAN</td>
|
|
<td align="center" width="150px;">STATUS USULAN</td>
|
|
<td align="center" width="200px;">KETERANGAN</td>
|
|
<td align="center" width="100px;">TGL VERIFIKASI</td>
|
|
<td align="center" width="60px;" class="hiddik">TOOLS</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black">
|
|
<?php
|
|
$no=1;
|
|
$d=pg_query("SELECT i.id,i.data_pegawai_id,i.tgl_usulan,i.tgl_verifikasi,i.status,i.ket,p.nama
|
|
FROM riwayat_spo i
|
|
INNER JOIN data_pegawai p ON (p.id=i.data_pegawai_id)
|
|
WHERE i.id IS NOT NULL
|
|
".($jenis== 'Kordik' ? "AND p.satuan_kerja=$satker_id" : "")."
|
|
".($filter_status== 'BELUM VERIFIKASI' ? "AND i.tgl_verifikasi IS NULL AND i.status IS NULL" : "
|
|
".($filter_status== 'SELESAI VERIFIKASI' ? "AND i.tgl_verifikasi IS NOT NULL AND i.status='SELESAI VERIFIKASI'" : "
|
|
".($filter_status== 'TIDAK MEMENUHI SYARAT' ? "AND i.tgl_verifikasi IS NULL AND i.status='TIDAK MEMENUHI SYARAT'" : "
|
|
".($filter_status== 'TIDAK DISETUJUI' ? "AND i.tgl_verifikasi IS NULL AND i.status='TIDAK DISETUJUI'" : "
|
|
".($filter_status== 'BATAL' ? "AND i.status='BATAL'" : "
|
|
".($filter_status== 'REVISI' ? "AND i.status='REVISI'" : "
|
|
".($filter_status== 'ARSIP' ? "AND i.status='ARSIP'" : "AND COALESCE(i.status,'')<>'PROSES PENGAJUAN'")."
|
|
")."
|
|
")."
|
|
")."
|
|
")."
|
|
")."
|
|
")."
|
|
ORDER BY i.id DESC
|
|
");
|
|
while($r=pg_fetch_array($d)) {
|
|
if (($r['tgl_verifikasi']==NULL) && ($r['status']==NULL)) {$st='BELUM VERIFIKASI';} else {$st=$r['status'];}
|
|
?>
|
|
<tr>
|
|
<td class="kiri" align="center"><?php echo $no; ?></td>
|
|
<td><?php echo $r['nama']; ?></td>
|
|
<td align="center"><?php
|
|
if (($r['tgl_usulan']==null) || ($r['tgl_usulan']=='1970-01-01 00:00:00')) {} else {
|
|
echo date('d-m-Y',strtotime($r['tgl_usulan'])); }
|
|
?>
|
|
</td>
|
|
<td align="center"><?php echo $st; ?></td>
|
|
<td><?php echo $r['ket']; ?></td>
|
|
<td align="center"><?php
|
|
if (($r['tgl_verifikasi']==null) || ($r['tgl_verifikasi']=='1970-01-01 00:00:00')) {} else {
|
|
echo date('d-m-Y',strtotime($r['tgl_verifikasi'])); }
|
|
?>
|
|
</td>
|
|
<td align="center" class="kanan hiddik">
|
|
<button type="button" name="proses_verifikasi" style="height:22px;"class="btn btn-success btn-xs proses_verifikasi" id="<?php echo $r['id'];?>" data-content="Proses Verifikasi" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-arrow-right"></i>
|
|
</button>
|
|
<button type="button" name="hapus_verifikasi" style="height:22px;"class="btn btn-danger btn-xs hapus_verifikasi" id="<?php echo $r['id'];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
$no++;
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<script>
|
|
|
|
|
|
$("#tabel_data_inbox").on('click','.proses_verifikasi',function(){
|
|
var riwayat_spo_id = $(this).attr('id');
|
|
var currentRow=$(this).closest("tr");
|
|
var nama = currentRow.find("td:eq(1)").text();
|
|
$('#modal_verifikasi').modal('show');
|
|
$('#modal_body_verifikasi').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/spo_inbox/modal_verifikasi.php",
|
|
data: 'riwayat_spo_id='+riwayat_spo_id,
|
|
success: function(data){
|
|
$('#modal_body_verifikasi').html(data);
|
|
$('#modal_head_verifikasi').html('Sponsorship a.n. '+nama);
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_inbox").on('click','.hapus_verifikasi',function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "hapus_verifikasi";
|
|
var riwayat_spo_id = $(this).attr('id');
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/spo_inbox/crud.php",
|
|
data: 'riwayat_spo_id='+riwayat_spo_id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
var filter_status=$('#filter_status').val();
|
|
var sess_satker = $('#cek_satker').val();
|
|
var sess_jenis = $('#cek_jenis').val();
|
|
$('#tabel_riwayat_spo').load("app/spo_inbox/tabel.php",{filter_status:filter_status, satker_id:sess_satker, jenis:sess_jenis});
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
</script>
|