Files
eletter-backup/app/laporan/tabel_tb3.php
2024-05-31 14:18:00 +07:00

76 lines
4.5 KiB
PHP

<?php
include("../koneksi.php");
$thn=$_POST['thn'];
$tm1=$_POST['tm1'];
$tm1=str_replace('/','-',$tm1);
$tt1=date('Y',strtotime($tm1));
$bb1=date('m',strtotime($tm1));
$hh1=date('d',strtotime($tm1));
$ts1=$_POST['ts1'];
$ts1=str_replace('/','-',$ts1);
$tt2=date('Y',strtotime($ts1));
$bb2=date('m',strtotime($ts1));
$hh2=date('d',strtotime($ts1));
?>
<script type="text/javascript">$("#tabel_data_tb3").DataTable({"paging": true,"lengthChange": false,"searching": false,"ordering": false,"info": true,"autoWidth": false});</script>
<table id="tabel_data_tb3" class="table table-striped table-condensed" cellpadding="1">
<thead>
<tr>
<td><b>Dari</b></td>
<td width="100px;"><b>Tgl Surat</b></td>
<td width="120px;"><b>Tgl Arsip</b></td>
<td width="80px;"><b>No Surat</b></td>
<td><b>Perihal</b></td>
<td width="50px;"><b>Jenis</b></td>
<td width="100px;"><b>No Agenda</b></td>
<td width="80px;" align="center"><b>Kode</b></td>
</tr>
</thead>
<tbody style="color:black">
<?php
$data=pg_query("SELECT DISTINCT s.surat_dari,s.no_surat,s.perihal,(SELECT j.jenis FROM jenis_disposisi j WHERE j.id=s.jenis_disposisi_id),
s.no_agenda,s.sm_baca,s.id,
(SELECT f.sifat FROM sifat_surat f WHERE f.id=s.sifat_surat_id),s.tgl_surat_masuk,s.tgl_diterima,
(SELECT kode FROM kode WHERE id=s.kode_id),
s.tgl_surat_masuk,s.tgl_diterima,a.tgl_arsip
FROM surat s
LEFT OUTER JOIN kirim k ON (s.id=k.surat_id)
INNER JOIN arsip a ON (a.surat_id=s.id)
WHERE s.jenis_disposisi_id='1'
AND a.tgl_arsip::DATE BETWEEN '$tt1-$bb1-$hh1' AND '$tt2-$bb2-$hh2'
ORDER BY a.tgl_arsip DESC");
while($r=pg_fetch_array($data)) {
?>
<tr>
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;" class="kiri"><b><?php echo $r['surat_dari']; ?></b></td>
<td><b><?php
if (date('d-m-Y',strtotime($r['tgl_surat_masuk']))=='01-01-1970') {
echo "-";} else {
echo date('d-m-Y',strtotime($r['tgl_surat_masuk']));
} ?></b></td>
<td><b><?php if ($r['tgl_arsip']==null) {} else {echo date('d-m-Y',strtotime($r['tgl_arsip']));} ?></b></td>
<td width="110px;"><b><?php echo $r['no_surat']; ?></b></td>
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;"><b><?php echo $r['perihal']; ?></b></td>
<td width="50px;"><b><?php echo current(explode(' ',$r[3])); //echo $r[3]; ?></b></td>
<td width="80px;"><b><?php
$no_pinjam=(int) substr($r['no_agenda'],0,5);
$no_agenda=sprintf("%05s",$no_pinjam);
if (date('d-m-Y',strtotime($r['tgl_surat_masuk']))=='01-01-1970') {
echo $r[10].'/'.$no_agenda.'/102.7/'.date('Y',strtotime($r['tgl_arsip']));
} else {
echo $r[10].'/'.$no_agenda.'/102.7/'.date('Y',strtotime($r['tgl_surat_masuk']));
}
?></b></td>
<td width="80px;" align="center" class="kanan"><b><?php echo $r[10]; ?></b></td>
</tr>
<?php
}
?>
</tbody>
</table>