<!DOCTYPE html>
<html lang="en">
<?php
$tiga=$this->db->query("SELECT * FROM web_setting WHERE id='1'");
foreach ($tiga->result() as $rt) {
$namsek=$rt->nama;
$logo=$rt->logo;
}
$titleweb="Presensi ".$namsek;
//echo "SELECT * FROM web_setting WHERE id='1'";
?>
<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no');?> ">
  <title>Presensi <?php echo $namsek;?></title>
  <!-- plugins:css -->
  <link rel="stylesheet"href="<?php echo base_url('assets/frontend2/vendors/feather/feather.css');?> ">
  <link rel="stylesheet"href="<?php echo base_url('assets/frontend2/vendors/ti-icons/css/themify-icons.css');?> ">
  <link rel="stylesheet"href="<?php echo base_url('assets/frontend2/vendors/css/vendor.bundle.base.css');?> ">
  <!-- endinject -->
  <!-- Plugin css for this page -->
  <link rel="stylesheet"href="<?php echo base_url('assets/frontend2/vendors/datatables.net-bs4/dataTables.bootstrap4.css');?> ">
  <link rel="stylesheet"href="<?php echo base_url('assets/frontend2/vendors/ti-icons/css/themify-icons.');?> ">
  <link rel="stylesheet" type="text/css"href="<?php echo base_url('assets/frontend2/js/select.dataTables.min.css');?> ">
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet"href="<?php echo base_url('assets/frontend2/css/vertical-layout-light/style.css');?> ">
  <!-- endinject -->
  <link rel="shortcut icon"href="<?php echo base_url('assets/frontend2/images/favicon.png');?> ">

