
<?php
// Pastikan tidak ada whitespace atau output sebelum kode ini
session_start();
include('cek_login.php');
require_once 'setting/koneksi.php';
require_once 'setting/tanggal.php';
?>

<!-- ganti sebagain data dlm colum database
  UPDATE pinjaman SET rekening = REPLACE(rekening,100.,102.) -->

<!-- <link rel="stylesheet" type="text/css" href="desain/desainhalaman.css">  --> 

  <!-- <link rel="stylesheet" type="text/css" href="./java/sorter/jquery.dataTables.css">
<script src="./java/sorter/jquery-1.11.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="./java/sorter/datatables.min.css"> -->
<!-- link untuk menampilkanmodal -->

<script src="jquery.js"></script>

 


  <!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">

  <title>MMU A-39 REJOSARI</title>
  <link rel="shortcut icon" href="img/logougt.png">

  <!-- Font Awesome Icons -->
  <link rel="stylesheet" href="assets/plugins/fontawesome-free/css/all.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="assets/dist/css/adminlte.min.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

  <!-- DataTables -->
  <link rel="stylesheet" href="assets/plugins/datatables-bs4/css/dataTables.bootstrap4.css">

  <!-- Select2 -->
  <link rel="stylesheet" href="assets/plugins/select2/css/select2.min.css">
  <link rel="stylesheet" href="assets/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">

  <script src="assets/plugins//sweetalert2/sweetalert2.min.js"></script>
  <link rel="stylesheet" href="assets/plugins//sweetalert2/sweetalert2.min.css">
