Files
2024-08-13 05:44:19 +00:00

248 lines
7.1 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<!-- App title -->
<title>SIMPRO RSSA</title>
</head>
<style type="text/css">
.breakAfter{
page-break-after: always;
}
@page
{
size: 210mm 430mm;
height: 430;
width: 210mm;
margin: 7mm 0mm 0mm 6mm;
}
body
{
margin-left: 30px;
}
table {
border-collapse: collapse;
}
td, th {
padding:0px 5px 0px 5px;
}
#tb_head, #cssTable, b, div, pre {
font-family: "Tahoma";
font-size: 11px;
width: 700px;
table-layout: fixed;
}
.a {width: 70px; max-width: 70px;}
.b {width: 250px;max-width: 250px;}
/*.h {width: 23px;max-width: 23px;} */
.i {width: 180px;max-width: 180px;}
.j {width: 130px;max-width: 130px;}
.l {width: 30px;max-width: 30px;}
/* .k {width: 80px;max-width: 80px;}
.m {width: 90px;max-width: 90px;} */
#cssTable td
{
vertical-align: middle;
}
#cssTable {
border-spacing:0;
}
#cssTable tbody td, th {
border-right:1px solid black;
border-bottom:1px solid black;
border-left:1px solid black;
border-top:1px solid black;
}
#cssTable thead td,th {
border-right:1px solid black;
border-bottom:1px solid black;
border-left:1px solid black;
border-top:1px solid black;
}
#cssTable tfoot td {
border-bottom: none;
border-right: none;
border-left: none;
border-top:none;
}
.header-info {
font-family: "Tahoma";
font-size: 20px;
}
.tr_head {
text-align: left;
}
pre {
white-space: pre-wrap;
word-break: keep-all;
border: 0;
color:black;
padding: 0px;
width: 650px;
background: rgba(0, 151, 19, 0);
}
</style>
<body>
<?php
include("../../koneksi.php");
date_default_timezone_set('Asia/Jakarta');
$riwayat_kegiatan_id=$_POST['riwayat_kegiatan_id'];
$data = pg_query("SELECT j.nama,k.nama_pelatihan,k.tempat,
k.tanggal_mulai,k.tanggal_selesai,k.ket_acara
FROM riwayat_kegiatan k INNER JOIN jenis_pelatihan j ON (j.id=k.jenis_pelatihan_id)
WHERE k.id='$riwayat_kegiatan_id'");
while($row=pg_fetch_array($data)) {
$jenis_pelatihan=$row[0];
$nama_pelatihan=$row[1];
$tempat=$row[2];
$tanggal_mulai=$row[3];
$tanggal_selesai=$row[4];
$ket_acara=$row[5];
}
$array_hari = array(1=>"Senin","Selasa","Rabu","Kamis","Jumat", "Sabtu","Minggu");
$hari = $array_hari[date("N",strtotime($tgl_kegiatan))];
$bulan = array(
'01' => 'JANUARI',
'02' => 'FEBRUARI',
'03' => 'MARET',
'04' => 'APRIL',
'05' => 'MEI',
'06' => 'JUNI',
'07' => 'JULI',
'08' => 'AGUSTUS',
'09' => 'SEPTEMBER',
'10' => 'OKTOBER',
'11' => 'NOVEMBER',
'12' => 'DESEMBER',
);
$bulan[date('m')];
$a=date('d',strtotime($tanggal_mulai)).' '.(strtoupper($bulan[date('m',strtotime($tanggal_mulai))])).' '.date('Y',strtotime($tanggal_mulai)) ;
$b=date('d',strtotime($tanggal_selesai)).' '.(strtoupper($bulan[date('m',strtotime($tanggal_selesai))])).' '.date('Y',strtotime($tanggal_selesai)) ;
?>
<table class="report-container" id="rpt" style="border-top: none;border-bottom: none;border-left: none;border-right: none;">
<thead class="report-header" style="border-top: none;border-bottom: none;border-left: none;border-right: none;">
<tr style="border-top: none;border-bottom: none;border-left: none;border-right: none;">
<th class="report-header-cell" style="font-weight: normal;border-top: none;border-bottom: none;border-left: none;border-right: none;">
<div class="header-info">
<table id="tb_head">
<thead>
<tr class="tr_head"><td><center><?php echo strtoupper('jadwal kegiatan'); ?></center></td></tr>
<tr class="tr_head"><td><center><?php echo strtoupper($jenis_pelatihan); ?></center></td></tr>
<tr class="tr_head"><td><center><?php echo strtoupper($nama_pelatihan); ?></center></td></tr>
<tr class="tr_head"><td><center><?php echo strtoupper('TANGGAL '.$a.' - '.$b); ?></center></td></tr>
</thead>
</table>
<br>
</div>
</th>
</tr>
</thead>
<tbody class="report-content">
<tr>
<td class="report-content-cell">
<div class="main">
<table style="color:black;" id="cssTable">
<thead>
<tr align="center" style="height:25px;">
<td class="a">WAKTU</td>
<td class="b">MATERI</td>
<td class="i">NARASUMBER/PJ</td>
<td class="j">KETERANGAN</td>
</tr>
</thead>
<?php
$h=pg_query("SELECT DISTINCT hari_ke FROM jadwal_kegiatan WHERE riwayat_kegiatan_id='$riwayat_kegiatan_id' ORDER BY hari_ke ASC");
while($rh=pg_fetch_array($h)) {$hk=$rh[0];
?>
<tr style="height:20px;"><td colspan="4"><b><?php echo 'Hari ke - '.$hk; ?></b></td></tr>
<?php
$result = pg_query("SELECT * FROM jadwal_kegiatan
WHERE riwayat_kegiatan_id='$riwayat_kegiatan_id' AND hari_ke='$hk'
ORDER BY hari_ke ASC,waktu_mulai ASC,id ASC
");
$totalRows_result = pg_num_rows($result);
$i=1;
$no=1;
echo "<tbody><tr style='line-height:1.3'>";
while($row_result = pg_fetch_array($result)) {
if ($i > 1 && $i % 20 == 0)
echo '</tr><tr style="line-height:1.3" class="breakAfter">';
else if ($i)
echo '</tr><tr style="line-height:1.3">';
++$i;
echo "<td align='center'>"; echo date('H:i',strtotime($row_result[3])).' - '.date('H:i',strtotime($row_result[4])); echo "</td>";
echo "<td>"; echo $row_result[5].'.'; echo "</td>";
echo "<td>"; echo $row_result[6].'.'; echo "</td>";
echo "<td>"; echo $row_result[7].'.'; echo "</td>";
$no++;
}
echo '</tr></tbody>';
}
?>
<tfoot>
<tr>
<td colspan="6"><br>
<!-- <div class="row"><div class="col-lg-12" style="text-align:center;margin-left:190px">Mengetahui</div></div>
<div class="row"><div class="col-lg-12" style="text-align:center;margin-left:190px">Ka.Bid. Pengembangan Profesi</div></div>
<br>
<br>
<br>
<br>
<div class="row"><div class="col-lg-12" style="text-align:center;text-decoration: underline;margin-left:190px"><?php echo $nm_kepala; ?></div></div>
<div class="row"><div class="col-lg-12" style="text-align:center;margin-left:190px"><?php echo $pangkat; ?></div></div>
<div class="row"><div class="col-lg-12" style="text-align:center;margin-left:190px"><?php echo $nip; ?></div></div> -->
<pre class="tabel"><?php echo $ket_acara; ?></pre>
</td>
</tr>
</tfoot>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
window.print();
window.close();
</script>
</body>
</html>