Exemplo n.º 1
0
 public function getKelasWall($kelas_id, $ta, $begin = 0, $filter = "all")
 {
     $kelas = new Kelas();
     $kelas->getByID($kelas_id);
     $limit = $this->limit;
     $wall = new MuridWall();
     //set filter
     $filtext = '';
     if ($filter != "all") {
         $filtext = " AND wall_role = '{$filter}' ";
     }
     $whereClause = "wall_kelas_id = '{$kelas_id}' AND wall_ta_id = '{$ta}' {$filtext} ORDER BY wall_update DESC LIMIT {$begin},{$limit}";
     $selectedColom = "wall_id,wall_from,wall_msg,wall_date,wall_commentcount,wall_role,wall_update";
     $arrWall = $wall->getWhere($whereClause, $selectedColom);
     //get account
     foreach ($arrWall as $m) {
         //account
         $acc = new Account();
         $acc->getByID($m->wall_from);
         $m->acc = $acc;
         //foto
         $target = "kelaswall___" . $m->wall_id;
         $foto = new Fotoajax();
         $arrFoto = $foto->getWhere("photo_target_id = '{$target}' ORDER BY photo_date DESC");
         $m->foto = $arrFoto;
         //last reply
         /*
                     $wr = new MuridWallComment();
                     $wr->getLastCommentByID($m->wall_id);
                    
                     if(isset($wr->cid_admin_id)){
            $accComment = new Account();
            $accComment->getByID($wr->cid_admin_id);
            $wr->acc = $accComment;
                     }           
                     $m->lastComment = $wr;
         * 
         */
     }
     $return['kelas_id'] = $kelas_id;
     $return['webClass'] = __CLASS__;
     $return['method'] = __FUNCTION__;
     $return['arrWall'] = $arrWall;
     $return['kelas'] = $kelas;
     $return['ta'] = $ta;
     $return['filter'] = $filter;
     $return['begin'] = $begin;
     return $return;
 }
 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);
     }
 }
Exemplo n.º 3
0
 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 init()
 {
     $kls = new Kelas();
     $kls->getByID($this->kelas_id);
     //echo $this->kelas_id;
     //pr($kls);
     if ($this->jadwalMPType == "Full") {
         for ($slotID = 0; $slotID < sizeof($this->slotmatapelajaran) - 1; $slotID++) {
             for ($hariID = 1; $hariID <= $this->anzahlSchultag; $hariID++) {
                 for ($klsTingkatanID = 0; $klsTingkatanID < sizeof($this->arrayVonKelastingkatan); $klsTingkatanID++) {
                     $mp_help = $this->getJadwalMatapelajaranNachTagundSlot($klsTingkatanID + 1, $this->tahunajaran, $hariID, $slotID);
                     $this->matapelajaran[$this->slotmatapelajaran[$slotID] . " - " . $this->slotmatapelajaran[$slotID + 1]][$hariID][$this->arrayVonKelastingkatan[$klsTingkatanID]->kelas_name] = $mp_help;
                 }
             }
         }
     }
     if ($this->jadwalMPType == "Weekly") {
         for ($slotID = 0; $slotID < sizeof($this->slotmatapelajaran) - 1; $slotID++) {
             for ($hariID = 1; $hariID <= $this->anzahlSchultag; $hariID++) {
                 $mp_help = $this->getJadwalMatapelajaranNachTagundSlot($this->kelas_id, $this->tahunajaran, $hariID, $slotID);
                 //pr($mp_help);
                 $this->matapelajaran[$this->slotmatapelajaran[$slotID] . " - " . $this->slotmatapelajaran[$slotID + 1]][$hariID][$kls->kelas_name] = $mp_help;
             }
         }
     }
     if ($this->jadwalMPType == "Daily") {
         for ($slotID = 0; $slotID < sizeof($this->slotmatapelajaran) - 1; $slotID++) {
             $mp_help = $this->getJadwalMatapelajaranNachTagundSlot($this->kelas_id, $this->tahunajaran, $this->hari, $slotID);
             $this->matapelajaran[$this->slotmatapelajaran[$slotID] . " - " . $this->slotmatapelajaran[$slotID + 1]] = $mp_help;
         }
     }
     // Hier wird es die Singkatan dari Matapelajaran Resmi dan tidak Resmi ermittelt
     if ($this->jadwalMPType != "Daily") {
         foreach ($this->matapelajaran as $obj1 => $slot) {
             foreach ($slot as $obj2 => $hari) {
                 foreach ($hari as $obj3 => $kelas) {
                     foreach ($kelas as $mp) {
                         if ($mp->jw_type == "mptr") {
                             $mp->namaMatapelajaran = MatapelajaranTidakResmi::getMatapelajaranDescription($mp->jw_mp_id);
                         } else {
                             $mp->namaMatapelajaran = MatapelajaranResmi::getMatapelajaranSingkatan($mp->jw_mp_id);
                             $mp->guruMengajar = new Gurumengajar($mp->jw_mp_id, $mp->jw_kelas_id, $mp->jw_ta_id);
                             $guruID = $mp->guruMengajar->getGuruId();
                             $mp->guru = new Guru();
                             // Hol alle Eigenschaften von Guru
                             $mp->guru->getByID($guruID->mj_guru_id);
                         }
                     }
                 }
             }
         }
     } else {
         foreach ($this->matapelajaran as $obj1 => $slot) {
             foreach ($slot as $mp) {
                 if ($mp->jw_type == "mptr") {
                     $mp->namaMatapelajaran = MatapelajaranTidakResmi::getMatapelajaranDescription($mp->jw_mp_id);
                 } else {
                     $mp->namaMatapelajaran = MatapelajaranResmi::getMatapelajaranSingkatan($mp->jw_mp_id);
                     $mp->guruMengajar = new Gurumengajar($mp->jw_mp_id, $mp->jw_kelas_id, $mp->jw_ta_id);
                     $guruID = $mp->guruMengajar->getGuruId();
                     $mp->guru = new Guru();
                     // Hol alle Eigenschaften von Guru
                     $mp->guru->getByID($guruID->mj_guru_id);
                 }
             }
         }
     }
     //pr($this->matapelajaran);
     //pr( $this->arrayVonKelastingkatan);
     return $this->matapelajaran;
 }