151 lines
7.6 KiB
PHP
151 lines
7.6 KiB
PHP
<?php
|
|
include('../koneksi.php');
|
|
?>
|
|
|
|
<script type="text/javascript">$("#tabel_data_tortu").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});</script>
|
|
<table id="tabel_data_tortu" class="table table-striped table-condensed table-bordered" cellpadding="1" style="font-family:Arial;font-size:12px">
|
|
<thead>
|
|
<tr style="text-align:center">
|
|
<td width="80px;">Tgl Pesan</td>
|
|
<td>Satker Pemesan</td>
|
|
<td width="110px;">Ruangan</td>
|
|
<td width="100px;">Tgl Acara</td>
|
|
<!--<td width="90px;">Jam</td>-->
|
|
<td>Acara</td>
|
|
<td width="100px;">Status TOR</td>
|
|
<td width="90px;">Tools</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black">
|
|
<?php
|
|
$data = pg_query("SELECT tanggal_pesan,
|
|
(SELECT nama FROM satuan_kerja WHERE id=perencana_rapat),
|
|
(SELECT nama FROM data_ruangan WHERE id=tempat),
|
|
tgl_acara,waktu_mulai,waktu_selesai,tujuan,st_pesan,id,st_batal
|
|
FROM riwayat_kegiatan
|
|
WHERE st_persiapan IS NULL 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
|
|
if (($row['tanggal_pesan']==NULL) || ($row['tanggal_pesan']=='')) {} else {
|
|
echo date('d-m-Y',strtotime($row['tanggal_pesan']));
|
|
}
|
|
?></td>
|
|
<td><?php echo $row[1]; ?></td>
|
|
<td><?php echo $row[2]; ?></td>
|
|
<td><?php echo date('d-m-Y',strtotime($row['tgl_acara'])).'<br>'.
|
|
'<span style="color:red">'.date('H:i',strtotime($row['waktu_mulai'])).' - '.date('H:i',strtotime($row['waktu_selesai'])).'</span>'
|
|
; ?></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 align="center"><?php echo $row['st_pesan']; ?></td>
|
|
<td align="center" class="kanan">
|
|
<button type="button" name="edit_tortu" style="height:22px;" class="btn btn-teal btn-xs edit_tortu" id="<?php echo $row['id'];?>" data-content="Verifikasi" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa fa-check"></i>
|
|
</button>
|
|
<button type="button" name="batal_tortu" style="height:22px;"class="btn btn-danger btn-xs batal_tortu" 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>
|
|
|
|
<button type="button" name="aktif_tortu" style="height:22px;"class="btn btn-inverse btn-xs aktif_tortu" id="<?php echo $row['id'];?>" data-content="Aktif" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-check"></i>
|
|
</button>
|
|
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$('button[name="edit_tortu"]').popover();
|
|
$('button[name="batal_tortu"]').popover();
|
|
$('button[name="aktif_tortu"]').popover();
|
|
|
|
|
|
|
|
$("#tabel_data_tortu").on('click','.edit_tortu',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_tortu').modal('show');
|
|
$('#modal_body_tortu').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/tortu/modal.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_tortu').html(data);
|
|
$('#nama').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_tortu").on('click','.batal_tortu',function(){
|
|
var x = confirm("Anda yakin ingin membatalkan ?");
|
|
if (x) {
|
|
var key = "batal_tortu";
|
|
var id = $(this).attr('id');
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/tortu/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#tabel_tortu').load("app/tortu/tabel.php");
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
$("#tabel_data_tortu").on('click','.aktif_tortu',function(){
|
|
var x = confirm("Anda yakin ingin mengaktifkan ?");
|
|
if (x) {
|
|
var key = "aktif_tortu";
|
|
var id = $(this).attr('id');
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/tortu/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#tabel_tortu').load("app/tortu/tabel.php");
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
</script>
|
|
|