22 lines
571 B
PHP
22 lines
571 B
PHP
<?php
|
|
include("../koneksi.php");
|
|
$thn=$_POST['thn_count'];
|
|
$satker=$_POST['satker_count'];
|
|
|
|
$output = '';
|
|
|
|
for ($i = 1; $i <= 12; $i++) {
|
|
$d1=pg_query($koneksi,"SELECT COUNT(DISTINCT s.id)
|
|
FROM surat s WHERE s.satuan_kerja_id='$satker' AND COALESCE(s.tahun,'') <> 'batal'
|
|
AND s.jenis_surat_id='3' AND s.jenis_disposisi_id='3'
|
|
AND EXTRACT(YEAR FROM DATE(s.tgl_surat_keluar))='$thn'
|
|
AND EXTRACT(MONTH FROM DATE(s.tgl_surat_keluar))='$i'
|
|
");
|
|
while($r1=pg_fetch_array($d1)) {
|
|
$output .= $r1[0] . '^';
|
|
}
|
|
}
|
|
|
|
echo rtrim($output, '^');
|
|
?>
|