first commit
This commit is contained in:
315
app/disposisi/arahan/tabel_CAD.php
Normal file
315
app/disposisi/arahan/tabel_CAD.php
Normal file
@@ -0,0 +1,315 @@
|
||||
<?php
|
||||
//date_default_timezone_set('Asia/Jakarta');
|
||||
include('../../koneksi.php');
|
||||
$satker=$_POST['satker'];
|
||||
$jenis=$_POST['jenis'];
|
||||
$surat_id=$_POST['surat_id'];
|
||||
$cek_jabatan=$_POST['cek_jabatan'];
|
||||
|
||||
|
||||
$mcv=pg_query("SELECT jabatan_pegawai_id FROM data_user WHERE satuan_kerja_id='$satker' AND jenis_user=3 LIMIT 1");
|
||||
while($rmcv=pg_fetch_array($mcv)) {$kepada=$rmcv[0];}
|
||||
|
||||
|
||||
$max=pg_query("SELECT MAX(id) FROM kirim WHERE surat_id='$surat_id' AND LEFT(isi,1) NOT IN ('#')");
|
||||
while($rmax=pg_fetch_array($max)) {$maxid=$rmax[0];}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">$("#tabel_data_arahan").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,
|
||||
"info": true,"autoWidth": false,
|
||||
"lengthMenu": [ [25, 50, -1], [25, 50, "ALL"] ],"pageLength": 25
|
||||
});
|
||||
</script>
|
||||
<input type="hidden" value="<?php echo $surat_id; ?>" id="surat_id">
|
||||
<input type="hidden" value="<?php echo $jenis; ?>" id="jenis">
|
||||
<input type="hidden" value="<?php echo $satker; ?>" id="satker">
|
||||
<table id="tabel_data_arahan" class="table table-striped table-condensed table-bordered" cellpadding="1">
|
||||
<thead style="color:black">
|
||||
<tr>
|
||||
<td width="80px;" align="center"><b>TANGGAL</b></td>
|
||||
<td width="160px;" align="center"><b>KEPADA</b></td>
|
||||
<td align="center"><b>ISI DISPOSISI</b></td>
|
||||
<!--<td width="160px;" align="center"><b>DARI</b></td>-->
|
||||
|
||||
<td align="center" align="center"><b>PARAF</b></td>
|
||||
<td width="60px;" align="center" align="center"><b>STATUS</b></td>
|
||||
<?php if ($jenis=='Admin') {?><td width="60px;" align="center"><b>LAMA</b></td> <?php } else {} ?>
|
||||
<td width="60px;" align="center"><b>TOOLS</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$a=pg_query("SELECT k1.jam_input FROM kirim k1 WHERE k1.surat_id='$surat_id' AND k1.kepada IS NULL");
|
||||
while($ra=pg_fetch_array($a)) {$awal=strtotime($ra[0]);}
|
||||
$data=pg_query("SELECT k.tgl_input,k.jam_input,
|
||||
(SELECT j.nama FROM jabatan_pegawai j WHERE j.id=k.kepada),
|
||||
(SELECT b.nama FROM satuan_kerja b WHERE b.id=k.satuan_kerja_tujuan),
|
||||
k.isi,k.dis_baca,k.id,k.satuan_kerja_penginput,
|
||||
k.proses_sekretariat,
|
||||
(SELECT MAX(id) FROM kirim WHERE surat_id='$surat_id' AND kepada IS NOT NULL),
|
||||
k.proses_tu,k.lama,ROW_NUMBER () OVER (ORDER BY k.id),s.id,k.satuan_kerja_tujuan,k.isi,s.tgl_diterima
|
||||
FROM kirim k INNER JOIN surat s ON (k.surat_id=s.id)
|
||||
WHERE k.surat_id='$surat_id'
|
||||
AND k.kepada IS NOT NULL AND LEFT(k.isi,1) NOT IN ('#')
|
||||
ORDER BY k.id ASC
|
||||
");
|
||||
while($r=pg_fetch_array($data)) {
|
||||
$isi='#'.$r['isi'];
|
||||
$proses_sekretariat=$r['proses_sekretariat'];
|
||||
$urut=$r[12];
|
||||
$patrap=$r['proses_sekretariat'];
|
||||
$m=explode("^", $patrap);
|
||||
$parap=$m[0];
|
||||
$dari=$m[1];
|
||||
if (isset($dari)) {
|
||||
$teko=pg_query("SELECT j.nama FROM jabatan_pegawai j WHERE j.id='$dari'");
|
||||
while($oket=pg_fetch_array($teko)) {$sopo=$oket[0];}
|
||||
}
|
||||
?>
|
||||
<tr
|
||||
<?php
|
||||
if ($r['proses_tu']=='K') {echo "style='color:red'";} else {}
|
||||
?>
|
||||
>
|
||||
<td class="kiri"><b><?php echo date('d-m-Y H:i',strtotime($r['tgl_input'])); ?></b></td>
|
||||
<td><b>
|
||||
<?php
|
||||
$g=2;
|
||||
$sub=pg_query("SELECT
|
||||
(SELECT j.nama FROM jabatan_pegawai j WHERE j.id=k.kepada)
|
||||
FROM kirim k INNER JOIN surat s ON (k.surat_id=s.id)
|
||||
WHERE k.surat_id='$surat_id'
|
||||
AND k.kepada IS NOT NULL AND LEFT(k.isi,1)='#' AND proses_sekretariat='$proses_sekretariat' AND isi='$isi'
|
||||
ORDER BY k.id ASC ");
|
||||
if(pg_num_rows($sub) > 0)
|
||||
{
|
||||
echo '1 - '.$r[2];
|
||||
while($h=pg_fetch_array($sub)) {
|
||||
echo '<br>'.$g.' - '.$h[0];
|
||||
$g++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $r[2];
|
||||
}
|
||||
?>
|
||||
</b></td>
|
||||
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;"><b><?php echo strtoupper(str_replace("#","",$r['isi'])); ?></b></td>
|
||||
<!--<td><b><?php echo $sopo; ?></b></td>-->
|
||||
|
||||
<td align="center" style="vertical-align: middle;">
|
||||
<?php
|
||||
if ((empty($parap)) || ($parap=="") || ($parap==null)) {
|
||||
} else {
|
||||
echo "
|
||||
<span><img id='blah' style='width:30px;height:30px;' src='app/master/pejabat/paraf/".$parap."' /></span>
|
||||
";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td align="center"><b><?php if($r['satuan_kerja_tujuan']==NULL) {echo "BELUM TERKIRIM";} else {echo "<i class='ion-checkmark-round'></i>";}?></b></td>
|
||||
<?php if ($jenis=='Admin') {?><td><b>
|
||||
<?php
|
||||
if ($r['lama']==null) {} else {
|
||||
/* $awal=strtotime($r['tgl_input']);
|
||||
$akhir=strtotime($r['lama']);
|
||||
$diff = $akhir - $awal;
|
||||
$jam = floor($diff / (60 * 60));
|
||||
$menit = $diff - $jam * (60 * 60);
|
||||
if (sprintf("%2d", $jam)=='0') {
|
||||
echo sprintf("%2d",floor($menit/60)).' Menit';
|
||||
} else {
|
||||
echo sprintf("%2d", $jam).' Jam : '.sprintf("%2d",floor($menit/60)).' Menit';
|
||||
} */
|
||||
$start = strtotime($r['tgl_input']);
|
||||
$end = strtotime($r['lama']);
|
||||
$totaltime = ($end - $start) ;
|
||||
$hours = intval($totaltime / 3600);
|
||||
$seconds_remain = ($totaltime - ($hours * 3600));
|
||||
$minutes = intval($seconds_remain / 60);
|
||||
$seconds = ($seconds_remain - ($minutes * 60));
|
||||
if ($minutes==0) {
|
||||
echo $seconds.' Detik';
|
||||
} else
|
||||
if ($hours==0) {
|
||||
echo $minutes.' Menit : '.$seconds.' Detik';
|
||||
} else {
|
||||
echo $hours.' Jam : '.$minutes.' Menit : '.$seconds.' Detik';
|
||||
}
|
||||
}
|
||||
?></b></td><?php } else {} ?>
|
||||
<td align="center" class="kanan">
|
||||
<?php
|
||||
if ($r['satuan_kerja_tujuan']==$r['satuan_kerja_penginput']) {} else {
|
||||
if (($r['satuan_kerja_penginput']==$satker) && ($r[6]==$maxid)) {
|
||||
//if (($urut==1) && ($jenis!='Admin')) {} else {
|
||||
?>
|
||||
<button type="button" name="edit_arahan" style="height:22px;" class="btn btn-teal btn-xs edit_arahan" id="<?php echo $r[6];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa fa-pencil"></i>
|
||||
</button>
|
||||
<?php if ($jenis=='Admin') {} else {?>
|
||||
<button type="button" name="kirim_arah" style="height:22px;" class="btn btn-brown btn-xs kirim_arah" id="<?php echo $r[6];?>" data-content="KIRIM" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-arrow-right"></i>
|
||||
</button>
|
||||
<?php } ?>
|
||||
<!--<button type="button" name="delete_arahan" style="height:22px;"class="btn btn-danger btn-xs delete_arahan" id="<?php echo $r[6];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>-->
|
||||
<?php // }
|
||||
} else {}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ($r['satuan_kerja_penginput']==$satker) {} else {
|
||||
if ($r[6]==$r[9]) {
|
||||
if ($r['proses_tu']==null) {
|
||||
//if (($cek_jabatan=='Ka.Sub Bag.Tata Usaha') || ($jenis=='Arsiparis')) {
|
||||
if (($r[2]=='Ka.Sub Bag.Tata Usaha') || ($jenis=='Arsiparis')) {
|
||||
//if ($cek_jabatan=='Ka.Sub Bag.Tata Usaha') {
|
||||
?>
|
||||
|
||||
<button type="button" name="arsipkan" style="height:22px;"class="btn btn-primary btn-xs arsipkan" id="<?php echo $r[13];?>" data-content="Arsipkan" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<button type="button" name="koreksi_arahan" style="height:22px;"class="btn btn-inverse btn-xs koreksi_arahan" id="<?php echo $r[6];?>" data-content="Koreksi" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
|
||||
<?php } else { ?>
|
||||
<button type="button" name="koreksi_batal" style="height:22px;"class="btn btn-default btn-xs koreksi_batal" id="<?php echo $r[6];?>" data-content="Batal koreksi" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
<?php } } } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var surat_id=$('#surat_id').val();
|
||||
$('button[name="edit_arahan"]').popover();
|
||||
$('button[name="delete_arahan"]').popover();
|
||||
$('button[name="koreksi_arahan"]').popover();
|
||||
$('button[name="koreksi_batal"]').popover();
|
||||
$('button[name="arsipkan"]').popover();
|
||||
$('button[name="kirim_arah"]').popover();
|
||||
|
||||
$("#tabel_data_arahan").on('click','.arsipkan',function(){
|
||||
var id = $(this).attr('id');
|
||||
var key = "arsipkan";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/disposisi/arahan/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
alert('data terarsip..');
|
||||
$('#tabel_arahan').load("app/disposisi/arahan/tabel.php",{satker:sess_satker,jenis:sess_jenis,surat_id:surat_id});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url:'app/notif/disposisi_notif.php',
|
||||
data: 'satker='+sess_satker,
|
||||
success: function(data){
|
||||
if (data==0) {$('#not_disposisi').hide();} else {
|
||||
$('#not_disposisi').show();
|
||||
$('#not_disposisi').html(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#tabel_data_arahan").on('click','.koreksi_arahan',function(){
|
||||
var id = $(this).attr('id');
|
||||
var key = "koreksi_arahan";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/disposisi/arahan/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#tabel_arahan').load("app/disposisi/arahan/tabel.php",{satker:sess_satker,jenis:sess_jenis,surat_id:surat_id});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#tabel_data_arahan").on('click','.koreksi_batal',function(){
|
||||
var id = $(this).attr('id');
|
||||
var key = "koreksi_batal";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/disposisi/arahan/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#tabel_arahan').load("app/disposisi/arahan/tabel.php",{satker:sess_satker,jenis:sess_jenis,surat_id:surat_id});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#tabel_data_arahan").on('click','.edit_arahan',function(){
|
||||
var id = $(this).attr('id');
|
||||
var jenis = $('#jenis').val();
|
||||
var satker = $('#satker').val();
|
||||
$('#modal_arahan').modal('show');
|
||||
$('#modal_body_arahan').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/disposisi/arahan/modal.php",
|
||||
data: 'id='+id
|
||||
+'&surat_id='+surat_id
|
||||
+'&cek_satker='+satker
|
||||
+'&jenis='+jenis,
|
||||
success: function(data){
|
||||
$('#modal_body_arahan').html(data);
|
||||
$('#kepada').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
/*
|
||||
$("#tabel_data_arahan").on('click','.delete_arahan',function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_arahan";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/disposisi/arahan/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
rowElement.fadeOut(500).remove();
|
||||
$('#tabel_arahan').load("app/disposisi/arahan/tabel.php",{satker:sess_satker,jenis:sess_jenis,surat_id:surat_id});
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
*/
|
||||
$("#tabel_data_arahan").on("contextmenu", "img", function(e) {
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#tabel_data_arahan").on('click','.kirim_arah',function(){
|
||||
$('#kirim_arahan').trigger('click');
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user