Assalamualaikum Warahmatullahi Wabarakatuh...
Mastah2 sekalian mohon koreksinya dong, perintah crud sy kok gk jalan ya...data ditampilan gk kehapus...mohon pencerahannya...
1. php detail tampilan sbb :
<?php
include("sess_check.php");
// deskripsi halaman
$pagedesc = "Menunggu Approval";
include("layout_top.php");
include("dist/function/format_tanggal.php");
include("dist/function/format_rupiah.php");
$id = $sess_pegawaiid;
?>
<!-- top of file -->
<!-- Page Content -->
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Data Cuti Menunggu Approval</h1>
</div><!-- /.col-lg-12 -->
</div><!-- /.row -->
<div class="row">
<div class="col-lg-12"><?php include("layout_alert.php"); ?></div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-body">
<?php
$Sql = "SELECT cuti.*, employee.* FROM cuti, employee WHERE cuti.npp=employee.npp AND cuti.stt_cuti !='Rejected'
AND cuti.npp='$id' ORDER BY cuti.tgl_pengajuan DESC";
?>
<table class="table table-striped table-bordered table-hover" id="tabel-data">
<thead>
<tr>
<th width="1%">No</th>
<th width="10%">No Cuti</th>
<th width="5%">Tgl Pengajuan</th>
<th width="5%">Tgl Awal</th>
<th width="5%">Tgl Akhir</th>
<th width="5%">Status</th>
<th width="5%">Opsi</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
echo '<tr>';
echo '<td class="text-center">'. $i .'</td>';
echo '<td class="text-center">'. $data['no_cuti'] .'</td>';
echo '<td class="text-center">'. IndonesiaTgl($data['tgl_pengajuan']) .'</td>';
echo '<td class="text-center">'. IndonesiaTgl($data['tgl_awal']) .'</td>';
echo '<td class="text-center">'. IndonesiaTgl($data['tgl_akhir']) .'</td>';
echo '<td class="text-center">'. $data['stt_cuti'] .'</td>';
echo '<td class="text-center">
<a href="#myModal" data-toggle="modal" data-load-code="'.$data['no_cuti'].'" data-remote-target="#myModal .modal-body" class="btn btn-primary btn-xs">Detail</a>';?>
<a href="cuti_hapus.php?no=<?php echo $data['no_cuti'];?>" onclick="return confirm('Apakah anda yakin akan membatalkan pengajuan cuti No. <?php echo $data['no_cuti'];?>?');" class="btn btn-danger btn-xs">Hapus</a></td>
<?php
echo '</td>';
echo '</tr>';
$i++;
}
?>
</tbody>
</table>
</div>
<!-- Large modal -->
<div class="modal fade bs-example-modal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<p>Sedang memproses…</p>
</div>
</div>
</div>
</div>
</div><!-- /.panel -->
</div><!-- /.col-lg-12 -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div><!-- /#page-wrapper -->
<!-- bottom of file -->
<script type="text/javascript">
$(document).ready(function() {
$('#tabel-data').DataTable({
"responsive": true,
"processing": true,
"columnDefs": [
{ "orderable": false, "targets": [] }
]
});
$('#tabel-data').parent().addClass("table-responsive");
});
</script>
<script>
var app = {
code: '0'
};
$('[data-load-code]').on('click',function(e) {
e.preventDefault();
var $this = $(this);
var code = $this.data('load-code');
if(code) {
$($this.data('remote-target')).load('cuti_detail.php?code='+code);
app.code = code;
}
});
</script>
<?php
include("layout_bottom.php");
?>
2. CRUD aplikasinya
<?php
include("sess_check.php");
$id = $_GET['no_cuti'];
$sql = "DELETE FROM cuti, employee WHERE cuti.npp=employee.npp AND cuti.no_cuti='". $id ."'";
header("location: cuti_waitapp.php?act=delete&msg=success"); ?>
Mohon bantuan mastah2 sekalian ya? Terima kasih sebelumnya...
Wassalam...