<?php
//index.php
                    include 'database.php';
                    session_start();
                    $user=$_SESSION['username'];
                    ?>

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap CSS -->
    <script src="jquery.min.js"></script>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="fontawesome/fontawesome-free-5.15.4-web/css/all.min.css">
    <link rel="stylesheet" href="style-laporan.css">

    <title>SIPIN | PTA Jambi</title>
  </head>
  <body>
    <!-- Nav -->
    <nav class="navbar navbar-light bg-success">
        <div class="container">
        <a class="navbar-brand"><strong style="font-family:cambria;" class="text-warning">Sistem Pelayanan Informasi PTA Jambi</strong> | <span style="font-size: 14px; font-family: cambria;" class="text-light">Selamat Datang Petugas Pelayanan Informasi dan Pengaduan</span></a>
            <form class="d-flex">
                <input class="form-control me-2 form-control-sm" style="font-family:camria; font-size:12px" type="search" placeholder="Pencarian" aria-label="Search">
                <button class="btn btn-outline-warning btn-sm" type="submit"><b><i class="fas fa-search"></i></b></button>
            </form>

            <div class="icon ms-auto">
                <h5>
                    <a href="#"><i class="fas fa-envelope me-2 text-dark" data-toggle="tooltip" title="Pesan Masuk"></i></a>
                    <a href="#"><i class="fas fa-bell me-2 text-dark" data-toggle="tooltip" title="Notifikasi"></i></a>
                    <a href="#"><i class="fas fa-sign-out-alt me-2 text-dark" data-toggle="tooltip" title="Keluar"></i></a>
                </h5>
            </div>
        </div>
    </nav>
    <!-- end Nav -->

    
    <div class="container">
        <div class="row no-gutters">
            <!-- nav HORIZONTAL -->
            <div class="row-md-2 bg-dark" style="width: 13rem; height: 100%;">
            <ul class="nav flex-column pb-2 pt-2" style="font-family: Cambria; font-size:11px;">
                <a class="navbar-brand text-center mt-2"><strong style="font-family:cambria;" class="text-warning">SIPIN</strong></a>
                <hr class="bg-light">
                    <li class="nav-item mb-2">
                    <a class="nav-link active text-light" aria-current="page" href="dash.php"><i class="fas fa-tachometer-alt"></i> DASHBOARD</a>
                    </li>
                    <li class="nav-item mb-2 position-relative">
                    <a class="nav-link text-light" href="informasi.php"><i class="fas fa-info-circle"></i> PELAYANAN INFORMASI
                    <?php  
                    include 'database.php';
                        //index.php
                        $que = "SELECT * FROM datatamu where status = '0'";
                        $cari = mysqli_query($conn, $que);
                        $a = mysqli_num_rows($cari);
                        if ($a <> 0){
                    ?>
                            <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger spinner-grow spinner-grow-sm">
                                <?php echo $a ?>
                                <span class="visually-hidden">unread messages</span>
                            </span>
                    <?php }else{ ?>
                            
                    <?php } ?>
                    </a>
                    </li>
                    <li class="nav-item mb-2">
                    <a class="nav-link text-light" href="keberatan.php"><i class="fas fa-hand-paper"></i> KEBERATAN INFORMASI</a>
                    </li>
                    <li class="nav-item mb-2">
                    <a class="nav-link text-light" href="pengaduan.php"><i class="fas fa-headset"></i> PELAYANAN PENGADUAN</a>
                    </li>
                    <li class="nav-item mb-2">
                    <a class="nav-link text-light" href="kegiatan.php"><i class="fas fa-landmark"></i> DATA KEGIATAN</a>
                    </li>

                    <lu class="accordion accordion-flush" id="accordionFlushExample">
                        <span class="accordion-item">
                            <span class="accordion-header" id="flush-headingOne">
                            <span class="accordion-button collapsed collapsed-sm bg-dark text-light pt-1 ps-3" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne" style="font-size:11px;">
                             <i class="fas fa-file"> </i><span class="text-dark">-</span>LAPORAN
                            </span>
                            </span>
                            <div id="flush-collapseOne" class="accordion-collapse collapse accordion-collapse-sm" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
                            <li class="nav-item bg-dark">
                            <a class="nav-link text-light" href="lap_informasi.php"><i class="fas fa-scroll"></i> LAPORAN INFORMASI</a>
                            </li>
                            <li class="nav-item bg-dark">
                            <a class="nav-link text-light" href="lap_pengaduan.php"><i class="fas fa-book-open"></i> LAPORAN PENGADUAN</a>
                            </li>
                            <li class="nav-item bg-dark">
                            <a class="nav-link text-light" href="lap_bukutamu.php"><i class="fas fa-user"></i> LAPORAN BUKU TAMU</a>
                            </li>
                            </span>
                        </div>
                    </lu>

                    <lu class="accordion accordion-flush" id="accordionFlushExample1">
                        <span class="accordion-item">
                            <span class="accordion-header" id="flush-headingOne1">
                            <span class="accordion-button collapsed collapsed-sm bg-dark text-light pt-1 ps-3" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne1" aria-expanded="false" aria-controls="flush-collapseOne1" style="font-size:11px;">
                            <i class="fas fa-tasks"> </i><span class="text-dark">- </span>REGISTER
                            </span>
                            </span>
                            <div id="flush-collapseOne1" class="accordion-collapse collapse accordion-collapse-sm" aria-labelledby="flush-headingOne1" data-bs-parent="#accordionFlushExample1">
                            <li class="nav-item">
                            <a class="nav-link text-light" href="reg_informasi.php"><i class="fas fa-th-list"></i> REGISTER INFORMASI</a>
                            </li>
                            <li class="nav-item">
                            <a class="nav-link text-light" href="reg_keberatan.php"><i class="fas fa-folder"></i> REGISTER KEBERATAN</a>
                            </li>
                            <li class="nav-item">
                            <a class="nav-link text-light" href="#"><i class="fas fa-tasks"></i> REGISTER PENGADUAN</a>
                            </li>
                            </span>
                        </div>
                    </lu>
                    <li class="nav-item mb-2">
                    <a class="nav-link text-light" href="aplikasi.php"><i class="fas fa-laptop"></i> APLIKASI PENDUKUNG</a>
                    </li>
                    <li class="nav-item mb-2">
                    <a class="nav-link text-light" href="aturan.php"><i class="fas fa-paperclip"></i> REGULASI dan MEKANISME</a>
                    </li>
                    
                    <li class="nav-item">
                    <a class="nav-link text-danger" href="index.php"><i class="fas fa-sign-out-alt"></i> LOG OUT</a><hr class="bg-light">
                    </li>
                </ul>

            </div>
            <!-- end nav HORIZONTAL -->

            <div class="row-md-10 bg-light pt-2" style="width: 58rem; height: 100%;">
                <div class="ms-2" style="font-size:22px"><i class="fas fa-th-list"></i> <strong style="font-family:cambria">REGISTER PERMOHONAN INFORMASI</strong></div>
                <form method="POST">
                <div class="card">
                    <div class="card-body">

                        <div class="input-group w-50 pt-2">
                            <h6 class="pe-2 pt-2" style="font-size:12px"><i class="fas fa-calendar"></i> Tahun Register</h6>
                            <select id="tahun" name="tahun" class="form-select" style="font-size:12px">
                            <option value="-" disabled selected>TAHUN</option>
                            <option value="2023">2023	</option>
                            <option value="2024">2024	</option>
                            <option value="2025">2025	</option>
                            <option value="2026">2026	</option>
                            <option value="2027">2027	</option>
                            <option value="2028">2028	</option>
                            <option value="2029">2029	</option>
                            <option value="2030">2030	</option>
                            </select>
                        </div>
                        <!-- tabel -->
                        <button type="submit" name="tampil" id="tampil" class="btn btn-primary w-50 mt-2" style="font-family:cambria; font-size:12px;">Proses</button>
                        <hr>
                        <?php
                            @$bulan = $_POST['bulan'];
                            @$tahun = $_POST['tahun'];
                            if(isset($_POST['tampil'])){ 
                               ?>
                               <table width="100%">
                                <tr>
                                    <td width="90%"><div style="font-family:cambria; font-size:12px;" class="pb-2 text-center">
                                    Silahkan Klik Button Dibawah untuk mencetak Register Informasi Tahun <?php echo $tahun ?> </div></td>
                                </tr>
                                <tr>
                                <td class="text-center" style="font-size:12px"> <a href="informasi/register_informasi.php/?ID=<?php echo $tahun ?>" target="_blank"><i class="fas fa-print bg-success text-light p-2" data-toggle="tooltip" title="Cetak"> Print</i></a></td>
                                </tr>
                               </table>
                            
                               <?php
                                }
                            
                        ?>
                    </div>
                    <!-- end tabel --> 
                    </div>
