public function overwriteForm($return, $returnfull) { for ($x = 1; $x <= Schoolsetting::getTingkatanMax(); $x++) { $arr[$x] = $x; } $return['kelas_tingkatan'] = new Leap\View\InputSelect($arr, "kelas_tingkatan", "kelas_tingkatan", $this->kelas_tingkatan); $return['kelas_foto'] = new Leap\View\InputText("hidden", "kelas_foto", "kelas_foto", $this->kelas_foto); $return['kelas_aktiv'] = new Leap\View\InputSelect(array('0' => 0, '1' => 1), "kelas_aktiv", "kelas_aktiv", $this->kelas_aktiv); return $return; }
function login() { $username = addslashes($_POST["admin_username"]); $password = addslashes($_POST["admin_password"]); $rememberme = isset($_POST["rememberme"]) ? 1 : 0; $row = array("admin_username" => $username, "admin_password" => $password, "rememberme" => $rememberme); //login pakai row credential Auth::login($row); //kalau sukses if (Auth::isLogged()) { //load school setting $ss = new Schoolsetting(); $ss->loadToSession(); //redirect Account::setRedirection(); } else { Redirect::loginFailed(); } }
public function setJadwalMP() { $mp = isset($_GET['mp']) ? addslashes($_GET['mp']) : die('mp_id empty'); list($mp_type, $mp_id) = explode("_", $mp); $kls_id = isset($_GET['kls_id']) ? addslashes($_GET['kls_id']) : die('kls_id empty'); $slotID = isset($_GET['slotID']) ? addslashes($_GET['slotID']) : die('slotID empty'); $day = isset($_GET['day']) ? addslashes($_GET['day']) : die('day empty'); $ta = TahunAjaran::ta(); //elroy : ini di query langsung... $id = $day . "_" . $slotID . "_" . $kls_id . "_" . $ta; global $db; //cari slot jam mulai dan end $jdwltext = Schoolsetting::getJamPelajaran(); $arrSlot = explode(",", $jdwltext); foreach ($arrSlot as $num => $val) { if ($num == $slotID) { $begin = $val; } if ($num == $slotID + 1) { $end = $val; } } $q = "INSERT INTO ry_sekolah__jadwalmp SET\n jw_id= '{$id}',\n jw_kelas_id = '{$kls_id}',\n jw_mp_id = '{$mp_id}',\n jw_slot_id = '{$slotID}',\n jw_mulai= '{$begin}',\n jw_end= '{$end}',\n jw_ta_id = '{$ta}',\n jw_hari_id = '{$day}',\n jw_type = '{$mp_type}'\n ON DUPLICATE KEY UPDATE jw_type = '{$mp_type}',jw_mp_id = '{$mp_id}'"; $jd = $db->query($q, 0); //pr($jd); //$jd->save(); }
Selection::monthSelectorInTA($mon, $ta, $urlOnChange); ?> </div> </div> <?php //Mold::both("studensetup/absensi_legends",array("numDays"=>$numDays,"mon"=>$mon,"year"=>$year,"calendar"=>$calendar,"arrCl"=>$arrCl,"arrMacemAbsens"=>$arrMacemAbsens)); $cale = new Calendar(); $arrCl = $cale->arrCl; $abs = new Absensi(); $arrMacemAbsens = $abs->arrMacamAbsen; $limithari = 5; if (Schoolsetting::apaSabtuMasuk()) { $limithari = 6; } if (Schoolsetting::apaMingguMasuk()) { $limithari = 7; } ?> <style> .absennama { font-size: 15px; font-weight: bold; } .absenmasuk { background-color: #c1e2b3; } .absenabsen { background-color: #dFb5b4;
public static function levelSelector($levelActual, $urlOnChange) { $t = time(); ?> <select id="selectlevel_<?php echo $t; ?> " class="form-control"> <?php for ($x = 1; $x <= Schoolsetting::getTingkatanMax(); $x++) { if ($levelActual == $x) { $selected = "selected"; } else { $selected = ""; } ?> <option value="<?php echo $x; ?> " <?php echo $selected; ?> ><?php echo $x; ?> </option> <?php } ?> </select> <script type="text/javascript"> $("#selectlevel_<?php echo $t; ?> ").change(function () { var slc = $("#selectlevel_<?php echo $t; ?> ").val(); openLw(window.selected_page, "<?php echo $urlOnChange; ?> &klslevel=" + slc, "fade"); }); </script> <?php }
public function satukanEffDay($arrFirstDays, $arrHolidays, $arrRestDays) { //get actual tahun ajaran $ta = TahunAjaran::taInArray(); $jul = TahunAjaran::$bulanMulaiTA; $jun = $jul - 1; $returnArray = array(); $returnArray = self::verteiltDatum($arrFirstDays, $returnArray); $returnArray = self::verteiltDatum($arrHolidays, $returnArray); $returnArray = self::verteiltDatum($arrRestDays, $returnArray); // pr($returnArray); $strDateFrom = $ta[0] . "-0" . $jul . "-01"; $strDateTo = $ta[1] . "-0" . $jun . "-30"; $arrAllDates = TahunAjaran::createDateRangeArray($strDateFrom, $strDateTo); //apakah weekend masuk?? $arrWeekDay = array(1, 2, 3, 4, 5); //1 mon 5 fri if (Schoolsetting::apaSabtuMasuk()) { $arrWeekDay[] = 6; } if (Schoolsetting::apaMingguMasuk()) { $arrWeekDay[] = 7; } $newArr = array(); $newArrBulanan = array(); $cntEffDaySem = array(0, 0, 0, 0, 0); $cntTotalEffDay = 0; $semester = 0; $firstdayID = 0; $seconddayID = 0; $lastdayID = 0; foreach ($arrAllDates as $dtInMonth) { $insertArr = array(); $insertArr["type"] = array(); //set type as array $insertArr["eff"] = 0; //set eff day as 0 // check kl ada firstdays di tanggal2 ini if (isset($returnArray[$dtInMonth])) { $insertArr["activities"] = $returnArray[$dtInMonth]; //masukan jenis harinya foreach ($returnArray[$dtInMonth] as $act) { if (strstr($act->cal_id, "1stday")) { $insertArr["type"][] = "1stday"; $semester = 1; $firstdayID = $act->cal_id; } if (strstr($act->cal_id, "2ndday")) { $insertArr["type"][] = "2ndday"; $semester = 2; $seconddayID = $act->cal_id; } if (strstr($act->cal_id, "akhir")) { $insertArr["type"][] = "akhir"; $semester = 3; $insertArr["eff"] = 1; $lastdayID = $act->cal_id; } $insertArr["type"][] = $act->cal_type; } } //cari jenis hari list($tahun, $bulan, $hari) = explode("-", $dtInMonth); $jenishari = date("N", mktime(0, 0, 0, $bulan, $hari, $tahun)); $insertArr["jenishari"] = $jenishari; if (!in_array($jenishari, $arrWeekDay)) { $insertArr["type"][] = "weekend"; } //hitung counter if (in_array("holiday", $insertArr['type']) || in_array("weekend", $insertArr['type'])) { } else { $cntEffDaySem[$semester]++; //$cntTotalEffDay++; if ($semester > 0 && $semester < 3) { $insertArr["eff"] = 1; } } //cari bulanan $jenisbulan = date("n", mktime(0, 0, 0, $bulan, $hari, $tahun)); $newArrBulanan[$jenisbulan][$dtInMonth] = $insertArr; //harian $newArr[$dtInMonth] = $insertArr; } //totalnya di jumplah $cntTotalEffDay = $cntEffDaySem[1] + $cntEffDaySem[2]; $newArr['TotalEffDay'] = $cntTotalEffDay; $newArr['EffDaySem'] = $cntEffDaySem; $newArr['EffDay1'] = $cntEffDaySem[1]; $newArr['EffDay2'] = $cntEffDaySem[2]; $arrAwal = array("first" => $firstdayID, "second" => $seconddayID, "akhir" => $lastdayID); ksort($newArr); //pr($newArr); //pr($newArrBulanan); return array("harian" => $newArr, "bulanan" => $newArrBulanan, "awal" => $arrAwal); }