301 lines
16 KiB
PHP
301 lines
16 KiB
PHP
<?php
|
|
|
|
|
|
include('../koneksi.php');
|
|
$jenis=$_POST['jenis'];
|
|
$tgl_mulai=$_POST['tgl_mulai'];
|
|
$tgl_selesai=$_POST['tgl_selesai'];
|
|
$cari_ruangan=$_POST['cari_ruangan'];
|
|
|
|
$tgl_mulai=$_POST['tgl_mulai'];
|
|
$tgl_mulai=str_replace('/','-',$tgl_mulai);
|
|
$tm=date('Y',strtotime($tgl_mulai));
|
|
$bm=date('m',strtotime($tgl_mulai));
|
|
$hm=date('d',strtotime($tgl_mulai));
|
|
|
|
$tgl_selesai=$_POST['tgl_selesai'];
|
|
$tgl_selesai=str_replace('/','-',$tgl_selesai);
|
|
$ts=date('Y',strtotime($tgl_selesai));
|
|
$bs=date('m',strtotime($tgl_selesai));
|
|
$hs=date('d',strtotime($tgl_selesai));
|
|
|
|
$array_hari = array(1=>"Senin","Selasa","Rabu","Kamis","Jumat", "Sabtu","Minggu");
|
|
|
|
$date1="$tm-$bm-$hm";
|
|
$date2="$ts-$bs-$hs";
|
|
|
|
|
|
$jml_hari=pg_query("SELECT DATE_PART('day', '$ts-$bs-$hs'::timestamp - '$tm-$bm-$hm'::timestamp)");
|
|
while($rj=pg_fetch_array($jml_hari)) {$jh=$rj[0];}
|
|
|
|
|
|
$newTanggalSekarang=strtotime($date1);
|
|
|
|
for ($x = 0; $x <= $jh; $x++) {
|
|
$jumlahHari=$x;
|
|
$NewjumlahHari=86400*$jumlahHari;
|
|
$hasilJumlah = $newTanggalSekarang + $NewjumlahHari;
|
|
$tampilHasil=date("d-m-Y",$hasilJumlah);
|
|
$hari = $array_hari[date("N",strtotime($tampilHasil))];
|
|
if (($hari=='Minggu') || ($hari=='Sabtu')) {} else {
|
|
?>
|
|
<input type="hidden" id="no" value="<?php echo $no; ?>">
|
|
|
|
<?php
|
|
$tgl_keg=$tampilHasil;
|
|
$tgl_keg=str_replace('/','-',$tgl_keg);
|
|
$tk=date('Y',strtotime($tgl_keg));
|
|
$bk=date('m',strtotime($tgl_keg));
|
|
$hk=date('d',strtotime($tgl_keg));
|
|
|
|
$cek=pg_query("SELECT COUNT(waktu_mulai) FROM riwayat_kegiatan
|
|
WHERE tgl_acara='$tk-$bk-$hk' AND st_pesan='PJ' AND st_batal IS NULL
|
|
".($cari_ruangan == null ? "" : "AND tempat='$cari_ruangan'")."
|
|
");
|
|
while($rcek=pg_fetch_array($cek)) {$jcek=$rcek[0];}
|
|
if ($jcek==0) { ?>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="timeline timeline-left">
|
|
<article class="timeline-item alt">
|
|
<div class="text-left">
|
|
<div class="time-show first">
|
|
<a href="#" class="btn btn-danger w-lg"><?php echo $hari.', '.$tampilHasil; ?></a>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<article class="timeline-item ">
|
|
<div class="timeline-desk">
|
|
<div class="panel">
|
|
<div class="timeline-box">
|
|
<span class="arrow"></span>
|
|
<span class="timeline-icon bg-inverse"><i class="mdi mdi-checkbox-blank-circle-outline"></i></span>
|
|
<h4 class="text-inverse">KOSONG</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } else {
|
|
?>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="timeline timeline-left">
|
|
<article class="timeline-item alt">
|
|
<div class="text-left">
|
|
<div class="time-show first">
|
|
<a href="#" class="btn btn-orange w-lg"><?php echo $hari.', '.$tampilHasil; ?></a>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<?php
|
|
$data=pg_query("SELECT waktu_mulai,waktu_selesai,tujuan,
|
|
(SELECT nama FROM data_ruangan WHERE id=tempat),
|
|
(SELECT nama FROM data_pegawai WHERE id=notulis),
|
|
(SELECT nama FROM satuan_kerja WHERE id=perencana_rapat),
|
|
st_batal,id,tanggal_pesan FROM riwayat_kegiatan
|
|
WHERE tgl_acara='$tk-$bk-$hk'
|
|
".($cari_ruangan == null ? "" : "AND tempat='$cari_ruangan'")."
|
|
AND st_pesan='PJ' ORDER BY waktu_mulai ASC");
|
|
while($r=pg_fetch_array($data)) {
|
|
?>
|
|
<article class="timeline-item">
|
|
<div class="timeline-desk">
|
|
<div class="panel">
|
|
<div class="timeline-box" style="margin-bottom:-24px;">
|
|
<span class="arrow"></span>
|
|
<span class="timeline-icon bg-<?php
|
|
if($x==1) {echo 'success';} else
|
|
if($x==2) {echo 'primary';} else
|
|
if($x==3) {echo 'orange';} else
|
|
if($x==4) {echo 'pink';} else
|
|
if($x==5) {echo 'purple';} else {echo "success";}
|
|
?>"><i class="mdi mdi-checkbox-blank-circle-outline"></i></span>
|
|
<p>
|
|
<b class="jn"><i class="fa fa-map-marker m-r-5"></i><?php echo strtoupper($r[3]);?></b>
|
|
<b class="pull-right">
|
|
<?php if (($jenis == 'TU') || ($jenis == 'Satker')) {} else { ?>
|
|
<button type="button" name="edit_add" style="height:22px;" class="btn btn-teal btn-xs edit_add" id="<?php echo $r['id'];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if (($r['st_batal']=='Batal')) {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa fa-pencil"></i>
|
|
</button>
|
|
<button type="button" name="batal_add" style="height:22px;"class="btn btn-danger btn-xs batal_tortu" id="<?php echo $r['id'];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($r['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
<?php } ?>
|
|
</b>
|
|
</p>
|
|
<span class="judul_grafik"><?php echo ucwords(strtolower($r[2])); ?></span>
|
|
</div>
|
|
<hr>
|
|
<div class="timeline-desk" style="padding: 0px 20px 12px 20px;margin-top:-8px">
|
|
<span>
|
|
<b><i class="fa fa-clock-o m-r-5"></i>
|
|
<?php
|
|
if (date('H:i',strtotime($r['waktu_selesai']))=='00:00') {
|
|
echo date('H:i',strtotime($r['waktu_mulai'])).' s/d Selesai';
|
|
} else {
|
|
echo date('H:i',strtotime($r['waktu_mulai'])).' s/d '.date('H:i',strtotime($r['waktu_selesai']));
|
|
}
|
|
?>
|
|
</b>
|
|
<b><i class="fa fa-chevron-circle-right m-r-5"></i><?php echo $r[5]; ?></b>
|
|
<b>
|
|
<?php if ($r['st_batal']=='Batal') {?>
|
|
<span class="pull-right" style="font-weight:bold;color:green">BATAL</span>
|
|
<?php } else {} ?>
|
|
</b>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
<table class="table table-striped table-bordered" cellpadding="1" style="font-size:12px;" id="tabel_data_info">
|
|
<thead>
|
|
<tr>
|
|
<td align="center" width="110px;"><b>Waktu</b></td>
|
|
<td align="center" width="400px;"><b>Uraian Kegiatan</b></td>
|
|
<td align="center" width="100px;"><b>Tempat</b></td>
|
|
<td align="center" width="200px;"><b>Notulis</b></td>
|
|
<td align="center" width="300px;"><b>Perencana Rapat</b></td>
|
|
<?php if (($jenis == 'TU') || ($jenis == 'Satker')) {} else {?>
|
|
<td align="center" width="70px;"><b>Tools</b></td>
|
|
<?php }?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
|
|
|
|
$data=pg_query("SELECT waktu_mulai,waktu_selesai,tujuan,
|
|
(SELECT nama FROM data_ruangan WHERE id=tempat),
|
|
(SELECT nama FROM data_pegawai WHERE id=notulis),
|
|
(SELECT nama FROM satuan_kerja WHERE id=perencana_rapat),
|
|
st_batal,id,tanggal_pesan FROM riwayat_kegiatan
|
|
WHERE tgl_acara='$tk-$bk-$hk'
|
|
".($cari_ruangan == null ? "" : "AND tempat='$cari_ruangan'")."
|
|
AND st_pesan='PJ' ORDER BY waktu_mulai ASC");
|
|
while($r=pg_fetch_array($data)) {
|
|
?>
|
|
<tr
|
|
<?php
|
|
if ($r['st_batal']=='Batal') {
|
|
echo "style='color:#dddddd'";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<td align="center"><?php echo date('H:i',strtotime($r['waktu_mulai'])).' - '.date('H:i',strtotime($r['waktu_selesai'])); ?></td>
|
|
<td><?php echo $r[2];?></td>
|
|
<td><?php echo $r[3];?></td>
|
|
<td><?php echo $r[4];?></td>
|
|
<td><?php echo $r[5];?></td>
|
|
<?php if (($jenis == 'TU') || ($jenis == 'Satker')) {} else { ?>
|
|
<td align="center">
|
|
<button type="button" name="edit_add" style="height:22px;" class="btn btn-teal btn-xs edit_add" id="<?php echo $r['id'];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if (($r['st_batal']=='Batal')) {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa fa-pencil"></i>
|
|
</button>
|
|
<button type="button" name="batal_add" style="height:22px;"class="btn btn-danger btn-xs batal_tortu" id="<?php echo $r['id'];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover"
|
|
<?php
|
|
if ($r['st_batal']=='Batal') {
|
|
echo "disabled";
|
|
} else {
|
|
echo "";
|
|
}
|
|
?>
|
|
>
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
</td>
|
|
<?php }?>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
<hr> -->
|
|
<?php
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
<script>
|
|
$('button[name="edit_add"]').popover();
|
|
$('button[name="batal_add"]').popover();
|
|
// $("#tabel_data_info").on('click','.edit_add',function(){
|
|
$('button[name="edit_add"]').click(function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_add').modal('show');
|
|
$('#modal_body_add').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/info/modal.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_add').html(data);
|
|
}
|
|
});
|
|
});
|
|
|
|
$('button[name="batal_add"]').click(function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "batal_add";
|
|
var id = $(this).attr('id');
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/info/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#cari_tgl_info').trigger('click');
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
</script>
|