<?php
session_start();
if(isset($_SESSION['halaman']) && !empty($_SESSION['halaman'])) {
   
}
if(($_SESSION['halaman']=="admin"))
{
   
}

else
{
  header("location: ../../../login");  
}

include("../header.php");


include '../../../config/koneksi.php';



?>
                }
<!DOCTYPE html>
<html>
    <head>
        <title></title>

               
            <script type="text/javascript">

                function tampilsurat() {
                    $.ajax({
                        type: 'GET',
                        url: 'tampil.php',
                        data: {
                            
                        },
                        success: function (data) {
                            $('#tampil_data').html(data);
                          
                        }
                    });
                };

 </script>  
        
          <script type="text/javascript">
              $(document).ready(function () {
                  $("#btnsimpan").click(function () {
                        $.ajax({
                              type: "POST",
                              url: "input.php",
                              data: {
                                id_opdi: $("#id_opdi").val(),
                                kode_opdi: $("#kode_opdi").val(),
                                opdi: $("#opdi").val(),
 
                                 
                                      },
                              success: function () {
                                  $("#id_opdi").val(''),
                                  $("#kode_opdi").val(''),
                                  $("#opdi").val(''),
 
                                 
                                   tampilsurat(),

                                  oksimp()
                                 
                              }
                          })
                      }
                  );

                  $("#btnubah").click(function () {
                      $.ajax({
                          type: "POST",
                          url: "edit.php",
                          data: {
                                 id_opdu: $("#id_opdu").val(),
                                kode_opdu: $("#kode_opdu").val(),
                                opdu: $("#opdu").val(),
 
                                },
                          success: function () {
                             $("#id_opdu").val(''),
                                  $("#kode_opdu").val(''),
                                  $("#opdu").val(''),
                              tampilsurat(),
                               
                              $("#jabatanu").val(''),
                             okubah()
                          }
                      })
                  });
                  $("#btnhapus").click(function () {
                      $.ajax({
                          type: "POST",
                          url: "delete.php",
                          data: {
                                 id_opdh: $("#id_opdh").val(),
                          },
                          success: function () {
                              tampilsurat(),
                                 $("#id_opdh").val(''),
                                 okhapus()
                          }
                      })
                  });

              });

</script>
       
       
    </head>
    <body onload="tampilsurat(),tgladd()">
        
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 id="stat"></h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item active"></li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
        <section class="content">
      <div class="container-fluid">
       <div > 
             

<div class="card">
  <div class="card-header bg-blue">
    <h3 class="card-title">Data Admin OPD</h3>
    <div class="card-tools">
      <!-- Collapse Button -->
      <button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-minus"></i></button>
    </div>
    <!-- /.card-tools -->
  </div>
  <!-- /.card-header -->
  <div class="card-body">
     
       <div id="form_input" class ="card-body">
              
            <button id="myButton" onclick="tgladd()" type="button" class=" btnSelect  btn btn-warning fa fa-edit " data-toggle="modal" data-target="#modal-simpan">
                Input Data OPD
              </button>
            
         </div>
          <div id="tampil_data" ></div>
        
  </div>
  <!-- /.card-body -->
</div>
<!-- /.card -->

<div class="modal fade" id="modal-simpan" >
        <div class="modal-dialog modal-xl"  style ="width:99%">
          <div class="modal-content" >
            <div class="modal-header">
              <h4 class="modal-title"><i class ="fa fa-bar">Input</i></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body" >
          <div id="form_input" class ="card-body">
            <p><label>ID</label>
              <input type="text" id="id_opdi" class="form-control">
            </p>
            
            <p><label>kode</label>
              <input type="text" id="kode_opdi" class="form-control">
            </p>
            
            <p><label>Nama OPD</label>
              <input type="text" id="opdi" class="form-control">
            </p>
           
               
            <div class="modal-footer justify-content-between">
             <button style="float:right" class="btn btn-success" data-dismiss="modal">Batal</button>
             <button id="btnsimpan"  style="float:left" class="btn btn-success " data-dismiss="modal">Simpan</button>
          </div>

            </div>
               </div>
          <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
      </div>
      <!-- /.modal -->




