<?PHP
if(!isset($_COOKIE['ADMIN_KEY']) && !isset($_COOKIE['KEY'])){
  header('location:./login/');
  exit;
}else{
$query_role ="SELECT lihat,modifikasi,hapus FROM role WHERE modul_id='27' AND level_id='$current_user[level]'";
$result_role = $connection->query($query_role);
if($result_role->num_rows > 0){
  $data_role = $result_role->fetch_assoc();

switch(@$_GET['op']){
default:
echo'
<style>
.webcame-recognition {
  width: 100%!important;
}

.webcame-recognition .vidDisplay {
    width: 100%;
    border-radius: 15px;
    transform: scaleX(-1);
    min-height:250px!important;
}
</style>
<span class="modifikasi d-none">'.convert('encrypt', $data_role['modifikasi']).'</span>
<span class="hapus d-none">'.convert('encrypt',$data_role['hapus']).'</span>
<div class="header bg-primary pb-6">
  <div class="container-fluid">
    <div class="header-body">
      <div class="row align-items-center py-4">
        <div class="col-lg-6 col-7">
          <nav aria-label="breadcrumb" class="d-none d-md-inline-block">
            <ol class="breadcrumb breadcrumb-links breadcrumb-dark">
              <li class="breadcrumb-item"><a href="./"><i class="fas fa-home"></i> Dashboard</a></li>
              <li class="breadcrumb-item active" aria-current="page">Pendaftaran Wajah Siswa</li>
            </ol>
          </nav>
        </div>
        
      </div>
    </div>
  </div>
</div>

  <!-- Page content -->
  <div class="container-fluid mt--6">
    <div class="row">
        <div class="col-md-8">
          <div class="card pb-3">
            <!-- Card header -->
            <div class="card-header mb-2">
              <h3 class="mb-0 text-left float-left">Pendaftaran Wajah Siswa</h3>
            </div>';
            if($data_role['lihat']=='Y'){
              echo'
              <div class="table-responsive">
              <table class="table align-items-center table-flush table-striped datatable" style="width:100%">
                <thead class="thead-light">
                  <tr>
                    <th class="text-center" width="5">No</th>
                    <th>Nama Siswa</th>
                    <th>Status</th>
                    <th class="text-center" width="10">Aksi</th>
                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
              </div>';
            }else{
              hak_akses();
            }
            echo'
          </div>
          </div>

          <div class="col-md-4">
            <div class="card ">
              <div class="card-header mb-2">
                <h3 class="mb-0 text-left float-left">Tambah Data Wajah</h3>
              </div>
                <div class="card-body">
                  <div class="form-group">
                    <label class="form-control-label">Pilih Siswa</label>
                      <select class="form-control siswa" name="siswa" required>

                      </select>
                  </div>

                  <div class="webcame-recognition mt-2">
                    <div class="video-recognition">
                        <video id="video" class="vidDisplay" autoplay muted playsinline width="300" height="300"></video>
                        <div class="overlay-recognition">
                            <div class="scan-line"></div>
                            <div class="result-label" id="status">Loading..</div>
                        </div>
                    </div>

                    <div class="Controls-camera s-widodo.com">
                        <button class="btn btn-primary btn-md btn-save" id="capture" disabled onclick="capture()" title="Take Photo">
                            <i class="fas fa-camera"></i> Take Photo
                        </button>
                    </div>
                </div>

                </div>
             </div>

          </div>
      </div>';
  break;
  }
  }else{
    theme_404();
  }
}?>