135 lines
5.7 KiB
PHP
135 lines
5.7 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$no_agenda=$_POST['no_agenda'];
|
|
$thn=$_POST['thn'];
|
|
?>
|
|
<script type="text/javascript">
|
|
$("#tabel_kirim_tools").DataTable({"stateSave": true,"paging": false,"lengthChange": false,
|
|
"searching": false,"ordering": false,"info": false,"autoWidth": false});
|
|
</script>
|
|
<table id="tabel_kirim_tools" class="table table-bordered table-striped table-condensed tabel_tools" cellpadding="1" style="font-family:Arial">
|
|
<thead>
|
|
<tr style="font-weight:bold">
|
|
<td align="center" style="display:none">ID</td>
|
|
<td align="center" style="display:none">SURAT ID</td>
|
|
<td align="center" width="180">TGL KIRIM</td>
|
|
<td align="center">KEPADA</td>
|
|
<td align="center" style="display:none">SATKER TUJUAN</td>
|
|
<td align="center" style="display:none">PROSES SEKRETARIAT</td>
|
|
<td align="center">ISI</td>
|
|
<td align="center" width="30">B</td>
|
|
<td align="center" width="180">TGL BACA</td>
|
|
|
|
<td align="center" style="display:none">SATUAN KERJA PENGINPUT</td>
|
|
<td align="center" width="80">TOOLS</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black">
|
|
<?php
|
|
$d=pg_query("SELECT id,no_surat,tgl_surat_masuk,tgl_diterima,no_agenda,perihal,surat_dari FROM surat WHERE no_agenda='$no_agenda' AND EXTRACT('YEAR' FROM tgl_diterima)='$thn'");
|
|
while($r=pg_fetch_array($d)) {$surat_id=$r[0];}
|
|
$k=pg_query("SELECT k.id,k.surat_id,k.tgl_input,k.satuan_kerja_tujuan,k.proses_sekretariat,k.isi,k.dis_baca,k.kepada,k.satuan_kerja_penginput,k.lama,j.nama
|
|
FROM kirim k
|
|
LEFT OUTER JOIN jabatan_pegawai j ON (j.id=k.kepada)
|
|
WHERE k.surat_id='$surat_id' ORDER BY k.id ASC");
|
|
while($s=pg_fetch_array($k)) {
|
|
?>
|
|
<tr>
|
|
<td style="display:none"><?php echo $s[0]; ?></td>
|
|
<td style="display:none"><?php echo $s[1]; ?></td>
|
|
<td align="center"><?php echo $s[2]; ?></td>
|
|
<td><?php echo $s[10]; ?></td>
|
|
<td style="display:none"><?php echo $s[3]; ?></td>
|
|
<td style="display:none"><?php echo $s[4]; ?></td>
|
|
<td><?php echo $s[5]; ?></td>
|
|
<td align="center"><?php echo $s[6]; ?></td>
|
|
<td align="center"><?php echo $s[9]; ?></td>
|
|
|
|
<td style="display:none"><?php echo $s[8]; ?></td>
|
|
<td align="center">
|
|
<!--<button type="button" name="edit_kirim_tools" style="height:22px;"class="btn btn-success btn-xs edit_kirim_tools" id="<?php echo $s['id'];?>" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>-->
|
|
<button type="button" name="edit_k" style="height:22px;"class="btn btn-primary btn-xs edit_k" id="<?php echo $s['id'];?>" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>
|
|
<button type="button" name="hapus_kirim_tools" style="height:22px;"class="btn btn-danger btn-xs hapus_kirim_tools" id="<?php echo $s['id'];?>" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
<table>
|
|
|
|
|
|
<script>
|
|
var no_agenda = $('#noag').val();
|
|
var thn = $('#thnag').val();
|
|
|
|
$("#tabel_kirim_tools").on('click','.edit_kirim_tools',function(){
|
|
var currentRow=$(this).closest("tr");
|
|
var dis_baca = currentRow.find("td:eq(6)").text();
|
|
var edit = window.prompt("Edit Status Baca",dis_baca);
|
|
if (!edit) {} else {
|
|
var id = $(this).attr('id');
|
|
var key = 'edit_baca';
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/disposisi/crud.php",
|
|
data: 'id='+id
|
|
+'&edit='+edit
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#tabel_k').load('app/disposisi/tabel_k.php',{no_agenda:no_agenda, thn:thn});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
$("#tabel_kirim_tools").on('click','.edit_k',function(){
|
|
var currentRow=$(this).closest("tr");
|
|
var tgl_input = currentRow.find("td:eq(2)").text();
|
|
var dis_baca = currentRow.find("td:eq(7)").text();
|
|
var lama = currentRow.find("td:eq(8)").text();
|
|
var isi_disposisi = currentRow.find("td:eq(6)").text();
|
|
var id = $(this).attr('id');
|
|
$('#modal_k').modal('show');
|
|
$('#modal_body_k').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/disposisi/modal_k.php",
|
|
data: 'id='+id
|
|
+'&tgl_input='+tgl_input
|
|
+'&dis_baca='+dis_baca
|
|
+'&lama='+lama
|
|
+'&isi_disposisi='+isi_disposisi,
|
|
success: function(data){
|
|
$('#modal_body_k').html(data);
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_kirim_tools").on('click','.hapus_kirim_tools',function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "delete_kirim_tools";
|
|
var id = $(this).attr('id');
|
|
var rowElement = $(this).parent().parent();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/disposisi/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#tabel_k').load('app/disposisi/tabel_k.php',{no_agenda:no_agenda, thn:thn});
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
</script>
|