</head>
<body>
  <div class="container-scroller">
    <!-- partial:partials/_navbar.html -->
    <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
      <div class="text-center navbar-brand-wrapper d-flex align-items-center justify-content-center">
        <a class="navbar-brand brand-logo mr-5"href="<?php echo base_url('assets/frontend2/index.html');?>"><img src="<?php echo base_url('assets/frontend2/images/logo.svg');?>" class="mr-2" alt="logo"/></a>
        <a class="navbar-brand brand-logo-mini"href="<?php echo base_url('assets/frontend2/index.html');?>"><img src="<?php echo base_url('assets/frontend2/images/logo-mini.svg');?>" alt="logo"/></a>
      </div>
      <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
        <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
          <span class="icon-menu"></span>
        </button>
        <ul class="navbar-nav mr-lg-2">
          <li class="nav-item nav-search d-none d-lg-block">
            <div class="input-group">
              <div class="input-group-prepend hover-cursor" id="navbar-search-icon">
                <span class="input-group-text" id="search">
                  <i class="icon-search"></i>
                </span>
              </div>
              <input type="text" class="form-control" id="navbar-search-input" placeholder="Search now" aria-label="search" aria-describedby="search">
            </div>
          </li>
        </ul>
        <ul class="navbar-nav navbar-nav-right">
          <li class="nav-item dropdown">
            <a class="nav-link count-indicator dropdown-toggle" id="notificationDropdown"href="#" data-toggle="dropdown">
              <i class="icon-bell mx-0"></i>
              <span class="count"></span>
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list" aria-labelledby="notificationDropdown">
              <p class="mb-0 font-weight-normal float-left dropdown-header">Notifications</p>
              <a class="dropdown-item preview-item">
                <div class="preview-thumbnail">
                  <div class="preview-icon bg-success">
                    <i class="ti-info-alt mx-0"></i>
                  </div>
                </div>
                <div class="preview-item-content">
                  <h6 class="preview-subject font-weight-normal">Application Error</h6>
                  <p class="font-weight-light small-text mb-0 text-muted">
                    Just now
                  </p>
                </div>
              </a>
              <a class="dropdown-item preview-item">
                <div class="preview-thumbnail">
                  <div class="preview-icon bg-warning">
                    <i class="ti-settings mx-0"></i>
                  </div>
                </div>
                <div class="preview-item-content">
                  <h6 class="preview-subject font-weight-normal">Settings</h6>
                  <p class="font-weight-light small-text mb-0 text-muted">
                    Private message
                  </p>
                </div>
              </a>
              <a class="dropdown-item preview-item">
                <div class="preview-thumbnail">
                  <div class="preview-icon bg-info">
                    <i class="ti-user mx-0"></i>
                  </div>
                </div>
                <div class="preview-item-content">
                  <h6 class="preview-subject font-weight-normal">New user registration</h6>
                  <p class="font-weight-light small-text mb-0 text-muted">
                    2 days ago
                  </p>
                </div>
              </a>
            </div>
          </li>
          <li class="nav-item nav-profile dropdown">
            <a class="nav-link dropdown-toggle"href="" data-toggle="dropdown" id="profileDropdown">
              <img src="<?php echo base_url('assets/frontend2/images/faces/face28.jpg');?>" alt="profile"/>
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
              <a class="dropdown-item">
                <i class="ti-settings text-primary"></i>
                Settings
              </a>
              <a class="dropdown-item">
                <i class="ti-power-off text-primary"></i>
                Logout
              </a>
            </div>
          </li>
          <li class="nav-item nav-settings d-none d-lg-flex">
            <a class="nav-link"href="#">
              <i class="icon-ellipsis"></i>
            </a>
          </li>
        </ul>
        <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
          <span class="icon-menu"></span>
        </button>
      </div>
    </nav>
    <!-- partial -->
    <div class="container-fluid page-body-wrapper">
      <!-- partial:partials/_settings-panel.html -->
      <div class="theme-setting-wrapper">
        <div id="settings-trigger"><i class="ti-settings"></i></div>
        <div id="theme-settings" class="settings-panel">
          <i class="settings-close ti-close"></i>
          <p class="settings-heading">SIDEBAR SKINS</p>
          <div class="sidebar-bg-options selected" id="sidebar-light-theme"><div class="img-ss rounded-circle bg-light border mr-3"></div>Light</div>
          <div class="sidebar-bg-options" id="sidebar-dark-theme"><div class="img-ss rounded-circle bg-dark border mr-3"></div>Dark</div>
          <p class="settings-heading mt-2">HEADER SKINS</p>
          <div class="color-tiles mx-0 px-4">
            <div class="tiles success"></div>
            <div class="tiles warning"></div>
            <div class="tiles danger"></div>
            <div class="tiles info"></div>
            <div class="tiles dark"></div>
            <div class="tiles default"></div>
          </div>
        </div>
      </div>
      <div id="right-sidebar" class="settings-panel">
        <i class="settings-close ti-close"></i>
        <ul class="nav nav-tabs border-top" id="setting-panel" role="tablist">
          <li class="nav-item">
            <a class="nav-link active" id="todo-tab" data-toggle="tab"href="<?php echo base_url('assets/frontend2/#todo-section');?>" role="tab" aria-controls="todo-section" aria-expanded="true">TO DO LIST</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" id="chats-tab" data-toggle="tab"href="<?php echo base_url('assets/frontend2/#chats-section');?>" role="tab" aria-controls="chats-section">CHATS</a>
          </li>
        </ul>
        <div class="tab-content" id="setting-content">
          <div class="tab-pane fade show active scroll-wrapper" id="todo-section" role="tabpanel" aria-labelledby="todo-section">
            <div class="add-items d-flex px-3 mb-0">
              <form class="form w-100">
                <div class="form-group d-flex">
                  <input type="text" class="form-control todo-list-input" placeholder="Add To-do">
                  <button type="submit" class="add btn btn-primary todo-list-add-btn" id="add-task">Add</button>
                </div>
              </form>
            </div>
            <div class="list-wrapper px-3">
              <ul class="d-flex flex-column-reverse todo-list">
                <li>
                  <div class="form-check">
                    <label class="form-check-label">
                      <input class="checkbox" type="checkbox">
                      Team review meeting at 3.00 PM
                    </label>
                  </div>
                  <i class="remove ti-close"></i>
                </li>
                <li>
                  <div class="form-check">
                    <label class="form-check-label">
                      <input class="checkbox" type="checkbox">
                      Prepare for presentation
                    </label>
                  </div>
                  <i class="remove ti-close"></i>
                </li>
                <li>
                  <div class="form-check">
                    <label class="form-check-label">
                      <input class="checkbox" type="checkbox">
                      Resolve all the low priority tickets due today
                    </label>
                  </div>
                  <i class="remove ti-close"></i>
                </li>
                <li class="completed">
                  <div class="form-check">
                    <label class="form-check-label">
                      <input class="checkbox" type="checkbox" checked>
                      Schedule meeting for next week
                    </label>
                  </div>
                  <i class="remove ti-close"></i>
                </li>
                <li class="completed">
                  <div class="form-check">
                    <label class="form-check-label">
                      <input class="checkbox" type="checkbox" checked>
                      Project review
                    </label>
                  </div>
                  <i class="remove ti-close"></i>
                </li>
              </ul>
            </div>
            <h4 class="px-3 text-muted mt-5 font-weight-light mb-0">Events</h4>
            <div class="events pt-4 px-3">
              <div class="wrapper d-flex mb-2">
                <i class="ti-control-record text-primary mr-2"></i>
                <span>Feb 11 2018</span>
              </div>
              <p class="mb-0 font-weight-thin text-gray">Creating component page build a js</p>
              <p class="text-gray mb-0">The total number of sessions</p>
            </div>
            <div class="events pt-4 px-3">
              <div class="wrapper d-flex mb-2">
                <i class="ti-control-record text-primary mr-2"></i>
                <span>Feb 7 2018</span>
              </div>
              <p class="mb-0 font-weight-thin text-gray">Meeting with Alisa</p>
              <p class="text-gray mb-0 ">Call Sarah Graves</p>
            </div>
          </div>
          <!-- To do section tab ends -->
          <div class="tab-pane fade" id="chats-section" role="tabpanel" aria-labelledby="chats-section">
            <div class="d-flex align-items-center justify-content-between border-bottom">
              <p class="settings-heading border-top-0 mb-3 pl-3 pt-0 border-bottom-0 pb-0">Friends</p>
              <small class="settings-heading border-top-0 mb-3 pt-0 border-bottom-0 pb-0 pr-3 font-weight-normal">See All</small>
            </div>
            <ul class="chat-list">
              <li class="list active">
                <div class="profile"><img src="<?php echo base_url('assets/frontend2/images/faces/face1.jpg');?>" alt="image"><span class="online"></span></div>
                <div class="info">
                  <p>Thomas Douglas</p>
                  <p>Available</p>
                </div>
                <small class="text-muted my-auto">19 min</small>
              </li>
              <li class="list">
                <div class="profile"><img src="<?php echo base_url('assets/frontend2/images/faces/face2.jpg');?>" alt="image"><span class="offline"></span></div>
                <div class="info">
                  <div class="wrapper d-flex">
                    <p>Catherine</p>
                  </div>
                  <p>Away</p>
                </div>
                <div class="badge badge-success badge-pill my-auto mx-2">4</div>
                <small class="text-muted my-auto">23 min</small>
              </li>
              <li class="list">
                <div class="profile"><img src="<?php echo base_url('assets/frontend2/images/faces/face3.jpg');?>" alt="image"><span class="online"></span></div>
                <div class="info">
                  <p>Daniel Russell</p>
                  <p>Available</p>
                </div>
                <small class="text-muted my-auto">14 min</small>
              </li>
              <li class="list">
                <div class="profile"><img src="<?php echo base_url('assets/frontend2/images/faces/face4.jpg');?>" alt="image"><span class="offline"></span></div>
                <div class="info">
                  <p>James Richardson</p>
                  <p>Away</p>
                </div>
                <small class="text-muted my-auto">2 min</small>
              </li>
              <li class="list">
                <div class="profile"><img src="<?php echo base_url('assets/frontend2/images/faces/face5.jpg');?>" alt="image"><span class="online"></span></div>
                <div class="info">
                  <p>Madeline Kennedy</p>
                  <p>Available</p>
                </div>
                <small class="text-muted my-auto">5 min</small>
              </li>
              <li class="list">
                <div class="profile"><img src="<?php echo base_url('assets/frontend2/images/faces/face6.jpg');?>" alt="image"><span class="online"></span></div>
                <div class="info">
                  <p>Sarah Graves</p>
                  <p>Available</p>
                </div>
                <small class="text-muted my-auto">47 min</small>
              </li>
            </ul>
          </div>
          <!-- chat tab ends -->
        </div>
      </div>
      <!-- partial -->
      <!-- partial:partials/_sidebar.html -->
      <nav class="sidebar sidebar-offcanvas" id="sidebar">
        <ul class="nav">
          <li class="nav-item">
            <a class="nav-link"href="<?php echo base_url('assets/frontend2/index.html');?>">
              <i class="icon-grid menu-icon"></i>
              <span class="menu-title">Dashboard</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="collapse"href="#ui-basic"aria-expanded="false" aria-controls="ui-basic">
              <i class="icon-layout menu-icon"></i>
              <span class="menu-title">UI Elements</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="ui-basic">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/ui-features/buttons.html');?>">Buttons</a></li>
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/ui-features/dropdowns.html');?>">Dropdowns</a></li>
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/ui-features/typography.html');?>">Typography</a></li>
              </ul>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="collapse"href="<?php echo base_url('assets/frontend2/#form-elements');?>" aria-expanded="false" aria-controls="form-elements">
              <i class="icon-columns menu-icon"></i>
              <span class="menu-title">Form elements</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="form-elements">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"><a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/forms/basic_elements.html');?>">Basic Elements</a></li>
              </ul>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="collapse"href="<?php echo base_url('assets/frontend2/#charts');?>" aria-expanded="false" aria-controls="charts">
              <i class="icon-bar-graph menu-icon"></i>
              <span class="menu-title">Charts</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="charts">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/charts/chartjs.html');?>">ChartJs</a></li>
              </ul>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="collapse"href="<?php echo base_url('assets/frontend2/#tables');?>"aria-expanded="false" aria-controls="tables">
              <i class="icon-grid-2 menu-icon"></i>
              <span class="menu-title">Tables</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="tables">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/tables/basic-table.html"');?>">Basic table</a></li>
              </ul>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="collapse"href="<?php echo base_url('assets/frontend2/#icons');?>" aria-expanded="false" aria-controls="icons">
              <i class="icon-contract menu-icon"></i>
              <span class="menu-title">Icons</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="icons">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/icons/mdi.html');?>"Mdi icons</a></li>
              </ul>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="collapse"href="<?php echo base_url('assets/frontend2/#auth');?>" aria-expanded="false" aria-controls="auth">
              <i class="icon-head menu-icon"></i>
              <span class="menu-title">User Pages</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="auth">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/samples/login.html');?>"> Login </a></li>
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/samples/register.html');?>"> Register </a></li>
              </ul>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" data-toggle="collapse"href="<?php echo base_url('assets/frontend2/#error');?>" aria-expanded="false" aria-controls="error">
              <i class="icon-ban menu-icon"></i>
              <span class="menu-title">Error pages</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="error">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/samples/error-404.html');?>"> 404 </a></li>
                <li class="nav-item"> <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/samples/error-500.html');?>"> 500 </a></li>
              </ul>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link"href="<?php echo base_url('assets/frontend2/pages/documentation/documentation.html');?>">
              <i class="icon-paper menu-icon"></i>
              <span class="menu-title">Documentation</span>
            </a>
          </li>
        </ul>
      </nav>
      <!-- partial -->
      <div class="main-panel">
        <div class="content-wrapper">
          <div class="row">
            <div class="col-md-12 grid-margin">
              <div class="row">
                <div class="col-12 col-xl-8 mb-4 mb-xl-0">
                  <h3 class="font-weight-bold">Welcome Aamir</h3>
                  <h6 class="font-weight-normal mb-0">All systems are running smoothly! You have <span class="text-primary">3 unread alerts!</span></h6>
                </div>
                <div class="col-12 col-xl-4">
                 <div class="justify-content-end d-flex">
                  <div class="dropdown flex-md-grow-1 flex-xl-grow-0">
                    <button class="btn btn-sm btn-light bg-white dropdown-toggle" type="button" id="dropdownMenuDate2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                     <i class="mdi mdi-calendar"></i> Today (10 Jan 2021)
                    </button>
                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuDate2">
                      <a class="dropdown-item"href="#">January - March</a>
                      <a class="dropdown-item"href="#">March - June</a>
                      <a class="dropdown-item"href="#">June - August</a>
                      <a class="dropdown-item"href="#">August - November</a>
                    </div>
                  </div>
                 </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-md-6 grid-margin stretch-card">
              <div class="card tale-bg">
                <div class="card-people mt-auto">
                  <img src="<?php echo base_url('assets/frontend2/images/dashboard/people.svg');?>" alt="people">
                  <div class="weather-info">
                    <div class="d-flex">
                      <div>
                        <h2 class="mb-0 font-weight-normal"><i class="icon-sun mr-2"></i>31<sup>C</sup></h2>
                      </div>
                      <div class="ml-2">
                        <h4 class="location font-weight-normal">Bangalore</h4>
                        <h6 class="font-weight-normal">India</h6>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-md-6 grid-margin transparent">
              <div class="row">
                <div class="col-md-6 mb-4 stretch-card transparent">
                  <div class="card card-tale">
                    <div class="card-body">
                      <p class="mb-4">Datang paling awal</p>
                      <?php
              $cekabsen = $this->db->query("SELECT nip,jam FROM web_absen WHERE tgl='$skrg' AND status='1' ORDER BY jam ASC LIMIT 0,1");
              //echo "SELECT nip,jam FROM web_absen WHERE tgl='$skrg' AND status='1' ORDER BY jam ASC LIMIT 0,1"."<br>";
              foreach ($cekabsen->result() as $rscek) {
                $absensiswa=$rscek->nip;
                $jammasuk=$rscek->jam;
              }
              $aa=$this->db->query("SELECT NM_PEGAWAI as A,ALAMAT,KD_JENIS_KETENAGAAN as B,absen as C,NOMOR_INDUK_BARU as D FROM web_siswa WHERE absen='$absensiswa'");
              //echo "SELECT NM_PEGAWAI as A,ALAMAT,KD_JENIS_KETENAGAAN as B,absen as C,NOMOR_INDUK_BARU as D FROM web_siswa WHERE absen='$absensiswa'";
              foreach ($aa->result() as $rssiswa) {
                $namasiswa=$rssiswa->A;
                $kelassiswa=$rssiswa->B;
              }
              ?>
                      <p class="fs-30 mb-2"><?php echo $namasiswa;?></p>
                      <p><img src="<?php echo base_url().'../upload/selfie/masuk/'.$absensiswa.$yy.$mm.$dd.'.jpg';?>" height="100"></p>
                    </div>
                  </div>
                </div>
                <div class="col-md-6 mb-4 stretch-card transparent">
                  <div class="card card-dark-blue">
                    <div class="card-body">
                      <p class="mb-4">Total Bookings</p>
                      <p class="fs-30 mb-2">61344</p>
                      <p>22.00% (30 days)</p>
                    </div>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-md-6 mb-4 mb-lg-0 stretch-card transparent">
                  <div class="card card-light-blue">
                    <div class="card-body">
                      <p class="mb-4">Number of Meetings</p>
                      <p class="fs-30 mb-2">34040</p>
                      <p>2.00% (30 days)</p>
                    </div>
                  </div>
                </div>
                <div class="col-md-6 stretch-card transparent">
                  <div class="card card-light-danger">
                    <div class="card-body">
                      <p class="mb-4">Number of Clients</p>
                      <p class="fs-30 mb-2">47033</p>
                      <p>0.22% (30 days)</p>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            
          <div class="row">
            <div class="col-md-12 grid-margin stretch-card">
              <div class="card">
                <?php

        $jenis=$this->input->get('jenis');
        $dd=$this->input->get('dd');
        $mm=$this->input->get('mm');
        $yy=$this->input->get('yy');
        if (!$dd) $dd=date('d');
        if (!$mm) $mm=date('m');
        if (!$yy) $yy=date('Y');
        if (strlen($dd)==1){
          $dd="0".$dd;
        }
        if (strlen($mm)==1){
          $mm="0".$mm;
        }

        $harike3=substr(hari($dd,$mm,$yy),0,3);
        //$akhir  = strtotime(date('H:i:s'));
        $akhir=strtotime('08:05:06');
        $awal = strtotime('07:30:00');
        $diff  = $akhir - $awal;

        $jam   = floor($diff / (60 * 60));
        $menit = $diff - ( $jam * (60 * 60) );
        $detik = $diff % 60;
        $tammenit=floor( $menit / 60 );
        $telat=($jam>0) ? "$jam jam ":" ";
        $telat.=($menit>0) ? "$tammenit menit ": " ";
        $telat.=($detik>0) ? "$detik detik ": " ";
        //echo $telat;
        //echo 'Waktu tinggal: ' . $jam .  ' jam, ' . floor( $menit / 60 ) . ' menit, ' . $detik . ' detik';
        
        ?>
        <center>
        <table><tr><td>TANGGAL</td><td>:</td><td>
          <select  name="mm" onChange="MM_jumpMenu('parent',this,0)">
            <?php if (!$dd=='') { ?>
              <option><?php echo $dd;?></option>
            <?php } else {?>
            <?php }
              for ($i=1;$i<=31;$i++) {
                    echo "<option value='?yy=$yy&mm=$mm&dd=$i'>$i</option>";
               } ?>

          </select>
          <select  name="mm" onChange="MM_jumpMenu('parent',this,0)">
            <?php if (!$mm=='') { ?>
              <option><?php echo bulan($mm);?></option>
            <?php } else {?>
            <?php }
              for ($i=1;$i<=12;$i++) {
                    echo "<option value='?yy=$yy&mm=$i&dd=$dd'>".bulan($i)."</option>";
               } ?>

          </select>
          <select  name="yy" onChange="MM_jumpMenu('parent',this,0)">
            <?php if (!$yy=='') { ?>
              <option><?php echo $yy;?></option>
            <?php }
              for ($i=date("Y");$i>date('Y')-10;$i-=1){
                    echo "<option value='?yy=$i&mm=$mm&dd=$dd'>$i</option>";
               } ?>

          </select>
          </td>
          </tr>
          <tr><td>HARI</td><td>:</td><td><b><?php echo hari($dd,$mm,$yy);?></b></td></tr>
          <tr><td>TAMPILKAN</td><td> :</td><td>
            <select name="jenis" onChange="MM_jumpMenu('parent',this,0)">
            <?php if (!$jenis=='') {
                $jurusan1=$this->db->query("SELECT * FROM web_kelas WHERE kode='".$jenis."' ORDER BY urut ASC");
                foreach ($jurusan1->result() as $row1) {
                $nama1=$row1->nama;
                }
              ?>

              <option><?php echo $nama1;?></option>
            <?php } else {?>
            <option selected>ALL</option>
            <?php }
            echo "<option value='?yy=$yy&mm=$mm&dd=$dd&jenis='>ALL</option>";
            $jurusan=$this->db->query("SELECT * FROM web_kelas ORDER BY urut ASC");
                    foreach ($jurusan->result() as $row) {
                    $kode=$row->kode;
                    $nama=$row->nama;
                    echo "<option value='?yy=$yy&mm=$mm&dd=$dd&jenis=$kode'>$nama</option>";
            ?>
            <?php } ?>

            </select>
            </td></tr>
          </table>
                <div class="card-body">
                  <p class="card-title">Advanced Table</p>
                  <div class="row">
                    <div class="col-12">
                      <div class="table-responsive" align="left">
                        <?php
                if ($jenis =="ALL") {
                  $carikelas="SELECT * FROM web_kelas ORDER BY urut ASC";
                }elseif($jenis ==""){
                  $carikelas="SELECT * FROM web_kelas ORDER BY urut ASC";
                } else {
                  $carikelas="SELECT * FROM web_kelas WHERE kode='".$jenis."' ORDER BY urut ASC";
                }
                $kelas = $this->db->query($carikelas);
                foreach ($kelas->result() as $rs) {
                  $namakelas=$rs->nama;
                  $kodekelas=$rs->kode;
                  ?>
                  <h2><?php echo $namakelas;?></h2>
                        <table class="table expandable-table" style="width:100%">
                          <thead>
                            <tr>
                              <th>No.</th>
                              <th>Nama</th>
                              <th>Status</th>
                              <th>Ft. Datang</th>
                              <th>datang</th>
                              <th>Ft. Pulang</th>
                              <th>Pulang</th>
                              <th>Keterangan</th>
                            </tr>

                            </thead>
                            <?php
                  $i=0;
                  $siswa = $this->db->query("SELECT * FROM web_siswa WHERE KD_JENIS_KETENAGAAN='$kodekelas' ORDER BY NM_PEGAWAI asc");
                  foreach ($siswa->result() as $rssis) {
                    $i++;
                    $namasiswa=$rssis->NM_PEGAWAI;
                    $kodeabsen=$rssis->absen;
                    $jenispegawai=$rssis->jenispegawai;
                    $cekhari=$rssis->$harike3;
                    //echo 'iki cek '.$cekhari;
                    $skrg="$yy-$mm-$dd";
                    $cek1=$this->db->query("SELECT status,jam,ket FROM web_absen WHERE tgl='$skrg' AND nip='$kodeabsen' AND status=1");
                    $hasilcek1=$cek1->num_rows();
                    $jamcek1='';
                    $jamcek2='';
                    $ketcek1='';
                    $filefotodatang='';
                    $filefotopulang='';
                    if ($jenispegawai ==0) {
                      //cekliburan
                      $cekijin=$this->db->query("SELECT * FROM web_ijin WHERE tgl='$skrg' AND absen='$kodeabsen'");
                      $hasilijin=$cekijin->num_rows();
                      $ceklibur=$this->db->query("SELECT * FROM web_libur WHERE tgl='$skrg'");
                      $hasillibur=$ceklibur->num_rows();
                      if ($hasillibur ==0) {
                        if ($cekhari==6){
                        $kehadiran='LIBUR SEKOLAH';
                        $filefotodatang='';
                        $filefotopulang='';
                        } elseif ($hasilijin != 0){
                        foreach ($cekijin->result() as $rsijin) {
                          $hijin=$rsijin->status;
                          $ketcek1=$rsijin->ket;
                          $cekst=$this->db->query("SELECT * FROM web_status WHERE kd_jenis='".$hijin."'");
                          foreach ($cekst->result() as $rsst) {
                          $kehadiran=$rsst->status;
                          }
                        }
                        } else {
                        if ($hasilcek1 !=0) {
                          $kehadiran='<b>HADIR</b>';
                          $filefotodatang='<img src="'.base_url().'upload/selfie/masuk/'.$kodeabsen.$yy.$mm.$dd.'.jpg" height="100">';
                            $cek2=$this->db->query("SELECT status,jam,ket FROM web_absen WHERE tgl='$skrg' AND nip='$kodeabsen' AND status=2");
                            foreach ($cek2->result() as $rscek2) {
                              $jamcek2=$rscek2->jam;
                              $filefotopulang='<img src="'.base_url().'upload/selfie/pulang/'.$kodeabsen.$yy.$mm.$dd.'.jpg" height="100">';
                            }
                            foreach ($cek1->result() as $rscek1) {
                              $jamcek1=$rscek1->jam;
                              $ketcek1=$rscek1->ket;
                            }
                          } else {
                            $cek7=$this->db->query("SELECT status,jam,ket FROM web_absen WHERE tgl='$skrg' AND nip='$kodeabsen' AND status>=7");
                            $hasilcek7=$cek7->num_rows();
                            if ($hasilcek7 !=0) {
                              foreach ($cek7->result() as $rscek7) {
                                $jamcek1=$rscek7->jam;
                                $ketcek1=$rscek7->ket;
                              }
                              $kehadiran='<b>WFH</b>';
                              $filefotodatang='<img src="'.base_url().'upload/selfie/wfh/'.$kodeabsen.$yy.$mm.$dd.'.jpg" height="100">';
                              //$filefotodatang='';
                              $filefotopulang='';
                            } else {
                            $cek3=$this->db->query("SELECT status,jam,ket FROM web_absen WHERE tgl='$skrg' AND nip='$kodeabsen' AND status>=3 AND status <=6");
                            $hasilcek3=$cek3->num_rows();
                            //echo "SELECT status,jam,ket FROM web_absen WHERE tgl='$skrg' AND nip='$kodeabsen' AND status>=3"."<br>";
                            if ($hasilcek3 !=0) {
                              foreach ($cek3->result() as $rscek3) {
                              $status3=$rscek3->status;
                              $ketcek1=$rscek3->ket;
                              }
                              $cekst=$this->db->query("SELECT * FROM web_status WHERE kd_jenis='".$status3."'");
                              foreach ($cekst->result() as $rsst) {
                                $statusku=$rsst->status;
                              }
                              $kehadiran='<b>'.strtoupper($statusku).'</b>';
                              $filefotodatang='';
                              $filefotopulang='';
                            } else {
                              $kehadiran='TIDAK HADIR';
                              $filefotodatang='';
                              $filefotopulang='';
                            }
                            }
                          }
                        }
                      } else {
                        $kehadiran='LIBUR NASIONAL';
                        $filefotodatang='';
                        $filefotopulang='';
                          foreach ($ceklibur->result() as $rslibur) {
                          $ketcek1=$rslibur->ket;
                          }
                      }

                    } elseif ($jenispegawai='1') {
                      $cekijin=$this->db->query("SELECT * FROM web_ijin WHERE tgl='$skrg' AND absen='$kodeabsen'");
                      $hasilijin=$cekijin->num_rows();
                      if ($hasilijin != 0){
                        foreach ($cekijin->result() as $rsijin) {
                          $hijin=$rsijin->status;
                          $ketcek1=$rsijin->ket;
                          $cekst=$this->db->query("SELECT * FROM web_status WHERE kd_jenis='".$hijin."'");
                          foreach ($cekst->result() as $rsst) {
                          $kehadiran=$rsst->status;
                          }
                        }
                        }
                      elseif ($hasilcek1 !=0) {
                        $kehadiran='<b>HADIR</b>';
                        $filefotodatang='<img src="'.base_url().'upload/selfie/masuk/'.$kodeabsen.$yy.$mm.$dd.'.jpg" height="100">';
                        
                        foreach ($cek1->result() as $rscek1) {
                          $jamcek1=$rscek1->jam;
                          $ketcek1=$rscek1->ket;
                        }
                      }
                      $cek2=$this->db->query("SELECT status,jam,ket FROM web_absen WHERE tgl='$skrg' AND nip='$kodeabsen' AND status=2");
                      foreach ($cek2->result() as $rscek2) {
                        $jamcek2=$rscek2->jam;
                        $filefotopulang='<img src="'.base_url().'upload/selfie/pulang/'.$kodeabsen.$yy.$mm.$dd.'.jpg" height="100">';
                      }
                      
                    }

                    ?>
                    <tr>
                    <td class="coba"><?php echo $i;?>.</td>
                    <td class="coba"><a href="detail/?<?php echo "dd=$dd&mm=$mm&yy=$yy&absen=$kodeabsen";?>"><?php echo balikin($namasiswa);?></a></td>
                    <td><?php echo $kehadiran;?></td>
                    <td><?php echo $filefotodatang;?></td>
                    <td><?php echo $jamcek1;?></td>
                    <td><?php echo $filefotopulang;?></td>
                    <td><?php echo $jamcek2;?></td>
                    <td><?php echo $ketcek1;?></td>
                    </tr>
                  <?php }?>
                      </table>
                      <?php
                }
              ?>
                      </div>
                    </div>
                  </div>
                  </div>
                </div>
              </div>
            </div>
        </div>
        <!-- content-wrapper ends -->
        <!-- partial:partials/_footer.html -->
        <footer class="footer">
          <div class="d-sm-flex justify-content-center justify-content-sm-between">
            <span class="text-muted text-center text-sm-left d-block d-sm-inline-block">Copyright © 2021.  Premium <a href="https://www.bootstrapdash.com/" target="_blank">Bootstrap admin template</a> from BootstrapDash. All rights reserved.</span>
            <span class="float-none float-sm-right d-block mt-1 mt-sm-0 text-center">Hand-crafted & made with <i class="ti-heart text-danger ml-1"></i></span>
          </div>
        </footer>
        <!-- partial -->
      </div>
      <!-- main-panel ends -->
    </div>
    <!-- page-body-wrapper ends -->
  </div>
  <!-- container-scroller -->

  <!-- plugins:js -->
  <script src="<?php echo base_url('assets/frontend2/vendors/js/vendor.bundle.base.js');?>"></script>
  <!-- endinject -->
  <!-- Plugin js for this page -->
  <script src="<?php echo base_url('assets/frontend2/vendors/chart.js/Chart.min.js');?>"></script>
  <script src="<?php echo base_url('assets/frontend2/vendors/datatables.net/jquery.dataTables.js');?>"></script>
  <script src="<?php echo base_url('assets/frontend2/vendors/datatables.net-bs4/dataTables.bootstrap4.js');?>"></script>
  <script src="<?php echo base_url('assets/frontend2/js/dataTables.select.min.js');?>"></script>

  <!-- End plugin js for this page -->
  <!-- inject:js -->
  <script src="<?php echo base_url('assets/frontend2/js/off-canvas.js');?>">></script>
  <script src="<?php echo base_url('assets/frontend2/js/hoverable-collapse.js');?>"></script>
  <script src="<?php echo base_url('assets/frontend2/js/template.js');?>"></script>
  <script src="<?php echo base_url('assets/frontend2/js/settings.js');?>"></script>
  <script src="<?php echo base_url('assets/frontend2/js/todolist.js');?>"></script>
  <!-- endinject -->
  <!-- Custom js for this page-->
  <script src="<?php echo base_url('assets/frontend2/js/dashboard.js');?>"></script>
  <script src="<?php echo base_url('assets/frontend2/js/Chart.roundedBarCharts.js');?>"></script>
  <!-- End custom js for this page-->
</body>

</html>

