first commit
This commit is contained in:
105
dev/app/skeluar/tabel_s.php
Normal file
105
dev/app/skeluar/tabel_s.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
include("../koneksi.php");
|
||||
$no_urut=$_POST['no_urut'];
|
||||
?>
|
||||
<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">ID</td>
|
||||
<td align="center">NO URUT</td>
|
||||
<td align="center">NO KODE</td>
|
||||
<td align="center">PERIHAL</td>
|
||||
<td align="center">PENGOLAH</td>
|
||||
<td align="center">TGL SURAT</td>
|
||||
<td align="center">TUJUAN</td>
|
||||
<td align="center">BALASAN</td>
|
||||
<td align="center">TOOLS</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="color:black">
|
||||
<?php
|
||||
$d=pg_query("SELECT s.no_urut,
|
||||
k.kode,
|
||||
k.keterangan,
|
||||
s.kepada,
|
||||
CASE WHEN s.satuan_kerja_dari IS NULL THEN t.nama
|
||||
ELSE
|
||||
(SELECT t2.nama FROM satuan_kerja t2 WHERE t2.id=s.satuan_kerja_dari)
|
||||
END,
|
||||
CASE WHEN s.satuan_kerja_dari IS NULL THEN t.kode_satker
|
||||
ELSE
|
||||
(SELECT k2.kode_satker FROM satuan_kerja k2 WHERE k2.id=s.satuan_kerja_dari)
|
||||
END,
|
||||
s.id,
|
||||
s.perihal,
|
||||
s.id,s.balasan,s.jam_kirim,s.tgl_kirim,
|
||||
s.tgl_surat_keluar,
|
||||
n.tujuan,s.konten,p.kepada
|
||||
FROM surat s
|
||||
INNER JOIN kode k ON (k.id=s.kode_id)
|
||||
INNER JOIN satuan_kerja t ON (t.id=s.satuan_kerja_id)
|
||||
INNER JOIN tujuan n ON (n.id=s.tujuan_id)
|
||||
LEFT OUTER JOIN kepada p ON (s.id=p.surat_id)
|
||||
WHERE no_urut='$no_urut' AND no_kendali IS NULL");
|
||||
while($r=pg_fetch_array($d)) {$surat_id=$r[0];
|
||||
?>
|
||||
<tr>
|
||||
<td class="kiri"><?php echo $surat_id; ?></td>
|
||||
<td><?php
|
||||
if (($r['no_urut']=='') || ($r['no_urut']==NULL)) {} else {
|
||||
$no_pinjam=(int) substr($r['no_urut'],0,5);
|
||||
$no_kendali=sprintf("%05s",$no_pinjam);
|
||||
echo $no_kendali;
|
||||
}
|
||||
?></td>
|
||||
<td><?php echo $r['kode']; ?></td>
|
||||
<!--<td><?php echo $r['kepada']; ?></td>-->
|
||||
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;"><?php echo $r[7]; ?></td>
|
||||
<!--<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;"><?php echo $r['konten']; ?></td>-->
|
||||
<td><?php echo $r[4].' - '.$r[5]; ?></td>
|
||||
<!--<td><?php echo date('d-m-Y',strtotime($r['tgl_surat_keluar'])); ?></td>-->
|
||||
<td><?php echo date('d-m-Y',strtotime($r['tgl_surat_keluar'])).' '.date('H:i',strtotime($r['jam_kirim'])); ?></td>
|
||||
<td><?php echo $r['tujuan']; ?></td>
|
||||
<td><?php if ($r['balasan']=='f') {echo "TIDAK";} else {echo "YA";} ?></td>
|
||||
<td align="center">
|
||||
<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_urut = $('#nourut').val();
|
||||
|
||||
|
||||
|
||||
$("#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/skeluar/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
rowElement.fadeOut(500).remove();
|
||||
$('#tabel_skeluar').load("app/skeluar/tabel.php",{satker:sess_satker,jenis:sess_jenis,sess_nama:sess_nama,thn:thn,bln:bln});
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user