121 lines
6.2 KiB
PHP
121 lines
6.2 KiB
PHP
<?php
|
|
include('../koneksi.php');
|
|
$satker=$_POST['satker'];
|
|
?>
|
|
<script>var sess_satker = $('#cek_satker').val();</script>
|
|
|
|
<script type="text/javascript">$("#tabel_data_torsatker").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});</script>
|
|
<table id="tabel_data_torsatker" class="table table-striped table-condensed table-bordered" cellpadding="1">
|
|
<thead>
|
|
<tr style="text-align:center">
|
|
<td width="80px;">Tgl Pesan</td>
|
|
<!--<td align="center" width="90px;">Satker</td>-->
|
|
<td width="110px;">Tempat</td>
|
|
<td width="80px;">Tgl Acara</td>
|
|
<td width="90px;">Waktu</td>
|
|
<td>Acara</td>
|
|
<td width="90px;">Status TOR</td>
|
|
<td width="50px;">Tools</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$data = pg_query("SELECT tanggal_pesan,(SELECT nama FROM data_ruangan WHERE id=tempat),
|
|
tgl_acara,waktu_mulai,waktu_selesai,tujuan,st_pesan,id,st_batal
|
|
FROM riwayat_kegiatan
|
|
WHERE perencana_rapat='$satker' AND st_pesan='Pending' ORDER BY tanggal_pesan DESC");
|
|
while($row=pg_fetch_array($data)) {
|
|
?>
|
|
<tr
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "style='color:#dddddd'";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<td class="kiri"><?php echo date('d-m-Y',strtotime($row['tanggal_pesan'])); ?></td>
|
|
<!--<td><?php echo $row['satker']; ?></td>-->
|
|
<td><?php echo $row[1]; ?></td>
|
|
<td><?php echo date('d-m-Y',strtotime($row['tgl_acara'])); ?></td>
|
|
<td><?php echo date('H:i',strtotime($row['waktu_mulai'])).' - '.date('H:i',strtotime($row['waktu_selesai'])); ?></td>
|
|
<td><?php echo $row['tujuan']; ?></td>
|
|
<td><?php echo $row['st_pesan']; ?></td>
|
|
<td align="center" class="kanan">
|
|
<button type="button" name="edit_torsatker" style="height:22px;" class="btn btn-teal btn-xs edit_torsatker" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa fa-pencil"></i>
|
|
</button>
|
|
<button type="button" name="delete_torsatker" style="height:22px;"class="btn btn-danger btn-xs delete_torsatker" id="<?php echo $row['id'];?>" data-content="Batal" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
$('button[name="edit_torsatker"]').popover();
|
|
$('button[name="delete_torsatker"]').popover();
|
|
|
|
|
|
$("#tabel_data_torsatker").on('click','.edit_torsatker',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_torsatker').modal('show');
|
|
$('#modal_body_torsatker').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/torsatker/modal.php",
|
|
data: 'id='+id
|
|
+'&satker='+sess_satker,
|
|
success: function(data){
|
|
$('#modal_body_torsatker').html(data);
|
|
$('#nama').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_torsatker").on('click','.delete_torsatker',function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "delete_torsatker";
|
|
var id = $(this).attr('id');
|
|
var rowElement = $(this).parent().parent();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/torsatker/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
rowElement.fadeOut(500).remove();
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
</script>
|
|
|