</form>


                </div>
            </div>

    <div class="container-fluid text-center bg-success text-light fixed-bottom">
    <span style="font-size: 12px; font-style: italic;">Pengadilan Tinggi Agama Jambi &copy; ferdian_ITP (2021)</span>
    </div>

    <!-- Optional JavaScript; choose one of the two! -->

    <!-- Option 1: Bootstrap Bundle with Popper -->
    <script src="bootstrap/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

    <!-- Option 2: Separate Popper and Bootstrap JS -->
    <!--
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
    -->
  </body>
</html>

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

<!-- Detail Perkara -->
<div class="modal fade" id="view_data_modal" tabindex="-1" aria-labelledby="add_data_modalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
            <h5 class="modal-title" id="add_data_modalLabel"><i class="fas fa-database"></i> Detail Permohonan Informasi</h5>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <div class="modal-body" id="detail_pegawai">
    
   </div>
   <div class="modal-footer">
    <button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
   </div>
  </div>
 </div>
</div>

<script>
//Begin Tampil Detail Karyawan
 $(document).on('click', '.view_data', function(){
  var employee_id = $(this).attr("id");
  $.ajax({
   url:"informasi/select.php",
   method:"POST",
   data:{employee_id:employee_id},
   success:function(data){
    $('#detail_pegawai').html(data);
    $('#dataModal').modal('show');
   }
  });
 });
//End Tampil Detail Karyawan
</script>
<!-- end Detail Perkara -->

<!-- Update Perkara -->
<div class="modal fade" id="edit_data_modal" tabindex="-1" aria-labelledby="add_data_modalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
            <h5 class="modal-title" id="add_data_modalLabel"><i class="fas fa-edit"></i> Ubah Data Permohonan Informasi</h5>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <div class="modal-body" id="form_edit">
    
   </div>
   <div class="modal-footer">
    <button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
   </div>
  </div>
 </div>
</div>

<script>
//Begin Tampil Form Edit
$(document).on('click', '.edit_data', function(){
  var employee_id = $(this).attr("id");
  $.ajax({
   url:"informasi/edit2.php",
   method:"POST",
   data:{employee_id:employee_id},
   success:function(data){
    $('#form_edit').html(data);
    $('#editModal').modal('show');
   }
  });
 });
//End Tampil Form Edit
</script>