139 lines
8.5 KiB
PHP
139 lines
8.5 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$satuan_kerja_id=$_POST['satker'];
|
|
$jenis_user=$_POST['jenis'];
|
|
$nampeg=$_POST['nampeg'];
|
|
$bln=$_POST['bln'];
|
|
$thn=$_POST['thn'];
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
$('button[name="proses_kendalibu"]').popover();
|
|
$("#tabel_data_smasuk").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});
|
|
</script>
|
|
|
|
<input type="hidden" value="<?php echo $nampeg; ?>" id="nampeg">
|
|
<input type="hidden" value="<?php echo $jenis_user; ?>" id="jenis">
|
|
|
|
<table id="tabel_data_smasuk" class="table table-striped table-condensed table-bordered" cellpadding="1">
|
|
<thead>
|
|
<tr>
|
|
<!--<td>Dari</td>-->
|
|
<td width="80px;">No Kendali</td>
|
|
<td width="80px;">Tgl-Jam</td>
|
|
<td width="220px;">Pengolah</td>
|
|
<td>Perihal</td>
|
|
<td width="100px;">Jenis</td>
|
|
<td width="80px;">Tools</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black">
|
|
<?php
|
|
$data=pg_query("SELECT DISTINCT (SELECT a.nama FROM satuan_kerja a WHERE a.id=s.satuan_kerja_dari),
|
|
s.no_kendali,
|
|
s.tgl_diterima,s.jam_diterima,
|
|
(SELECT a.nama FROM satuan_kerja a WHERE a.id=s.satuan_kerja_dari),
|
|
s.perihal,
|
|
(SELECT f.sifat FROM sifat_surat f WHERE f.id=s.sifat_surat_id),
|
|
(SELECT j.jenis FROM jenis_disposisi j WHERE j.id=s.jenis_disposisi_id),
|
|
s.sm_baca,s.id
|
|
FROM surat s INNER JOIN kirim k ON (s.id=k.surat_id)
|
|
WHERE s.jenis_disposisi_id='2'
|
|
".($thn == '' ? "" : "AND EXTRACT(YEAR FROM DATE(s.tgl_diterima))='$thn'")."
|
|
".($bln == '0' ? "" : "AND EXTRACT(MONTH FROM DATE(s.tgl_diterima))='$bln'")."
|
|
AND k.satuan_kerja_tujuan='$satuan_kerja_id' AND k.tgl_input IS NULL
|
|
ORDER BY s.id DESC
|
|
");
|
|
while($r=pg_fetch_array($data)) {
|
|
|
|
/*
|
|
$data=pg_query("SELECT DISTINCT (SELECT a.nama FROM satuan_kerja a WHERE a.id=s.satuan_kerja_dari),
|
|
s.no_kendali,
|
|
s.tgl_diterima,s.jam_diterima,
|
|
(SELECT a.nama FROM satuan_kerja a WHERE a.id=s.satuan_kerja_dari),
|
|
s.perihal,
|
|
(SELECT f.sifat FROM sifat_surat f WHERE f.id=s.sifat_surat_id),
|
|
(SELECT j.jenis FROM jenis_disposisi j WHERE j.id=s.jenis_disposisi_id),
|
|
s.sm_baca,s.id
|
|
FROM surat s INNER JOIN kirim k ON (s.id=k.surat_id)
|
|
WHERE s.jenis_disposisi_id='2'
|
|
".($jenis_user == 'Admin' || $jenis_user == 'Direksi' ? "" : "AND k.satuan_kerja_tujuan='$satuan_kerja_id'")."
|
|
ORDER BY s.id DESC
|
|
");
|
|
while($r=pg_fetch_array($data)) {
|
|
|
|
*/
|
|
?>
|
|
<tr>
|
|
<!--<td><?php echo $r[0]; ?></td>-->
|
|
<td class="kiri" align="center" style="font-family:InterSB"><?php
|
|
$no_pinjam=(int) substr($r['no_kendali'],0,5);
|
|
$no_kendali=sprintf("%05s",$no_pinjam);
|
|
echo $no_kendali;
|
|
?></td>
|
|
<td align="center"><?php echo date('d-m-Y',strtotime($r['tgl_diterima'])).' '.date('H:i',strtotime($r['jam_diterima'])); ?></td>
|
|
<td style="font-family:InterSB"><?php echo $r[4]; ?></td>
|
|
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;"><?php echo $r['perihal']; ?></td>
|
|
<td align="center"><?php echo $r[7]; ?></td>
|
|
<td class="kanan" align="center">
|
|
<!--
|
|
<?php if ($jenis_user=='Admin') { ?>
|
|
<button type="button" name="edit_kendali" style="height:22px;"class="btn btn-primary btn-xs edit_kendali" id="<?php echo $r['id'];?>" data-content="Edit" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>
|
|
<?php } ?>
|
|
-->
|
|
<button type="button" name="proses_kendalibu" style="height:22px;"class="btn btn-success btn-xs proses_kendalibu" id="<?php echo $r['id'];?>" data-content="Proses Mutasi" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-arrow-right"></i>
|
|
</button>
|
|
<!--
|
|
<button type="button" name="print_kendali" style="height:22px;"class="btn btn-inverse btn-xs print_kendali" id="<?php echo $r['id'];?>" data-content="Print Kendali" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="glyphicon glyphicon-print"></i>
|
|
</button>
|
|
</td>-->
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<script type="text/javascript">
|
|
//$('button[name="edit_kendali"]').popover();
|
|
|
|
//$('button[name="print_kendali"]').popover();
|
|
|
|
$("#tabel_data_smasuk").on('click','.proses_kendalibu',function(){
|
|
var id = $(this).attr('id');
|
|
var jenis = $('#jenis').val();
|
|
var key = 'kendalibu';
|
|
$.post('app/kendali/arahan/main.php',{surat_id : id, jenis:jenis, key:key},function(html){$("#main_tag").html(html);});
|
|
});
|
|
|
|
/*
|
|
$("#tabel_data_smasuk").on('click','.print_kendali',function(){
|
|
var nampeg = $('#nampeg').val();
|
|
var surat_id = $(this).attr('id');
|
|
var w = 1000;
|
|
var h = 800;
|
|
var left = Number((screen.width/2)-(w/2));
|
|
var tops = Number((screen.height/2)-(h/2));
|
|
$.post('app/smasuk/print_kendali.php', { surat_id : surat_id, nampeg:nampeg}, function (result) {
|
|
WinId = window.open('', 'newwin', 'toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+tops+', left='+left);
|
|
WinId.document.open();
|
|
WinId.document.write(result);
|
|
WinId.document.close();
|
|
WinId.focus();
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_smasuk").on('click','.edit_kendali',function(){
|
|
var id = $(this).attr('id');
|
|
var jenis = $('#jenis').val();
|
|
$.post('app/smasuk/main.php',{surat_id : id, jenis:jenis},function(html){$("#main_tag").html(html);});
|
|
}); */
|
|
</script>
|