first commit
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">$("#tabel_data_sifat").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});</script>
|
||||
<table id="tabel_data_sifat" class="table table-striped table-bordered" cellpadding="1" >
|
||||
<thead>
|
||||
<tr>
|
||||
<td align="center"><b>Sifat Undangan</b></td>
|
||||
<td align="center" width="80px;"><b>Tools</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$data = pg_query("SELECT * FROM sifat_undangan ORDER BY id DESC");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $row['status']; ?></td>
|
||||
<td align="center">
|
||||
<button type="button" name="edit_sifat" style="height:22px;" class="btn btn-teal btn-xs edit_sifat" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="bottom" data-trigger="hover">
|
||||
<i class="fa fa fa-pencil"></i>
|
||||
</button>
|
||||
<!-- <button type="button" name="delete_sifat" style="height:22px;"class="btn btn-danger btn-xs delete_sifat" 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">
|
||||
$("#tabel_data_sifat").on('click','.edit_sifat',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_sifat').modal('show');
|
||||
$('#modal_body_sifat').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/sifat/modal.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_sifat').html(data);
|
||||
$('#nama').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#tabel_data_sifat").on('click','.delete_sifat',function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_sifat";
|
||||
var id = $(this).attr('id');
|
||||
var rowElement = $(this).parent().parent();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/sifat/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
rowElement.fadeOut(500).remove();
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user