122 lines
5.1 KiB
PHP
122 lines
5.1 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$no_agenda=$_POST['no_agenda'];
|
|
$thn=$_POST['thn'];
|
|
?>
|
|
<script type="text/javascript">
|
|
$("#tabel_surat_tools").DataTable({"stateSave": true,"paging": false,"lengthChange": false,
|
|
"searching": false,"ordering": false,"info": false,"autoWidth": false});
|
|
</script>
|
|
|
|
<table id="tabel_surat_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" width="140">NO SURAT</td>
|
|
<td align="center" width="100">TGL SURAT</td>
|
|
<td align="center" width="100">TGL DITERIMA</td>
|
|
<td align="center" width="100">NO AGENDA</td>
|
|
<td align="center" width="300">PERIHAL</td>
|
|
<td align="center" width="190">SURAT DARI</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];
|
|
?>
|
|
<tr>
|
|
<td style="display:none"><?php echo $r[0]; ?></td>
|
|
<td align="center"><?php echo $r[1]; ?></td>
|
|
<td align="center"><?php echo $r[2]; ?></td>
|
|
<td align="center"><?php echo $r[3]; ?></td>
|
|
<td align="center"><?php echo $r[4]; ?></td>
|
|
<td><?php echo $r[5]; ?></td>
|
|
<td><?php echo $r[6]; ?></td>
|
|
<td align="center">
|
|
<!--
|
|
<button type="button" name="edit_surat_tools" style="height:22px;"class="btn btn-success btn-xs edit_surat_tools" id="<?php echo $r['id'];?>" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>
|
|
-->
|
|
<button type="button" name="edit_s" style="height:22px;"class="btn btn-success btn-xs edit_s" id="<?php echo $r['id'];?>" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>
|
|
<button type="button" name="hapus_surat_tools" style="height:22px;"class="btn btn-danger btn-xs hapus_surat_tools" id="<?php echo $r['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_surat_tools").on('click','.edit_surat_tools',function(){
|
|
var currentRow=$(this).closest("tr");
|
|
var no_surat = currentRow.find("td:eq(1)").text();
|
|
var edit1 = window.prompt("Edit Nomor Surat",no_surat);
|
|
if(!edit1) {} else {
|
|
var id = $(this).attr('id');
|
|
var key = 'edit_no_surat';
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/disposisi/crud.php",
|
|
data: 'id='+id
|
|
+'&edit1='+edit1
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#tabel_s').load('app/disposisi/tabel_s.php',{no_agenda:no_agenda, thn:thn});
|
|
$('#tabel_disposisi').load("app/disposisi/tabel.php",{satker:sess_satker,jenis:sess_jenis,disp_pros:disp_pros});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
$("#tabel_surat_tools").on('click','.edit_s',function(){
|
|
var currentRow=$(this).closest("tr");
|
|
var no_surat = currentRow.find("td:eq(1)").text();
|
|
var tgl_diterima = currentRow.find("td:eq(3)").text();
|
|
var id = $(this).attr('id');
|
|
$('#modal_s').modal('show');
|
|
$('#modal_body_s').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/disposisi/modal_s.php",
|
|
data: 'id='+id
|
|
+'&no_surat='+no_surat
|
|
+'&tgl_diterima='+tgl_diterima,
|
|
success: function(data){
|
|
$('#modal_body_s').html(data);
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_surat_tools").on('click','.hapus_surat_tools',function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "hapus_surat_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_s').load('app/disposisi/tabel_s.php',{no_agenda:no_agenda, thn:thn});
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
</script>
|