367 lines
20 KiB
PHP
367 lines
20 KiB
PHP
<?php
|
|
include('../koneksi.php');
|
|
$thn_skrg=date('Y');
|
|
$bln2=$_POST['bln2'];
|
|
$thn2=$_POST['thn2'];
|
|
$r1=strtolower($_POST['r1']);
|
|
$p1=strtolower($_POST['p1']);
|
|
$s1=strtolower($_POST['s1']);
|
|
$t1=strtolower($_POST['t1']);
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
$('button[name="edit_undtu"]').popover();
|
|
$('button[name="pr_und"]').popover();
|
|
$('button[name="info_peserta"]').popover();
|
|
$('button[name="tambah_peserta"]').popover();
|
|
$('button[name="tambah_peserta_luar"]').popover();
|
|
$('button[name="batal_undtu"]').popover();
|
|
$('button[name="aktif_undtu"]').popover();
|
|
$('button[name="lampiran_undtu"]').popover();
|
|
|
|
$("#tabel_data_undtu").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": false,"ordering": false,"info": true,"autoWidth": false});</script>
|
|
<table id="tabel_data_undtu" 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="120px;" style="display:none">Ruangan</td>
|
|
<td width="100px;">Tgl Acara</td>
|
|
<td>Acara</td>
|
|
<td width="140px;">Penanggungjawab</td>
|
|
<td width="70px;">Status</td>
|
|
<td width="150px;" style="display:none">No Undangan</td>
|
|
<td width="210px;">Tools</td>
|
|
<td width="80px;">Kirim<i class="mdi mdi-account-multiple m-l-5"></i></td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black">
|
|
<?php
|
|
$data = pg_query("SELECT (SELECT r.nama FROM data_ruangan r WHERE r.id=k.tempat),
|
|
k.tgl_acara,k.waktu_mulai,k.waktu_selesai,k.tujuan,k.st_persiapan,
|
|
k.no_undangan,k.id,
|
|
(SELECT s.nama FROM satuan_kerja s WHERE s.id=k.penanggungjawab),
|
|
k.st_batal,p.tanggal_kirim,COUNT(l.file)
|
|
FROM riwayat_kegiatan k
|
|
LEFT OUTER JOIN kirim_permintaan p ON (k.id=p.riwayat_kegiatan_id)
|
|
LEFT OUTER JOIN lampiran l ON (k.id=l.riwayat_kegiatan_id)
|
|
WHERE
|
|
k.st_persiapan IN ('Pending','Ready')
|
|
".($thn2 == '' ? "" : "AND EXTRACT(YEAR FROM DATE(k.tgl_acara))='$thn2'")."
|
|
".($bln2 == '' ? "" : "AND EXTRACT(MONTH FROM DATE(k.tgl_acara))='$bln2'")."
|
|
".($r1 == null ? "" : "AND lower(k.tujuan) LIKE '%$r1%'")."
|
|
".($p1 == null ? "" : "AND lower((SELECT s.nama FROM satuan_kerja s WHERE s.id=k.penanggungjawab)) LIKE '%$p1%'")."
|
|
".($s1 == null ? "" : "AND lower(k.no_undangan) LIKE '%$s1%'")."
|
|
".($t1 == null ? "" : "AND lower(k.st_persiapan)='$t1' AND k.st_batal IS NULL")."
|
|
GROUP BY
|
|
(SELECT r.nama FROM data_ruangan r WHERE r.id=k.tempat),
|
|
k.tgl_acara,k.waktu_mulai,k.waktu_selesai,k.tujuan,k.st_persiapan,
|
|
k.no_undangan,k.id,
|
|
(SELECT s.nama FROM satuan_kerja s WHERE s.id=k.penanggungjawab),
|
|
k.st_batal,p.tanggal_kirim
|
|
ORDER BY k.tgl_acara DESC
|
|
|
|
");
|
|
while($row=pg_fetch_array($data)) {
|
|
/*
|
|
$riwayat_kegiatan_id=$row['id'];
|
|
$lm=pg_query("SELECT COUNT(*) FROM lampiran WHERE riwayat_kegiatan_id='$riwayat_kegiatan_id'");
|
|
while($rlm=pg_fetch_array($lm)) {$jlam=$rlm[0];}*/
|
|
//$jlam=0;
|
|
|
|
?>
|
|
<tr
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "style='color:#dddddd'";
|
|
} else {
|
|
if (($row['no_undangan']!=null) && ($row['st_persiapan']=='Pending')) {
|
|
echo "style='color:#CF0A0A'";
|
|
} else
|
|
if ($row['st_persiapan']=='Pending') {
|
|
echo "style='color:#4B56D2'";
|
|
} else {
|
|
echo "";
|
|
}
|
|
}
|
|
?>
|
|
>
|
|
<td class="kiri" style="display:none"><?php echo $row[0]; ?></td>
|
|
<td class="kiri"><?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>
|
|
<span style="font-family:InterSB"><?php echo $row[0]; ?></span><br>
|
|
<span><?php echo $row['tujuan']; ?></span><br>
|
|
<span style="font-family:InterSB;color:green"><i class="fa fa-envelope m-r-5"></i>
|
|
<?php
|
|
if ($row['no_undangan']==NULL) {
|
|
echo '';
|
|
} else {
|
|
echo '000.1 / '.$row['no_undangan'].' / 102.7 / '.date('Y',strtotime($row['tgl_acara']));
|
|
}
|
|
?>
|
|
</span>
|
|
</td>
|
|
<td><?php echo $row[8]; ?></td>
|
|
<td align="center"><?php if (($row['no_undangan']!=null) && ($row['st_persiapan']=='Pending')) {echo 'Siap kirim';} else {echo $row['st_persiapan'];} ?></td>
|
|
<td align="center" style="display:none">
|
|
<?php
|
|
if ($row['no_undangan']==NULL) {
|
|
echo '';
|
|
} else {
|
|
echo '005 / '.$row['no_undangan'].' / 102.7 / '.date('Y',strtotime($row['tgl_acara']));
|
|
}
|
|
?>
|
|
</td>
|
|
<td align="center">
|
|
<span>
|
|
<button type="button" name="edit_undtu" style="height:22px;" class="btn btn-teal btn-xs edit_undtu" id="<?php echo $row['id'];?>" data-content="Pembuatan dan Pengiriman Undangan" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>
|
|
<button type="button" name="info_peserta" style="height:22px;"
|
|
class="btn btn-inverse btn-xs info_peserta"
|
|
id="<?php echo $row['id'];?>" data-content="List Peserta" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-user"></i>
|
|
</button>
|
|
<button type="button" name="tambah_peserta" style="height:22px;"
|
|
class="btn btn-primary btn-xs tambah_peserta"
|
|
id="<?php echo $row['id'];?>" data-content="Peserta Dalam" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-plus"></i>
|
|
</button>
|
|
<button type="button" name="tambah_peserta_luar" style="height:22px;"
|
|
class="btn btn-default btn-xs tambah_peserta_luar"
|
|
id="<?php echo $row['id'];?>" data-content="Peserta Luar" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-plus"></i>
|
|
</button>
|
|
<button type="button" name="pr_und" style="height:22px;" class="btn btn-purple btn-xs pr_und" id="<?php echo $row['id'];?>" data-content="Print Undangan Peserta Luar" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($row['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-envelope"></i>
|
|
</button>
|
|
<button type="button" name="batal_undtu" style="height:22px;" class="btn btn-danger btn-xs batal_undtu" 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_undtu" style="height:22px;"class="btn btn-inverse btn-xs aktif_undtu" id="<?php echo $row['id'];?>" data-content="Aktif" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-check"></i>
|
|
</button>
|
|
</span>
|
|
<?php if ($row[11]==0) {} else { ?>
|
|
<br><br><span><button type="button" name="lampiran_undtu" style="height:22px;font-family:InterSB;color:red"class="btn btn-default btn-xs lampiran_undtu" id="<?php echo $row['id'];?>" >Dokumen Lampiran Undangan
|
|
</button></span>
|
|
<?php } ?>
|
|
</td>
|
|
|
|
<td class="kanan">
|
|
<?php if ($row['tanggal_kirim']) {echo date('d-m-Y H:i',strtotime($row['tanggal_kirim']));} ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
var cek_jenis = $('#cek_jenis').val();
|
|
if (cek_jenis=='Sie Kegiatan') {
|
|
$('button[name="edit_undtu"]').hide();
|
|
$('button[name="tambah_peserta"]').hide();
|
|
$('button[name="tambah_peserta_luar"]').hide();
|
|
$('button[name="batal_undtu"]').hide();
|
|
$('button[name="aktif_undtu"]').hide();
|
|
} else {
|
|
$('button[name="edit_undtu"]').show();
|
|
$('button[name="tambah_peserta"]').show();
|
|
$('button[name="tambah_peserta_luar"]').show();
|
|
$('button[name="batal_undtu"]').show();
|
|
$('button[name="aktif_undtu"]').show();
|
|
}
|
|
|
|
$("#tabel_data_undtu").on('click','.edit_undtu',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_undtu').modal('show');
|
|
$('#modal_body_undtu').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/modal.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_undtu').html(data);
|
|
$('#nama').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_undtu").on('click','.tambah_peserta',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_tambah').modal('show');
|
|
$('#modal_body_tambah').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/modal_tambah.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_tambah').html(data);
|
|
$('#peserta_nama').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_undtu").on('click','.tambah_peserta_luar',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_tambah_luar').modal('show');
|
|
$('#modal_body_tambah_luar').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/modal_tambah_luar.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_tambah_luar').html(data);
|
|
$('#peserta_nama_l').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_undtu").on('click','.pr_und',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_pr_und').modal('show');
|
|
$('#modal_body_pr_und').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/modal_prund.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_pr_und').html(data);
|
|
$('#peserta_nama_u').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$("#tabel_data_undtu").on('click','.info_peserta',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_undtu_peserta').modal('show');
|
|
$('#modal_body_undtu_peserta').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/modal_peserta.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_undtu_peserta').html(data);
|
|
var key = "cek_jam";
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#jam_main').html(data);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
//$.post('app/peserta/main.php',{id : id, tujuan_rapat : tujuan_rapat, nm_ruangan : nm_ruangan, tgl_kegiatan : tgl_kegiatan, jam : jam, st_persiapan : st_persiapan},function(html){$("#main_tag").html(html);});
|
|
});
|
|
|
|
$("#tabel_data_undtu").on('click','.batal_undtu',function(){
|
|
var x = confirm("Anda yakin ingin membatalkan ?");
|
|
if (x) {
|
|
var key = "batal_undtu";
|
|
var id = $(this).attr('id');
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#tabel_undtu').load("app/undtu/tabel.php");
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
$("#tabel_data_undtu").on('click','.aktif_undtu',function(){
|
|
var x = confirm("Anda yakin ingin mengaktifkan ?");
|
|
if (x) {
|
|
var key = "aktif_undtu";
|
|
var id = $(this).attr('id');
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#tabel_undtu').load("app/undtu/tabel.php");
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
$("#tabel_data_undtu").on('click','.lampiran_undtu',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_file_inbox').modal('show');
|
|
$('#modal_body_file_inbox').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/modal_file.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_file_inbox').html(data);
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|
|
|