<?php
session_start();
ini_set('date.timezone', 'Asia/Jakarta');
require_once "./admin/class/library.php";
$lib= new library();
$p=@$_GET["p"];

$tipe_user_nama="";
$tipe_user=0;
$foto_profil= (@$_SESSION['ses_knn_admin_foto']=="") ? "default.jpg" : @$_SESSION['ses_knn_admin_foto'];
if(@$_SESSION['ses_knn_admin_tipe']==1) { $tipe_user_nama="Petugas"; $tipe_user=1; } 
elseif(@$_SESSION['ses_knn_admin_tipe']==2) { $tipe_user_nama="Administrator"; $tipe_user=2; }
?>
<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="apple-touch-icon" sizes="76x76" href="./assets/img/favicon.png">
  <link rel="icon" type="image/png" href="./assets/img/favicon.png">
  <title>Aplikasi Metode K-Nearest Neighbor | Metode KNN</title>
  <meta name="description" content="Source Code aplikasi metode K-Nearest Neighbor (Metode KNN), Metode ANN/JST untuk klasifikasi, dapat digunakan untuk belajar dan atau dikembangkan untuk pengerjaan Tugas Akhir atau Skripsi. anindyadev.com siap membantu untuk pengembangan ataupun judul-judul lain diluar source code program aplikasi yang sudah ada.">
  <meta name="keywords" content="k-nearest neighbor, metode knn, lvq, jst, ann, jaringan syaraf tiruan, artificial neural network, demo aplikasi, software, klasifikasi, anindyadev.com"> 
  <!-- Fonts and icons -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet" />
  <!-- Nucleo Icons -->
  <link href="./assets/css/nucleo-icons.css" rel="stylesheet" />
  <link href="./assets/css/nucleo-svg.css" rel="stylesheet" />
  <!-- Font Awesome Icons -->
  <script src="https://kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script>
  <link href="./assets/css/nucleo-svg.css" rel="stylesheet" />
  <!-- CSS Files -->
  <link id="pagestyle" href="./assets/css/argon-dashboard.css?v=2.0.4" rel="stylesheet" />
  <link rel="stylesheet" href="./assets/css/tabel.css">
  <link rel="stylesheet" href="./plugins/select2/css/select2.css">
	<link rel="stylesheet" href="./plugins/datatables-bs4/css/dataTables.bootstrap4.css">
</head>

