<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Print Permohonan Informasi</title>
</head>

<body onLoad="javascript:window.print()">

<table width="80%" border="1" cellspacing="0" style="font-family:'Times New Roman', Times, serif; font-size:9px" align="center">
    <tr>
        <td align="center" colspan="4"><b style="font-size:16px;">PENGADILAN TINGGI AGAMA JAMBI</b><br/>JL. H. AGUS SALIM, KOTA BARU JAMBI<br/>TELP. 0741 - 41092, 40131, 445559<br/>FAX. 0741 - 445293<br/>Home page
     : www.pta.jambi.go.id e-Mail : ptajambi@yahoo.com</td>
    </tr>
    <tr>
        <td align="center" colspan="4"><b style="font-size:14px;">LAPORAN PERMOHONAN INFORMASI</b><br/><b>Model A - Untuk Prosedur Biasa</b></td>
    </tr>
</table>
</br>
                          <?php
                          include 'database.php';
                          if (isset($_GET['ID']))
                          {
                            ?>
                          <table width="80%" style="font-family:'Times New Roman', Times, serif; font-size:9px" align="center">
                                <tr>
                                    <td align="center"><div style="font-family:cambria; font-size:18px;" class="pb-2 text-center">Laporan Pelayanan Informasi </br>Bulan <?php echo $_GET['ID'] ?> </div></td>
                                    </tr>
                               </table>
                          </br>
                                <table width="80%" border="1" cellspacing="0" style="font-family:'Times New Roman', Times, serif; font-size:9px" align="center">
                                <tr style="font-size:12px;" align="center">
                                    <td rowspan="2" width="3%">No</td>
                                    <td rowspan="2" width="20%">Jenis Informasi</td>
                                    <td rowspan="2" width="10%">Jumlah Permohonan</td>
                                    <td rowspan="2" width="10%">Waktu Rata-rata Pelayanan</td>
                                    <td colspan="2">Jumlah Permohonan Dikabulkan</td>
                                    <td colspan="3">Jumlah Permohonan DItolak</td>
                                    <td rowspan="2" width="10%">Aksi</td>
                                </tr>
                                <tr style="font-size:12px;" align="center">
                                    <td width="10%">Sepenuhnya</td>
                                    <td width="10%">Sebagian</td>
                                    <td width="10%">Rahasia</td>
                                    <td width="10%">Belum Dikuasai/Selesai</td>
                                    <td width="10%">Lainnya</td>
                                </tr>

                                <?php  
                                include 'database.php';
                                $nomor=1;
                                $date=date('Y-m-d');
                                @$bulan=$_POST['bulan'];
                                @$tahun=$_POST['tahun'];
                                $_SESSION['thn']=$tahun;
                                $_SESSION['bln']=$bulan;
                                @$periode=$_GET['ID'];
                                ?>

                                <tr style="font-size:12px;">
                                    <td align="center">1</td>
                                    <td>Perkara dan Putusan</td>
                                        <?php
                                        $que = "SELECT*FROM tb_informasi where jenis_informasi = 'Perkara dan Putusan' and periode = '$periode'";
                                        $cari = mysqli_query($koneksi, $que);
                                        $a = mysqli_num_rows($cari);
                                        ?>
                                    <td align="center"><?php echo $a ; ?></td>
                                        <?php
                                        $que1 = "SELECT SUM(waktu_pelayanan) as jlh_waktu FROM tb_informasi where  jenis_informasi = 'Perkara dan Putusan' and periode = '$periode'";
                                        $cari1 = mysqli_query($koneksi, $que1);
                                        $b = mysqli_fetch_array($cari1);
                                        ?>
                                    <td align="center"><?php
                                    $waktu = $b['jlh_waktu']; 
                                    $jlh_info = $a;
                                    if($waktu == ''){
                                        echo '0';
                                    }else{
                                        $tot = $waktu/$jlh_info;
                                        echo $tot. ' menit';
                                    }
                                    ?></td>
                                         <?php
                                        $que2 = "SELECT * FROM tb_informasi where (status_informasi = '13' AND jenis_informasi = 'Perkara dan Putusan') and periode = '$periode'";
                                        $cari2 = mysqli_query($koneksi, $que2);
                                        $c = mysqli_num_rows($cari2);
                                        ?>
                                    <td align="center"><?php echo $c;?></td> 
                                    <?php
                                        $que3 = "SELECT * FROM tb_informasi where (status_informasi = '14' AND jenis_informasi = 'Perkara dan Putusan') and periode = '$periode'";
                                        $cari3 = mysqli_query($koneksi, $que3);
                                        $d = mysqli_num_rows($cari3);
                                        ?>
                                    <td align="center"><?php echo $d;?></td>
                                    <?php
                                        $que4 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Perkara dan Putusan') AND (alasan = 'Rahasia' and periode = '$periode')";
                                        $cari4 = mysqli_query($koneksi, $que4);
                                        $e = mysqli_num_rows($cari4);
                                        ?>
                                    <td align="center"><?php echo $e;?></td>
                                    <?php
                                        $que5 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Perkara dan Putusan') AND (alasan = 'Belum Dikuasai/Selesai' and periode = '$periode')";
                                        $cari5 = mysqli_query($koneksi, $que5);
                                        $f = mysqli_num_rows($cari5);
                                        ?>
                                    <td align="center"><?php echo $f;?></td> 
                                    <?php
                                        $que6 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Perkara dan Putusan') AND (alasan = 'Lainnya' and periode = '$periode')";
                                        $cari6 = mysqli_query($koneksi, $que6);
                                        $g = mysqli_num_rows($cari6);
                                        ?>
                                    <td align="center"><?php echo $g;?></td>
                                    <td></td>
                                </tr>

                                <tr style="font-size:12px;">
                                    <td align="center">2</td>
                                    <td>Kepegawaian</td>
                                        <?php
                                        $peg1 = "SELECT*FROM tb_informasi where jenis_informasi = 'Kepegawaian' and periode = '$periode'";
                                        $src1 = mysqli_query($koneksi, $peg1);
                                        $a1 = mysqli_num_rows($src1);
                                        ?>
                                    <td align="center"><?php echo $a1 ; ?></td>
                                        <?php
                                        $peg2 = "SELECT SUM(waktu_pelayanan) as jlh_waktu1 FROM tb_informasi where  jenis_informasi = 'Kepegawaian' and periode = '$periode'";
                                        $src2 = mysqli_query($koneksi, $peg2);
                                        $a2 = mysqli_fetch_array($src2);
                                        ?>
                                    <td align="center"><?php
                                    $waktu1 = $a2['jlh_waktu1']; 
                                    $jlh_info1 = $a1;
                                    if($waktu1 == ''){
                                        echo '0';
                                    }else{
                                        $tot1 = $waktu1/$jlh_info1;
                                        echo $tot1. ' menit';
                                    }
                                    ?></td>
                                         <?php
                                        $peg3 = "SELECT * FROM tb_informasi where (status_informasi = '13' AND jenis_informasi = 'Kepegawaian') and periode = '$periode'";
                                        $src3 = mysqli_query($koneksi, $peg3);
                                        $a3 = mysqli_num_rows($src3);
                                        ?>
                                    <td align="center"><?php echo $a3;?></td> 
                                    <?php
                                        $peg4 = "SELECT * FROM tb_informasi where (status_informasi = '14' AND jenis_informasi = 'Kepegawaian') and periode = '$periode'";
                                        $src4 = mysqli_query($koneksi, $peg4);
                                        $a4 = mysqli_num_rows($src4);
                                        ?>
                                    <td align="center"><?php echo $a4;?></td>
                                    <?php
                                        $peg5 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Kepegawaian') AND (alasan = 'Rahasia' and periode = '$periode')";
                                        $src5 = mysqli_query($koneksi, $peg5);
                                        $a5 = mysqli_num_rows($src5);
                                        ?>
                                    <td align="center"><?php echo $a5;?></td>
                                    <?php
                                        $peg6 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Kepegawaian') AND (alasan = 'Belum Dikuasai/Selesai' and periode = '$periode')";
                                        $src6 = mysqli_query($koneksi, $peg6);
                                        $a6 = mysqli_num_rows($src6);
                                        ?>
                                    <td align="center"><?php echo $a6;?></td> 
                                    <?php
                                        $peg7 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Kepegawaian') AND (alasan = 'Lainnya' and periode = '$periode')";
                                        $src7 = mysqli_query($koneksi, $peg7);
                                        $a7 = mysqli_num_rows($src7);
                                        ?>
                                    <td align="center"><?php echo $a7;?></td>
                                    <td></td>
                                </tr>

                                <tr style="font-size:12px;">
                                    <td align="center">3</td>
                                    <td>Pengawasan dan Pendisiplinan</td>
                                        <?php
                                        $pp1 = "SELECT*FROM tb_informasi where jenis_informasi = 'Pengawasan dan Pendisiplinan' and periode = '$periode'";
                                        $view1 = mysqli_query($koneksi, $pp1);
                                        $b1 = mysqli_num_rows($view1);
                                        ?>
                                    <td align="center"><?php echo $b1 ; ?></td>
                                        <?php
                                        $pp2 = "SELECT SUM(waktu_pelayanan) as jlh_waktu2 FROM tb_informasi where  jenis_informasi = 'Pengawasan dan Pendisiplinan' and periode = '$periode'";
                                        $view2 = mysqli_query($koneksi, $pp2);
                                        $b2 = mysqli_fetch_array($view2);
                                        ?>
                                    <td align="center"><?php
                                    $waktu2 = $b2['jlh_waktu2']; 
                                    $jlh_info2 = $b1;
                                    if($waktu2 == ''){
                                        echo '0';
                                    }else{
                                        $tot2 = $waktu2/$jlh_info2;
                                        echo $tot2. ' menit';
                                    }
                                    ?></td>
                                         <?php
                                        $pp3 = "SELECT * FROM tb_informasi where (status_informasi = '13' AND jenis_informasi = 'Pengawasan dan Pendisiplinan') and periode = '$periode'";
                                        $view3 = mysqli_query($koneksi, $pp3);
                                        $b3 = mysqli_num_rows($view3);
                                        ?>
                                    <td align="center"><?php echo $b3;?></td> 
                                    <?php
                                        $pp4 = "SELECT * FROM tb_informasi where (status_informasi = '14' AND jenis_informasi = 'Pengawasan dan Pendisiplinan') and periode = '$periode'";
                                        $view4 = mysqli_query($koneksi, $pp4);
                                        $b4 = mysqli_num_rows($view4);
                                        ?>
                                    <td align="center"><?php echo $b4;?></td>
                                    <?php
                                        $pp5 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Pengawasan dan Pendisiplinan') AND (alasan = 'Rahasia' and periode = '$periode')";
                                        $view5 = mysqli_query($koneksi, $pp5);
                                        $b5 = mysqli_num_rows($view5);
                                        ?>
                                    <td align="center"><?php echo $b5;?></td>
                                    <?php
                                        $pp6 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Pengawasan dan Pendisiplinan') AND (alasan = 'Belum Dikuasai/Selesai' and periode = '$periode')";
                                        $view6 = mysqli_query($koneksi, $pp6);
                                        $b6 = mysqli_num_rows($view6);
                                        ?>
                                    <td align="center"><?php echo $b6;?></td> 
                                    <?php
                                        $pp7 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Pengawasan dan Pendisiplinan') AND (alasan = 'Lainnya' and periode = '$periode')";
                                        $view7 = mysqli_query($koneksi, $pp7);
                                        $b7 = mysqli_num_rows($view7);
                                        ?>
                                    <td align="center"><?php echo $b7;?></td>
                                    <td></td>
                                </tr>

                                <tr style="font-size:12px;">
                                    <td align="center">4</td>
                                    <td>Anggaran dan Aset</td>
                                        <?php
                                        $aa1 = "SELECT*FROM tb_informasi where jenis_informasi = 'Anggaran dan Aset' and periode = '$periode'";
                                        $lihat1 = mysqli_query($koneksi, $aa1);
                                        $c1 = mysqli_num_rows($lihat1);
                                        ?>
                                    <td align="center"><?php echo $c1 ; ?></td>
                                        <?php
                                        $aa2 = "SELECT SUM(waktu_pelayanan) as jlh_waktu3 FROM tb_informasi where  jenis_informasi = 'Anggaran dan Aset' and periode = '$periode'";
                                        $lihat2 = mysqli_query($koneksi, $aa2);
                                        $c2 = mysqli_fetch_array($lihat2);
                                        ?>
                                    <td align="center"><?php
                                    $waktu3 = $c2['jlh_waktu3']; 
                                    $jlh_info3 = $c1;
                                    if($waktu3 == ''){
                                        echo '0';
                                    }else{
                                        $tot3 = $waktu3/$jlh_info3;
                                        echo $tot3. ' menit';
                                    }
                                    ?></td>
                                         <?php
                                        $aa3 = "SELECT * FROM tb_informasi where (status_informasi = '13' AND jenis_informasi = 'Anggaran dan Aset') and periode = '$periode'";
                                        $lihat3 = mysqli_query($koneksi, $aa3);
                                        $c3 = mysqli_num_rows($lihat3);
                                        ?>
                                    <td align="center"><?php echo $c3;?></td> 
                                    <?php
                                        $aa4 = "SELECT * FROM tb_informasi where (status_informasi = '14' AND jenis_informasi = 'Anggaran dan Aset') and periode = '$periode'";
                                        $lihat4 = mysqli_query($koneksi, $aa4);
                                        $c4 = mysqli_num_rows($lihat4);
                                        ?>
                                    <td align="center"><?php echo $c4;?></td>
                                    <?php
                                        $aa5 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Anggaran dan Aset') AND (alasan = 'Rahasia' and periode = '$periode')";
                                        $lihat5 = mysqli_query($koneksi, $aa5);
                                        $c5 = mysqli_num_rows($lihat5);
                                        ?>
                                    <td align="center"><?php echo $c5;?></td>
                                    <?php
                                        $aa6 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Anggaran dan Aset') AND (alasan = 'Belum Dikuasai/Selesai' and periode = '$periode')";
                                        $lihat6 = mysqli_query($koneksi, $aa6);
                                        $c6 = mysqli_num_rows($lihat6);
                                        ?>
                                    <td align="center"><?php echo $c6;?></td> 
                                    <?php
                                        $aa7 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Anggaran dan Aset') AND (alasan = 'Lainnya' and periode = '$periode')";
                                        $lihat7 = mysqli_query($koneksi, $aa7);
                                        $c7 = mysqli_num_rows($lihat7);
                                        ?>
                                    <td align="center"><?php echo $c7;?></td>
                                    <td></td>
                                </tr>

                                <tr style="font-size:12px;">
                                    <td align="center">5</td>
                                    <td>Lainnya</td>
                                        <?php
                                        $lain1 = "SELECT*FROM tb_informasi where jenis_informasi = 'Lainnya' and periode = '$periode'";
                                        $cek1 = mysqli_query($koneksi, $lain1);
                                        $d1 = mysqli_num_rows($cek1);
                                        ?>
                                    <td align="center"><?php echo $d1 ; ?></td>
                                        <?php
                                        $lain2 = "SELECT SUM(waktu_pelayanan) as jlh_waktu4 FROM tb_informasi where  jenis_informasi = 'Lainnya' and periode = '$periode'";
                                        $cek2 = mysqli_query($koneksi, $lain2);
                                        $d2 = mysqli_fetch_array($cek2);
                                        ?>
                                    <td align="center"><?php
                                    $waktu4 = $d2['jlh_waktu4']; 
                                    $jlh_info4 = $d1;
                                    if($waktu4 == ''){
                                        echo '0';
                                    }else{
                                        $tot4 = $waktu4/$jlh_info4;
                                        echo $tot4. ' menit';
                                    }
                                    ?></td>
                                         <?php
                                        $lain3 = "SELECT * FROM tb_informasi where (status_informasi = '13' AND jenis_informasi = 'Lainnya') and periode = '$periode'";
                                        $cek3 = mysqli_query($koneksi, $lain3);
                                        $d3 = mysqli_num_rows($cek3);
                                        ?>
                                    <td align="center"><?php echo $d3;?></td> 
                                    <?php
                                        $lain4 = "SELECT * FROM tb_informasi where (status_informasi = '14' AND jenis_informasi = 'Lainnya') and periode = '$periode'";
                                        $cek4 = mysqli_query($koneksi, $lain4);
                                        $d4 = mysqli_num_rows($cek4);
                                        ?>
                                    <td align="center"><?php echo $d4;?></td>
                                    <?php
                                        $lain5 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Lainnya') AND (alasan = 'Rahasia' and periode = '$periode')";
                                        $cek5 = mysqli_query($koneksi, $lain5);
                                        $d5 = mysqli_num_rows($cek5);
                                        ?>
                                    <td align="center"><?php echo $d5;?></td>
                                    <?php
                                        $lain6 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Lainnya') AND (alasan = 'Belum Dikuasai/Selesai' and periode = '$periode')";
                                        $cek6 = mysqli_query($koneksi, $lain6);
                                        $d6 = mysqli_num_rows($cek6);
                                        ?>
                                    <td align="center"><?php echo $d6;?></td> 
                                    <?php
                                        $lain7 = "SELECT * FROM tb_informasi where (status_informasi = '12' AND jenis_informasi = 'Lainnya') AND (alasan = 'Lainnya' and periode = '$periode')";
                                        $cek7 = mysqli_query($koneksi, $lain7);
                                        $d7 = mysqli_num_rows($cek7);
                                        ?>
                                    <td align="center"><?php echo $d7;?></td>
                                    <td></td>
                                </tr>

                                <tr style="font-size:12px;" align="center">
                                    <td colspan="2">Total</td>
                                    <td>
                                        <?php
                                        $tot_permohonan = $a+$a1+$b1+$c1+$d1;
                                        echo $tot_permohonan;
                                        ?>
                                    </td>
                                    <td>
                                    <!--<?php
                                        $tot_waktu = $tot+$tot1+$tot2+$tot3+$tot4;
                                        echo $tot_permohonan. ' menit';
                                        ?> -->
                                    </td>
                                    <td>
                                    <?php
                                        $tot_sepenuhnya = $c+$a3+$b3+$c3+$d3;
                                        echo $tot_sepenuhnya;
                                        ?>
                                    </td> 
                                    <td>
                                    <?php
                                        $tot_sebagian = $d+$a4+$b4+$c4+$d4;
                                        echo $tot_sebagian;
                                        ?>
                                    </td>
                                    <td>
                                    <?php
                                        $tot_rahasia = $e+$a5+$b5+$c5+$d5;
                                        echo $tot_rahasia;
                                        ?>
                                    </td>
                                    <td>
                                    <?php
                                        $tot_dikuasai = $f+$a6+$b6+$c6+$d6;
                                        echo $tot_dikuasai;
                                        ?>
                                    </td> 
                                    <td>
                                    <?php
                                        $tot_lainnya = $g+$a7+$b7+$c7+$d7;
                                        echo $tot_lainnya;
                                        ?>
                                    </td>
                                    <td></td>
                                </tr>
                                </table>

<br/>
<table width="80%" border="0" cellspacing="0" style="font-family:'Times New Roman', Times, serif; font-size:14px" align="center">

  <tr align="center">
    <td width="50%"></br>Ketua PTA Jambi</td>
    <td width="50%">Jambi,<?php echo date('d-F-Y')?></br>Petugas Informasi</td>
  </tr>
  <tr align="center">
    <td style="padding-top:50px">...................</td>
    <td style="padding-top:50px">...................</td>
  </tr>
</table>

<?php
  }
  ?>
</body>
</html>


<?php
function tgl_indo($tanggal){
	$bulan = array (
		1 =>   'Januari',
		'Februari',
		'Maret',
		'April',
		'Mei',
		'Juni',
		'Juli',
		'Agustus',
		'September',
		'Oktober',
		'November',
		'Desember'
	);
	$pecahkan = explode('-', $tanggal);
	
	// variabel pecahkan 0 = tanggal
	// variabel pecahkan 1 = bulan
	// variabel pecahkan 2 = tahun
 
	return $pecahkan[2] . ' ' . $bulan[ (int)$pecahkan[1] ] . ' ' . $pecahkan[0];
}
?>