public function getMuridWithoutKelas($tingkatan)
 {
     if ($tingkatan > 0) {
         $acc = new Account();
         $kls = new Kelas();
         global $db;
         /*$q = "SELECT admin_nama_depan,admin_id,murid_id,admin_foto FROM {$this->table_murid_kelas},{$this->table_name},{$acc->table_name} WHERE mk_ta_id = '$ta' AND mk_kelas_id = '$klsid' AND account_id = admin_id AND mk_murid_id = murid_id AND murid_aktiv = '1' ORDER BY mk_no_urut ASC";
           
           $q = "SELECT t1.nama_depan,t1.murid_id,t1.foto
           FROM {$this->table_name} t1,{$kls->table_name} t3
           LEFT JOIN {$this->table_murid_kelas} t2 ON t2.mk_murid_id = t1.murid_id
           WHERE t2.mk_kelas_id = t3.kelas_id AND t t2.mk_murid_id IS NULL AND t";
           */
         $q = "SELECT  admin_nama_depan,admin_id,murid_id,admin_foto,murid_tingkatan\n            FROM    {$this->table_name},{$acc->table_name}\n            WHERE account_id = admin_id AND murid_tingkatan = '{$tingkatan}' AND murid_aktiv = '1' AND  murid_id NOT IN (SELECT mk_murid_id FROM {$this->table_murid_kelas}) ORDER BY admin_nama_depan ASC";
         $muridkelas = $db->query($q, 2);
         $newMurid = array();
         foreach ($muridkelas as $databasemurid) {
             $m = new Murid();
             $m->fill(toRow($databasemurid));
             $newMurid[] = $m;
         }
         return $newMurid;
     } else {
         die('getMuridWithoutKelas butuh tingkatan');
     }
 }
 function test()
 {
     //echo "hello";
     $m = new Murid();
     $m->getByID(699);
     echo json_encode($m);
 }
 public function myAbsensiWidget()
 {
     $murid = new Murid();
     $murid->default_read_coloms = "*";
     $murid->getByAccountID(Account::getMyID());
     $mon = Absensi::getBulan();
     $year = Absensi::getTahun();
     $abs = new Absensi();
     $murid->absensi = $abs->getAbsensiEinzel($murid->murid_id, $mon, $year);
     $return['webClass'] = __CLASS__;
     $return['method'] = __FUNCTION__;
     $return['murid'] = $murid;
     $return['absensi'] = $murid->absensi;
     $return['mon'] = $mon;
     $return['year'] = $year;
     $return['ta'] = TahunAjaran::ta();
     //ambil kejadian dlm bulan
     //$cal = new Calendar();
     //$return['calendar'] = $cal->getCalinMonth(Absensi::getBulan());
     $return['refreshID'] = "myAbsensiWidget";
     // get number of day dlm sebulan
     //$num_of_days = cal_days_in_month(CAL_GREGORIAN, $mon, $year);
     //$return["numDays"] = $num_of_days;
     Mold::both("murid/absensi_widget", $return);
 }
