$this_day = date('Y-m-d'); $obj_absen = Absents::get_instance()->_get($this_day, $obj_people->getId()); !is_null($obj_absen->getStatus()) || $obj_absen->setStatus(Absents::status_tidak_masuk); if ($is_absen_mulai) { $obj_absen->setDate($this_day)->setPeopleId($obj_people->getId())->setWorktimeStart(date('H:i:s'))->setStatus(Absents::status_masuk); lrs_redirect(LRS_URI_PATH . DS . $tingkat1 . DS . $tingkat2 . '?status=' . (Absents::get_instance()->_update($obj_absen) ? 1 : 999)); } elseif ($is_absen_berhenti) { $obj_absen->setWorktimeEnd(date('H:i:s'))->setStatus(Absents::status_selesai); lrs_redirect(LRS_URI_PATH . DS . $tingkat1 . DS . $tingkat2 . '?status=' . (Absents::get_instance()->_update($obj_absen) ? 2 : 999)); } elseif ($is_absen_berhenti_sebelum_waktunya) { $obj_absen->setWorktimeEnd(date('H:i:s'))->setStatus(Absents::status_izin_pulang)->setNote($_REQUEST['note']); lrs_redirect(LRS_URI_PATH . DS . $tingkat1 . DS . $tingkat2 . '?status=' . (Absents::get_instance()->_update($obj_absen) ? 3 : 999)); } $default_params = array('range_date_start' => '', 'range_date_end' => '', 'number' => 10, 'page' => 1); $list_params = sync_default_params($default_params, $_GET); $hari_libur = json_decode(Options::get_instance()->get_option('hari_libur', array()), true); Headers::get_instance()->set_page_title('Absen')->set_page_name('Absen')->set_page_sub_name($is_absen_histori ? 'Histori' : 'Absen'); Contents::get_instance()->get_header(); ?> <div class="container-fluid"> <div class="row"> <div class="col-xs-3 col-sm-2 sidebar"> <?php Contents::get_instance()->get_sidebar(); ?> </div> <div class="col-xs-9 col-sm-10 main"> <?php if ($is_absen_histori) {
use LRS\OfficeServer\Controller\Headers; use LRS\OfficeServer\Controller\Sessions; use LRS\OfficeServer\Controller\Options; use LRS\OfficeServer\Controller\Helpers; use LRS\OfficeServer\Controller\Routes; $status = isset($_REQUEST[Helpers::status_param]) ? $_REQUEST[Helpers::status_param] : ''; $tingkat1 = Routes::get_instance()->get_tingkat(1); $tingkat2 = Routes::get_instance()->get_tingkat(2); $is_simpan = Routes::get_instance()->is_tingkat(2, Helpers::aksi_simpan); if ($is_simpan) { Options::get_instance()->set_option('hari_libur', mysql_real_escape_string(json_encode($_REQUEST['hari_libur']))); Options::get_instance()->set_option('durasi_kerja', $_REQUEST['durasi_kerja']); lrs_redirect(LRS_URI_PATH . DS . $tingkat1 . DS . '?status=2'); } $hari_libur = json_decode(Options::get_instance()->get_option('hari_libur', array()), true); $durasi_kerja = Options::get_instance()->get_option('durasi_kerja', 0); $obj_people = Sessions::get_instance()->_retrieve()->getObjPeople(); $days_a_week_lists = array(1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday'); Headers::get_instance()->set_page_title('Admin')->set_page_name('Admin'); Contents::get_instance()->get_header(); ?> <div class="container-fluid"> <div class="row"> <div class="col-xs-3 col-sm-2 sidebar"> <?php Contents::get_instance()->get_sidebar(); ?> </div> <div class="col-xs-9 col-sm-10 main">