</head>
<body class="hold-transition sidebar-mini">
  <div class="wrapper">

    <!-- Navbar -->
    <nav class="main-header navbar navbar-expand navbar-white navbar-light">

      <!-- Left navbar links -->
      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
        </li>
        <li class="nav-item d-none d-sm-inline-block">
          <a href="home.php?home=beranda" class="nav-link">Home</a>
        </li>
      </ul>

      


      <!-- Right navbar links -->
      <ul class="navbar-nav ml-auto"><?php echo $_SESSION['username']?>

        <!-- Notifications Dropdown Menu -->
        <li class="nav-item dropdown">
          <a class="nav-link" data-toggle="dropdown" href="#">
            <div class="image">
          <!-- <img src="img/user2-160x160.png" height="30px" width="89%" class="img-circle elevation-2" alt="User Image"> -->
          <i class ="fas fa-user-alt" height="30px" width="89%" class="img-circle elevation-2" alt="User Image"></i>
         
        </div>
      
          
            <span class="badge badge-warning navbar-badge"></span>
          </a>
          <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
            <div class="dropdown-divider"></div>
            <a href="logout.php" class="dropdown-item">
              <i class="fas fa-lock mr-2"></i> Log Out
              <span class="float-right text-muted text-sm"></span>
            </a>
          </div>
       

        

    <!-- Messages Dropdown Menu -->
      
        
      <!-- Notifications Dropdown Menu -->
      
      <!-- <li class="nav-item">
        <a class="nav-link" data-widget="fullscreen" href="#" role="button">
          <i class="fas fa-expand-arrows-alt"></i>
        </a>
      </li> -->
      <!-- <li class="nav-item">
        <a class="nav-link" data-widget="control-sidebar" data-controlsidebar-slide="true" href="#" role="button">
          <i class="fas fa-th-large"></i>
        </a>
      </li> -->
    </ul>
  </nav>

    <!-- /.navbar -->

    <!-- Main Sidebar Container -->
    <aside class="main-sidebar sidebar-dark-primary elevation-4">
      <!-- merubah warna backgron pinggir -->
      <!-- Brand Logo -->
      <a href="#" class="brand-link" >
        <span class="brand-text font-weight-light">MMU A-39 REJOSARI</span>
      </a>

      <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user panel (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
          <img src="img/user2-160x160.png" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block">UserName</a>
        </div>
      </div>

      
        <!-- Sidebar Menu -->
        <nav class="mt-2">
          <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
           with font-awesome or any other icon font library -->
           <?php include('_menu.php'); ?>
         </ul>
       </nav>
       <!-- /.sidebar-menu -->
     </div>
     <!-- /.sidebar -->
   </aside>

   <!-- Content Wrapper. Contains page content -->
   <div class="content-wrapper">
 
      <?php
      @$home=$_GET['home'];
      if(!empty($home)){

      switch($home){
  case 'home':
     
      include "home.php";
      break; 
 case md5("userlogin"):
      include "menu/form_userlogin.php";
      break;
case md5("kode_akun"):
      include "menu/form_akun.php";
      break;
case  md5("cariregister"):
      include "menu/form_cariregister.php";
      break;
case md5('caripeminjam'):
      include "menu/form_caripeminjam.php";
      break;
case md5('caripenabung'):
      include "menu/form_caripenabung.php";
      break;
case  md5("cariprofile"):
      include "menu/form_cariprofile.php";
      break;
 case md5("inputjurnal"):
      include "menu/form_jurnal.php";
      break;
case md5("kM"):
      include "menu/form_KM.php";
      break;
case md5("kK"):
      include "menu/form_KK.php";
      break;
case md5("tabungan"):
      include "menu/form_tabungan.php";
      break;
case md5("tabungan_scan"):
      include "menu/form_tabungan_scan.php";
      break;
case md5("tabungan_scan"):
      include "menu/form_tabungan_scan.php";
      break;
case md5("pembayaran_nonSyahriah"):
      include "menu/form_bayar_nonSyahriah_murid.php";
      break;
case md5("pembayaran_Syahriah"):
      include "menu/form_bayar_syahriah_murid.php";
      break;
case md5("pembayaran_Syahriah_scan"):
      include "menu/form_bayar_syahriah_murid_scan.php";
      break;
      
      
case md5("bukutabungan"):
      include "menu/form_bukutabungan.php";
      break;
case md5("editjurnal"):
      include "menu/form_edit_jurnal.php";
      break;
case md5("deletjurnal"):
      include "menu/form_delet_jurnal.php";
      break;
case md5("edit_mutasitabungan"):
      include "menu/form_tabungan_edit.php";
      break;
case md5("delete_mutasitabungan"):
      include "menu/form_tabungan_delete.php";
      break;
case md5("edit_tagihansyahriah"):
      include "menu/form_bayar_syahriah_murid_edit.php";
      break;
case md5("delete_tagihansyahriah"):
      include "menu/form_bayar_syahriah_murid_delete.php";
      break;
case md5('registrasi'):
      include "menu/form_register.php";
      break;
      case md5('registrasi_umum'):
            include "menu/form_register_umum.php";
            break;
case md5('edit_registrasi'):
      include "menu/form_register_edit.php";
      break;
case md5('master_kenaikan_kls'):
      include "laporan/master_naik_kls.php";
      break;
case md5('master_syahriah_murid'):
      include "laporan/master_syahriah_murid.php";
      break;
case md5('master_nonSyahriah_murid'):
      include "laporan/master_nonSyahriah_murid.php";
      break;
case md5('master_bukutabungan_murid'):
      include "laporan/master_bukutabungan_murid.php";
      break;
case md5('ikhtibar_murid'):
      include "laporan/lap_ikhtibar_murid.php";
      break;
case md5('lapbayar_nonsyahriah'):
      include "laporan/lap_bayar_nonsyahriah_murid.php";
      break;
case md5('lapbayar_syahriah'):
      include "laporan/lap_bayar_syahriah_murid.php";
      break;
case md5('pecahanUang_tabungan'):
      include "laporan/lap_pecahanUang_tabungan.php";
      break;

case md5('delet_registrasi'):
      include "menu/form_register_delet.php";
      break;
case md5('pencairan'):
      include "menu/form_pinjaman.php";
      break;
case md5('edit_pencairan'):
      include "menu/form_pinjaman_edit.php";
      break;
   case md5('delet_pencairan'):
      include "menu/form_pinjaman_delet.php";
      break;
case md5('angsuran'):
      include "menu/form_angsuran.php";
      break;      
case md5('editangsuran'):
      include "menu/form_angsuran_edit.php";
      break;
case md5('cetakangsuran'):
      include "menu/cetak_form_angsuran.php";
      break;
case md5('cetakpenerimaanpinjaman'):
      include "laporan/cetak_warkat_penerima_pinjaman.php";
      break;
case md5('deleteangsuran'):
      include "menu/delete_form_angsuran.php";
      break; 
case md5('buku_besar'):
      include "laporan/lap_buku_besar.php";
      break;
case md5('jurnal_umum'):
      include "laporan/lap_jurnal_umum.php";
      break;
case md5('jurnal_umum_admin'):
      include "laporan/lap_jurnal_umum_admin.php";
      break;
      
case md5("lapkodeakun"):
      include "laporan/lap_akun.php";
      break;
case md5("lap_alamat"):
      include "laporan/lap_alamat.php";
      break;
case md5("lap_register"):
      include "laporan/lap_register.php";
      break;
 case md5("lap_rekap"):
      include "laporan/lap_rekap.php";
      break;
case md5("warkatpencairan"):
      include "laporan/cetak_warkat_pencairan.php";
      break;
case md5("warkatpelunasan"):
      include "laporan/cetak_warkat_pelunasan.php";
      break;     
case md5('neraca'):
      include "laporan/lap_neraca.php";
      break;
case md5('labarugi'):
      include "laporan/lap_laba_rugi.php";
      break;        
case md5('jadwalangsuran'):
      include "laporan/lap_jadwal_angsuran.php";
      break;
case md5('kartuangsuran'):
      include "laporan/lap_kartu_angsuran.php";
      break;
case md5('lappinjaman'):
      include "laporan/lap_pinjaman.php";
      break;
case md5('mutasi_tabungan'):
      include "laporan/lap_mutasi_tabungan.php";
      break;
case md5('rekap_saldo_tabungan'):
      include "laporan/lap_rekap_saldo_tabungan.php";
      break;
      case md5('kartu_tagihan'):
            include "laporan/lap_kartu_tagihan.php";
            break;
case md5('kartu_tabungan'):
      include "laporan/lap_kartu_tabungan.php";
      break;

case md5('buatalamat'):
      include "menu/form_alamat.php";
      break;
case md5('tunggakan'):
      include "laporan/lap_tunggakan_pinjaman.php";
      break;
case md5('kolektibilitas'):
      include "laporan/lap_kolektibilitas.php";
      break;
case md5('bayarangsuran'):
      include "laporan/lap_bayar_angsuran.php";
      break;
case md5('belum_bayar'):
      include "laporan/lap_belum_bayar.php";
      break;
case md5('lap_carabayar'):
      include "laporan/lap_carabayar.php";
      break;      
case md5('backup_database'):
      include "laporan/backup_database.php";
      break;
      

case md5('postingakhirthn'):
      include "menu/form_posting_akhirtahun.php";
      break;


  default:
      include "home/beranda.php";

  }

  }else{ 

  include "home/beranda.php";

  }


  ?>


</div>
  <!-- /.content-wrapper -->

  <!-- Main Footer -->
  <footer class="main-footer">
    <!-- To the right -->
    <div class="float-right d-none d-sm-inline">
      
    </div>
    <!-- Default to the left -->
    <strong>Lakukan Backup Klik Beikut : &copy; <a href="https://adminlte.io">i</a>.</strong>  <a href='https://stokcoding.com/' title='StokCoding.com' target='_blank'></a>
    <a href="./backup/backup_database.php">Backup</a>
    
  </footer>
</div>
<!-- ./wrapper -->

<!-- REQUIRED SCRIPTS -->

<!-- jQuery -->
<script src="assets/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="assets/dist/js/adminlte.min.js"></script>
<!-- DataTables -->
<script src="assets/plugins/datatables/jquery.dataTables.js"></script>
<script src="assets/plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>

<!-- Select2 -->
<script src="assets/plugins/select2/js/select2.full.min.js"></script>
</body>
</html>

<script>
  $(function () {
    $('#example2').DataTable();

    $('#example3').dataTable( {
      "searching": false
    } );

    $('.select2').select2({
      theme: 'bootstrap4'
    });
  });
</script>
<!-- ganti backgrond menu -->
<style type="text/css">
  
  .main-sidebar{
    background-color: #0e6655;
  }
.brand-link{
    background-color:  #117864 ;

</style>



<!-- https://kelasprogrammer.com/belajar-ajax-dengan-jquery-php-untuk-pemula/ -->        
<script src="duacolum/jquery-ui.min.js"></script>
<!-- buat modal bisa digerakkan 
https://www.sahretech.com/2021/09/membuat-modal-bootstrap-dapat-digeser-dan-didrag.html?m=1 -->
<script>
    $('.modal-dialog').draggable();
</script>

<script type="text/javascript">
  // untuk format koma
  //https://cobangoding.com/tips-dan-trick/memberi-titik-otomatis-pada-angka-saat-menginput-dengan-javascript/#comment-757
  //https://codepen.io/cobangoding/pen/QWOoLXN
 $('#inputAngka').on('keyup',function(){
  var angka = $(this).val();
 
  var hasilAngka = formatRibuan(angka);
 
  $(this).val(hasilAngka);
  });

  function formatRibuan(angka) {
  let minus = /^-/.test(angka.toString()) == true ? "-" : "";
  var number_string = angka.replace(/[^\.\d]/g, '').toString(),
    split = number_string.split('.'),
    sisa = split[0].length % 3,
    angka_hasil = split[0].substr(0, sisa),
    ribuan = split[0].substr(sisa).match(/\d{3}/gi);

  // tambahkan titik jika yang di input sudah menjadi angka ribuan
  if (ribuan) {
    separator = sisa ? ',' : '';
    angka_hasil += separator + ribuan.join(',');
  }

  angka_hasil =
    split[1] != undefined ? minus + angka_hasil + '.' + split[1] : minus + angka_hasil;
  return angka_hasil;
}
</script> 



 
  <script src="dist/js/adminlte.js"></script>

<!-- AdminLTE App -->
<script src="dist/js/adminlte.js"></script>
<!-- AdminLTE for demo purposes -->
<!-- <script src="dist/js/demo.js"></script> -->
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="dist/js/pages/dashboard.js"></script>
  
  <!-- Theme style pencarian menu -->
  <!-- <link rel="stylesheet" href="dist/css/adminlte.min.css"> -->