</div>



      <div class="modal fade" id="modal-ubah" >
        <div class="modal-dialog modal-xl modal-lg"  style ="width:99%">
          <div class="modal-content" >
            <div class="modal-header">
              <h4 class="modal-title"><i class ="fa fa-bar">Ubah</i></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body" >
          <div id="form_hapus" class ="card-body">
               
           <p><label>ID</label>
              <input type="text" id="id_opdu" class="form-control">
            </p>
            
            <p><label>kode</label>
              <input type="text" id="kode_opdu" class="form-control">
            </p>
            
            <p><label>Nama OPD</label>
              <input type="text" id="opdu" class="form-control">
            </p>
           
              <div class="modal-footer justify-content-between">
             <button style="float:right" class="btn btn-success" data-dismiss="modal">Batal</button>
             <button id="btnubah"  style="float:left" class="btn btn-success " data-dismiss="modal">Ubah</button>
          </div>
          </div>
        </div>
        <!-- /.col-->
      </div>
             </div>

            </div>
         
          </div>
          <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
      </div>
      <!-- /.modal -->



                   <div class="modal fade" id="modal-hapus" >
        <div class="modal-dialog modal-xl"  style ="width:99%">
          <div class="modal-content" >
            <div class="modal-header">
              <h4 class="modal-title"><i class ="fa fa-bar">Hapus</i></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body" >
          <div id="form_hapus" class ="card-body">
               
            <p><label>ID</label>
              <input type="text" id="id_opdh" class="form-control">
            </p>
            
            <p><label>kode</label>
              <input type="text" id="kode_opdh" class="form-control">
            </p>
            
            <p><label>Nama OPD</label>
              <input type="text" id="opdh" class="form-control">
            </p>
           
             </div>

            </div>
            <div class="modal-footer justify-content-between">
              
             <button   style="float:left" class="btn btn-success" data-dismiss="modal">Batal</button>
             <button id="btnhapus"  style="float:right" class="btn btn-danger" data-dismiss="modal">Hapus</button>
            </div>
          </div>
          <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
      </div>
      <!-- /.modal -->
       
           </div>
        
        </div>
       
   
     
    </section>
  

  <!-- Control Sidebar -->
 
</div>
<!-- ./wrapper -->
         <footer class="main-footer">
    <strong></strong>
    BADAN PERENCANAAN PEMBANGUNAN DAERAH
    <div class="float-right d-none d-sm-inline-block">
      <b>By </b> eky
    </div>
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
 <?php 
 include("../samping.php");
 ?>
  </aside>
  <!-- /.control-sidebar -->

        <!-- DataTables  & Plugins -->
<script src="../../../plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../../../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="../../../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="../../../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="../../../plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="../../../plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script src="../../../plugins/jszip/jszip.min.js"></script>
<script src="../../../plugins/pdfmake/pdfmake.min.js"></script>
<script src="../../../plugins/pdfmake/vfs_fonts.js"></script>
<script src="../../../plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="../../../plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="../../../plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
   
<!-- SweetAlert2 -->
<script src="../../../plugins/sweetalert2/sweetalert2.min.js"></script>
<!-- Toastr -->
<script src="../../../plugins/toastr/toastr.min.js"></script>
<!-- AdminLTE App -->
<!-- Select2 -->
<script src="../../../plugins/select2/js/select2.full.min.js"></script>
<script src="../../../plugins/daterangepicker/daterangepicker.js"></script>


<script src="../../../plugins/moment/moment.min.js"></script>
<script src="../../../plugins/inputmask/jquery.inputmask.min.js"></script>
<!-- date-range-picker -->
<script src="../../../plugins/daterangepicker/daterangepicker.js"></script>
<!-- bootstrap color picker -->
<script src="../../../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>

        <!-- Bootstrap 4 -->

<script src="../../../plugins/summernote/summernote-bs4.min.js"></script>
<!-- SweetAlert2 -->
     

<script type="text/javascript">
  function tgladd(){
     $('#tgl_beritai').datetimepicker({
                        format: 'yyyy-MM-DD',
                        autoclose: true,
                    });
  }
</script>

        <script>
            $(function () {
                 $('#id_opdis').select2();
                  $('#tgl_beritai').datetimepicker({
                        format: 'yyyy-MM-DD',
                        autoclose: true,
                    });
                   $('#tgl_beritau').datetimepicker({
                        format: 'yyyy-MM-DD',
                        autoclose: true,
                    });


       })
            // DropzoneJS Demo Code End
</script>


    </body>
</html>
