81 lines
4.0 KiB
PHP
81 lines
4.0 KiB
PHP
<?php
|
|
include('../../koneksi.php');
|
|
?>
|
|
|
|
<script type="text/javascript">$("#tabel_data_jarsip").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});</script>
|
|
<table id="tabel_data_jarsip" class="table table-striped table-condensed" cellpadding="1" >
|
|
<thead>
|
|
<tr>
|
|
<td><b>Jenis Arsip</b></td>
|
|
<td width="80px"><b>Aktif</b></td>
|
|
<td width="80px"><b>Inaktif</b></td>
|
|
<td width="200px"><b>Keterangan</b></td>
|
|
<td align="center" width="80px;"><b>Tools</b></td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$data = pg_query("SELECT * FROM jenis_arsip ORDER BY id DESC");
|
|
while($row=pg_fetch_array($data)) {
|
|
?>
|
|
<tr>
|
|
<td class="kiri"><b><?php echo $row['jenis']; ?></b></td>
|
|
<td><b><?php if ($row['aktif']==null) {} else {echo $row['aktif'].' Tahun';} ?></b></td>
|
|
<td><b><?php if ($row['inaktif']==null) {} else {echo $row['inaktif'].' Tahun';} ?></b></td>
|
|
<td><b><?php echo $row['keterangan']; ?></b></td>
|
|
<td class="kanan" align="center">
|
|
<button type="button" name="edit_jarsip" style="height:22px;" class="btn btn-teal btn-xs edit_jarsip" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover">
|
|
<i class="fa fa fa-pencil"></i>
|
|
</button>
|
|
<!-- <button type="button" name="delete_jarsip" style="height:22px;"class="btn btn-danger btn-xs delete_jarsip" id="<?php echo $row['id'];?>" data-content="Hapus" rel="popover" data-placement="bottom" data-trigger="hover">
|
|
<i class="fa fa-remove"></i>
|
|
</button> -->
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
$('button[name="edit_jarsip"]').popover();
|
|
|
|
$("#tabel_data_jarsip").on('click','.edit_jarsip',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_jarsip').modal('show');
|
|
$('#modal_body_jarsip').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/master/jarsip/modal.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_jarsip').html(data);
|
|
$('#nama').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$("#tabel_data_jarsip").on('click','.delete_jarsip',function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "delete_jarsip";
|
|
var id = $(this).attr('id');
|
|
var rowElement = $(this).parent().parent();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/master/jarsip/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
rowElement.fadeOut(500).remove();
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
</script>
|
|
|