Example #4
0
 public function overwriteRead($return)
 {
     $objs = $return['objs'];
     foreach ($objs as $obj) {
         if (is_numeric($obj->ctu_supplier_id)) {
             $murid = new Murid();
             $murid->getByID($obj->ctu_supplier_id);
             $obj->ctu_supplier_id = $murid->nama_depan;
         }
     }
     //pr($return);
     return $return;
 }
    public function edit_nilaiku()
    {
        $murid = new Murid();
        $murid->getByID(700);
        $form = '
<form>
    <input type="text" placeholder="nilai">
</form>    ';
        $name = "Efindi";
        $id = 10;
        $jsonArray = array("form" => $form, "name" => $name, "id" => $id, "murid" => $murid);
        echo json_encode($jsonArray);
    }
 public function insertNilai()
 {
     //ambil tahun ajaran utk absensinya
     $ta = TahunAjaran::ta();
     $id = isset($_GET['klsid']) ? addslashes($_GET['klsid']) : Kelas::getFirstKelasID();
     $kls = new Kelas();
     $kls->getByID($id);
     $mp_id = isset($_GET['mp_id']) ? addslashes($_GET['mp_id']) : Matapelajaran::getFirstMPID();
     $mp = new Matapelajaran();
     $mp->getByID($mp_id);
     // utk insert ke db
     $cmd = $_GET['cmd'];
     $murid_id = $_GET['murid_id'];
     $matapelajaranID = $_GET['matapelajaranID'];
     $kelas_id = $_GET['kelas_id'];
     $nilaiUjian = $_GET['nilaiUjian'];
     $tglUjian = $_GET['tglUjian'];
     $jenisUjian = $_GET['jenisUjian'];
     //amnbil murid dikelas
     $murid = new Murid();
     $arrOfMurid = $murid->getMuridDiKelas($kls, $ta);
     $nilai = new Nilai($ta, $arrOfMurid, $mp_id, $id);
     if ($cmd == "insert") {
         $nilai->insertTanggalUjian($murid_id, $matapelajaranID, $nilaiUjian, $tglUjian, "Daily", $ta, $kelas_id);
         $_GET['cmd'] = "";
         Mold::both("studentsetup/insertnilai", $return);
     } else {
         $return = $nilai->getNilaiKelasSortNachDatum();
         $return['webClass'] = __CLASS__;
         $return['method'] = __FUNCTION__;
         $return['ta'] = $ta;
         $return['kls'] = $kls;
         $return['mp'] = $mp;
         $return['murid'] = $arrOfMurid;
         $return['nilai'] = $nilai;
         Mold::both("studentsetup/insertnilai", $return);
     }
 }
 public static function getMyKelas($ta)
 {
     $kelas = isset($_SESSION['myKelas' . $ta]->kelas_id) ? $_SESSION['myKelas' . $ta] : 'no';
     if ($kelas == 'no') {
         //kalau belum punya kelas
         $murid = new Murid();
         $murid->default_read_coloms = "murid_id,nama_depan,foto";
         $murid->getByAccountID(Account::getMyID());
         $kelas = $murid->getMyKelas($ta);
         $_SESSION['myKelas' . $ta] = $kelas;
     }
     return $kelas;
 }
 function isikelas()
 {
     $id = addslashes($_GET['id']);
     if ($id == "") {
         die;
     }
     global $db;
     $ta = TahunAjaran::ta();
     $kelas = new Kelas();
     $kelas->getByID($id);
     $murid = new Murid();
     $arrMuridinClass = $murid->getMuridDiKelas($kelas, $ta);
     $t = time();
     $return['method'] = __FUNCTION__;
     $return['webClass'] = __CLASS__;
     $return['arrMuridinClass'] = $arrMuridinClass;
     $return['id'] = $id;
     $return['kelas'] = $kelas;
     Mold::both("inbox/isikelas", $return);
 }
 public function myJadwal()
 {
     //pr($_SESSION);
     //ambil tahun ajaran utk Matapelajaran
     $ta = TahunAjaran::ta();
     $murid = new Murid();
     $murid->default_read_coloms = "*";
     $murid->getByAccountID(Account::getMyID());
     $kls = $murid->getMyKelas($ta);
     $cmd = isset($_GET['cmd']) ? $_GET['cmd'] : "read";
     $id = $kls->kelas_id;
     $tag = date("N");
     $jadwalMatapelajaran = new Jadwalmatapelajaran($id, $ta, "Weekly", "");
     // pr($jadwalMatapelajaran);
     $return['webClass'] = __CLASS__;
     $return['method'] = __FUNCTION__;
     $return['ta'] = $ta;
     $return['kls'] = $kls;
     $jadwalMatapelajaran->init();
     $return['jadwalMatapelajaran'] = $jadwalMatapelajaran;
     //Mold::both("studentsetup/jadwalmatapelajaran",  $jadwalMatapelajaran);
     //Mold::both("studentsetup/jadwalmatapelajaranDaily",  $jadwalMatapelajaran);
     Mold::both("studentsetup/jadwalmatapelajaranWeekly", $return);
 }