add sppd to git repo
This commit is contained in:
244
app/info/tabel.php
Normal file
244
app/info/tabel.php
Normal file
@@ -0,0 +1,244 @@
|
||||
<?php
|
||||
include("../koneksi.php");
|
||||
$thn=$_POST['thn'];
|
||||
$bulan=$_POST['bulan'];
|
||||
$a=strtoupper($_POST['a']);
|
||||
$c=strtoupper($_POST['c']);
|
||||
$nama=strtolower($_POST['nama']);
|
||||
$untuk=strtolower($_POST['untuk']);
|
||||
$cek_jenis_user=$_POST['cek_jenis_user'];
|
||||
$cek_satuan_kerja=$_POST['cek_satuan_kerja'];
|
||||
$jtspj=$_POST['jtspj'];
|
||||
$key=$_POST['key'];
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('button[name="edit"]').popover();
|
||||
$('button[name="detail"]').popover();
|
||||
$('button[name="hapus"]').popover();
|
||||
$('button[name="rbiaya"]').popover();
|
||||
$("#tabel_data_info").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": false,"ordering": false,"info": true,"autoWidth": false});
|
||||
</script>
|
||||
<input type="hidden" id="st_v" value="<?php echo $cek_jenis_user; ?>">
|
||||
<table id="tabel_data_info" class="table table-striped table-condensed table-bordered" cellpadding="1" style="font-family:'Inter';font-size:14px">
|
||||
<thead style="font-family:InterSB;color:gray;font-size:13px">
|
||||
<tr>
|
||||
<td align="center" width="40px;" style="display:none">Kwi</td>
|
||||
<td align="center" width="40px;">No</td>
|
||||
<td align="center" width="200px;">Nama Pegawai</td>
|
||||
<td align="center" width="100px;" style="display:none">Satuan Kerja</td>
|
||||
|
||||
<td align="center" width="100px;" style="display:none">Tujuan</td>
|
||||
<td align="center" width="110px;" style="display:none">Tanggal</td>
|
||||
<td align="center" width="600px;">Dalam Rangka/Tanggal</td>
|
||||
<td align="center" width="80px;">Status</td>
|
||||
<td align="center" width="100px;">Penginput</td>
|
||||
<td align="center" width="90px;" style="display:none">Setor</td>
|
||||
<td align="center" width="30px;" class="st_ver">::</td>
|
||||
<td align="center" width="50px;">TL</td>
|
||||
<td align="center" width="50px;" style="display:none">Pekerjaan_id</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="color:black">
|
||||
<?php
|
||||
$d=pg_query("SELECT
|
||||
k.no_bukti,
|
||||
COALESCE(p.nama,g.nama_non),
|
||||
s.nama,
|
||||
t.daerah_tujuan,
|
||||
t.tgl_berangkat,
|
||||
t.tgl_kembali,
|
||||
t.untuk,
|
||||
t.jenis_bayar,
|
||||
k.id,
|
||||
g.tgl_setor_berkas,
|
||||
k.ambulance,
|
||||
(row_number() OVER (ORDER BY k.id,g.id)),
|
||||
k.pembuat,
|
||||
k.tanggal,
|
||||
g.pekerjaan_id,
|
||||
g.tgl_setor_verif,
|
||||
g.id,
|
||||
t.kota_dari,
|
||||
(select count(the_day) from (select generate_series(k.tanggal::timestamp, NOW()::timestamp, '1 day') as the_day) days where extract('dow' from the_day) not in (0,6)) as telat,
|
||||
r.aktif
|
||||
FROM sp_kwi k
|
||||
INNER JOIN sp_rek r ON (r.id=k.sp_rek_id)
|
||||
LEFT OUTER JOIN sp_spt t ON (t.sp_kwi_id=k.id)
|
||||
LEFT OUTER JOIN sp_peg g ON (g.sp_spt_id=t.id)
|
||||
LEFT OUTER JOIN data_pegawai p ON (g.data_pegawai_id=p.id)
|
||||
LEFT OUTER JOIN satuan_kerja s ON (p.satuan_kerja=s.id)
|
||||
WHERE k.id IS NOT NULL
|
||||
".($cek_jenis_user == 'ADMIN' ? "" : " AND k.pembuat='$cek_satuan_kerja'")."
|
||||
".($key == 'warning' ? "AND g.tgl_setor_berkas IS NULL AND (select count(the_day) from (select generate_series(k.tanggal::timestamp, NOW()::timestamp, '1 day') as the_day) days where extract('dow' from the_day) not in (0,6)) > $jtspj AND s.nama IS NOT NULL AND k.thn='$thn'" : "
|
||||
".($untuk == '' ? "
|
||||
".($nama == '' ? "
|
||||
".($bulan == '' ? "" : "AND k.thn='$thn' AND k.bulan='$bulan'")."
|
||||
" : " AND LOWER(COALESCE(p.nama,g.nama_non)) LIKE '%$nama%'")."
|
||||
" : " AND LOWER(t.untuk) LIKE '%$untuk%'")."
|
||||
")."
|
||||
ORDER BY k.id DESC,g.id DESC
|
||||
");
|
||||
while($r=pg_fetch_array($d)) {
|
||||
?>
|
||||
<tr
|
||||
<?php
|
||||
if ($r['ambulance']=='t') {echo 'style="color:green"';} else {}
|
||||
?>
|
||||
>
|
||||
<td align="center" class="kiri" style="display:none"><?php echo $r['no_bukti'];?></td>
|
||||
<td align="center" class="kiri"><b><?php echo $r[11]; ?></b></td>
|
||||
<!--<td><?php echo $r[1];?></td>-->
|
||||
<td>
|
||||
<?php if ($r['untuk']==NULL) {} else { ?>
|
||||
<span style="font-family:InterSB"><?php echo $r[1];?></span><br>
|
||||
<span style="font-family:InterSB;color:red">
|
||||
<?php
|
||||
if (($r['kota_dari']==NULL) || ($r['kota_dari']=='MALANG')) {
|
||||
echo '<i class="mdi mdi-map-marker m-r-5"></i>'.strtoupper($r['daerah_tujuan']);
|
||||
} else {
|
||||
echo '<i class="mdi mdi-map-marker m-r-5"></i>'.strtoupper($r['kota_dari']).' ke '.strtoupper($r['daerah_tujuan']);
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td style="display:none"><?php echo $r[2];?></td>
|
||||
<td style="display:none"><?php echo $r[3];?></td>
|
||||
<td align="left" style="display:none"><?php
|
||||
if (($r['tgl_berangkat']==null) || ($r['tgl_berangkat']=='1970-01-01 00:00:00')) {} else {
|
||||
echo date('d-m-Y',strtotime($r['tgl_berangkat'])).' s/d '.date('d-m-Y',strtotime($r['tgl_kembali'])); }
|
||||
?></td>
|
||||
<?php if ($r['untuk']==NULL) { ?>
|
||||
<td style="color:#C7BEA2;font-size:13px">
|
||||
<span><?php echo '::::::::::: Belum diproses-lanjut oleh '.$r['pembuat'].' :::::::::::'; ?></span>
|
||||
<br>
|
||||
<span><?php echo '::::::::::: tanggal input '.date('d-m-Y h:i',strtotime($r['tanggal'])).' :::::::::::'; ?></span>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td>
|
||||
<span><?php echo $r['untuk'];?></span><br>
|
||||
<span style="color:blue;font-family:InterSB"><i class='mdi mdi-apps m-r-5'></i><?php
|
||||
if (($r['tgl_berangkat']==null) || ($r['tgl_berangkat']=='1970-01-01 00:00:00')) {} else {
|
||||
echo date('d-m-Y',strtotime($r['tgl_berangkat'])).' s/d '.date('d-m-Y',strtotime($r['tgl_kembali'])); }
|
||||
?>
|
||||
</span>
|
||||
<?php if (($r['tgl_setor_berkas']==NULL) && ($r['telat']>$jtspj)) { ?>
|
||||
<br><span style="color:red;font-family:InterSB">PERHATIAN ! Segera setorkan berkas-berkas SPPD untuk di SPJ kan</span>
|
||||
<?php } else {} ?>
|
||||
<?php if ($r['aktif']=='f') { ?>
|
||||
<br><span style="font-family:Arial;color:green;font-weight:bold;font-size:14px">
|
||||
<i class="mdi mdi-alert-circle-outline m-r-5"></i>HARAP MENGGUNAKAN ANGGARAN TAHUN <?php echo $thn; ?>
|
||||
</span>
|
||||
<?php } else {} ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td align="center"><?php echo $r['jenis_bayar'];?></td>
|
||||
<td align="center">
|
||||
<?php if ($cek_jenis_user=='ADMIN') {
|
||||
?>
|
||||
<button class="btn btn-block btn-xs ed_penginput" style="color:green;white-space: normal;word-wrap: break-word;" id="<?php echo $r[8];?>">
|
||||
<?php echo $r['pembuat']; ?>
|
||||
</button>
|
||||
<?php
|
||||
} else {echo $r['pembuat'];} ?>
|
||||
</td>
|
||||
<td align="center" style="display:none"><?php
|
||||
if (($r['tgl_setor_berkas']==null) || ($r['tgl_setor_berkas']=='1970-01-01 00:00:00')) {} else {
|
||||
echo date('d-m-Y',strtotime($r['tgl_setor_berkas'])); }
|
||||
?></td>
|
||||
<td class="st_ver" align="center" style="color:red"><?php
|
||||
if (($r['tgl_setor_verif']==null) || ($r['tgl_setor_verif']=='1970-01-01 00:00:00')) {} else {
|
||||
?> <button name="rbiaya" id="<?php echo $r[16];?>" class="btn btn-block btn-xs rbiaya" style="height:25px" data-content="Rincian Biaya" rel="popover" data-placement="top" data-trigger="hover"><i class="fa fa-check"></i></button><?php }
|
||||
?></td>
|
||||
<td align="center" class="kanan">
|
||||
<!--<button type="button" name="detail" style="height:22px;"class="btn btn-primary btn-xs detail" id="<?php echo $r[8];?>" data-content="Detail" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
</button>-->
|
||||
<?php if ((($cek_satuan_kerja==$r['pembuat'])) || ($cek_jenis_user=='ADMIN')) {?>
|
||||
<button type="button" name="edit" style="height:22px;"class="btn btn-primary btn-xs edit" id="<?php echo $r[8];?>" data-content="Lanjut" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-arrow-right"></i>
|
||||
</button>
|
||||
<?php } ?>
|
||||
<?php if ((($r[3]=='') && ($cek_satuan_kerja==$r['pembuat'])) || ($cek_jenis_user=='ADMIN')) {?>
|
||||
<button type="button" name="hapus" style="height:22px;"class="btn btn-danger btn-xs hapus" id="<?php echo $r[8];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
<?php } else {} ?>
|
||||
|
||||
|
||||
</td>
|
||||
<td style="display:none"><?php echo $r['pekerjaan_id']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
//var stv=$('#st_v').val();
|
||||
//if (stv=='ADMIN') {$('.st_ver').show();} else {$('.st_ver').hide();}
|
||||
|
||||
$("#tabel_data_info").on('click','.edit',function(){
|
||||
var id = $(this).attr('id');
|
||||
$.post('app/sppd/main.php',{sp_kwi_id:id},function(html){$("#main_tag").html(html)});
|
||||
});
|
||||
|
||||
$("#tabel_data_info").on('click','.rbiaya',function(){
|
||||
var sp_peg_id = $(this).attr('id');
|
||||
var key = 'print_rincian';
|
||||
var w = 600;
|
||||
var h = 800;
|
||||
var left = Number((screen.width/2)-(w/2));
|
||||
var tops = Number((screen.height/2)-(h/2));
|
||||
window.open('app/sppd/print/pdf.php?sp_peg_id='+sp_peg_id+'&key='+key,'newwin','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+tops+', left='+left)
|
||||
});
|
||||
|
||||
$("#tabel_data_info").on('click','.hapus',function(){
|
||||
alert('Nahhhh.. ternyata kamu ya biang kerok hilangnya data beberapa hari ini');
|
||||
/*var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_kwi";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/info/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
if (data=='gakiso') {
|
||||
alert('Data sudah di-verifikasi, tidak bisa dihapus');
|
||||
} else {
|
||||
var thn=$("#thn_dpa option:selected").text();
|
||||
var bulan=$('#bulan').val();
|
||||
var a = $('#jenis_sppd').val();
|
||||
var c = $('#satker').val();
|
||||
var cek_jenis_user = $('#cek_jenis_user').val();
|
||||
var cek_satuan_kerja = $('#cek_satuan_kerja').val();
|
||||
$('#tabel_info').load('app/info/tabel.php',{a:a,c:c,thn:thn,bulan:bulan,cek_jenis_user:cek_jenis_user,cek_satuan_kerja:cek_satuan_kerja});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {} */
|
||||
});
|
||||
|
||||
$("#tabel_data_info").on('click','.ed_penginput',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_penginput').modal('show');
|
||||
$('#modal_body_penginput').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/info/modal_penginput.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_penginput').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user