<body class="g-sidenav-show bg-gray-100">
  <div class="min-height-300 bg-primary position-absolute w-100"></div>
  <aside class="sidenav bg-white navbar navbar-vertical navbar-expand-xs border-0 border-radius-xl my-3 fixed-start ms-4 " id="sidenav-main">
    <div class="sidenav-header">
      <i class="fas fa-times p-3 cursor-pointer text-secondary opacity-5 position-absolute end-0 top-0 d-none d-xl-none" aria-hidden="true" id="iconSidenav"></i>
      <a class="navbar-brand m-0" href=" https://demos.creative-tim.com/argon-dashboard/pages/dashboard.html " target="_blank">
        <img src="./assets/img/favicon.png" class="navbar-brand-img h-100" alt="logo">
        <span class="ms-1 font-weight-bold">Aplikasi Metode KNN</span>
      </a>
    </div>
    <hr class="horizontal dark mt-0">
    <div class="collapse navbar-collapse  w-auto " id="sidenav-collapse-main">
      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link <?php if($p=="testing" || $p=="testing-input") { echo "active bg-primary text-white"; } ?>" href="?p=testing">
            <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
              <i class="ni ni-folder-17 <?php if($p=="testing" || $p=="testing-input") { echo "text-white"; } else {  echo "text-warning"; } ?> text-sm opacity-10"></i>
            </div>
            <span class="nav-link-text ms-1">K-Nearest Neighbor</span>
          </a>
        </li>
        <li class="nav-item">
          <a class="nav-link <?php if($p=="training" || $p=="training-input") { echo "active bg-primary text-white"; } ?>" href="./admin/login.php">
            <div class="icon icon-shape icon-sm border-radius-md text-center me-2 d-flex align-items-center justify-content-center">
              <i class="ni ni-single-02 <?php if($p=="training" || $p=="training-input") { echo "text-white"; } else {  echo "text-success"; } ?> text-sm opacity-10"></i>
            </div>
            <span class="nav-link-text ms-1">Login Admin</span>
          </a>
        </li>
      </ul>
    </div>
    
  </aside>
  <main class="main-content position-relative border-radius-lg ">
    <!-- Navbar -->
    <nav class="navbar navbar-main navbar-expand-lg px-0 mx-4 shadow-none border-radius-xl " id="navbarBlur" data-scroll="false">
      <div class="container-fluid py-1 px-3">
        <div class="collapse navbar-collapse mt-sm-0 mt-2 me-md-0 me-sm-4" id="navbar">
          <div class="ms-md-auto pe-md-3 d-flex align-items-center">
          </div>
          <div class="ms-md-auto pe-md-3 d-xl-none d-flex align-items-center">
              <a href="javascript:;" class="nav-link text-white p-0" id="iconNavbarSidenav">
                <div class="sidenav-toggler-inner">
                  <i class="sidenav-toggler-line bg-white"></i>
                  <i class="sidenav-toggler-line bg-white"></i>
                  <i class="sidenav-toggler-line bg-white"></i>
                </div>
              </a>
          </div>          
          <ul class="navbar-nav justify-content-end">
            <li class="nav-item px-2 d-flex align-items-center">
              <a href="./admin/login.php" class="nav-link text-white p-0">
                <i class="fa fa-user fixed-plugin-button-nav cursor-pointer"></i>
                <span class="d-sm-inline">Login Admin</span>
              </a>
            </li>
          </ul>
        </div>
      </div>
    </nav>
    <!-- End Navbar -->
    <div class="container-fluid py-4">

      <?php
        switch ($p) {
          case "testing":
            include ("inp_testing.php");
            break;
          default:
            include ("inp_testing.php");
        }
			?>

      
    </div>
  </main>

  <!--   Core JS Files   -->
  <script src="./plugins/jquery/jquery.min.js"></script>
  <script src="./assets/js/core/popper.min.js"></script>
  <script src="./assets/js/core/bootstrap.min.js"></script>
  <script src="./plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="./assets/js/plugins/perfect-scrollbar.min.js"></script>
  <script src="./assets/js/plugins/smooth-scrollbar.min.js"></script>
  <script src="./plugins/select2/js/select2.full.min.js"></script>	
  <script src="./plugins/datatables/jquery.dataTables.js"></script>
  <script src="./plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
  <script src="./assets/js/validator.min.js"></script>
  
  <script>
    var win = navigator.platform.indexOf('Win') > -1;
    if (win && document.querySelector('#sidenav-scrollbar')) {
      var options = {
        damping: '0.5'
      }
      Scrollbar.init(document.querySelector('#sidenav-scrollbar'), options);
    }

    $(document).ready(function() {
		      
      //Datatable
      $("#tabel_data_simple,#tabel_data_simple2").DataTable({
          "paging": true,
          "lengthChange": false,
          "searching": false,
          "ordering": false,
          "info": false,
          "autoWidth": false,	
          "language": {
            "paginate": {
              "previous": "<i class='fa fa-chevron-left'></i>",
              "next": "<i class='fa fa-chevron-right'></i>",            
            }
          }

      });
            
      $('.select2').select2();
      // form repeater Initialization
      $('.repeater').repeater({
          isFirstItemUndeletable: true,

          show: function () {
            $(this).find('span').remove();
            $(this).find('select').select2({});
            $(this).slideDown();
          },
          hide: function (deleteElement) {
          if (confirm('Are you sure you want to delete this element?')) {
            $(this).slideUp(deleteElement);
            hapus_item();
          }
          }


      });
      
    });
  </script>
  <!-- Github buttons -->
  <script async defer src="https://buttons.github.io/buttons.js"></script>
  <!-- Control Center for Soft Dashboard: parallax effects, scripts for the example pages etc -->
  <script src="./assets/js/argon-dashboard.min.js?v=2.0.4"></script>
</body>

</html>