Exemple #1
0
 public function ambilSemuaKelas()
 {
     $kelases = new ArrayObject();
     $ps = $this->connection->prepare("SELECT * FROM kelas");
     $ps->execute();
     $rs = $ps->fetchAll();
     foreach ($rs as $s) {
         $kelas = new Kelas();
         $kelas->setIdKelas($s["id_kelas"]);
         $kelas->setNama($s["nama"]);
         $kelases->append($kelas);
     }
     return $kelases;
 }
 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;
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $rombel = Rombel::find($id);
     $kelas = Kelas::all();
     $guru = Guru::all();
     return View::make('rombel.edit')->with('rombel', $rombel)->with('kelas', $kelas)->with('guru', $guru);
 }
Exemple #4
0
 public function ambilSemuaSiswaDenganKelas()
 {
     $ps = $this->connection->prepare("SELECT siswa.nomor_siswa,siswa.nama as namaSiswa,kelas.id_kelas,kelas.nama as namaKelas\n\t\t\tFROM siswa INNER JOIN kelas on(siswa.id_kelas=kelas.id_kelas)\n                        ORDER BY namaKelas,namaSiswa");
     $ps->execute();
     $rs = $ps->fetchAll();
     $siswas = new ArrayObject();
     foreach ($rs as $s) {
         $siswa = new Siswa();
         $kelas = new Kelas();
         $siswa->setNomorSiswa($s["nomor_siswa"]);
         $siswa->setNama($s['namaSiswa']);
         $kelas->setIdKelas($s["id_kelas"]);
         $kelas->setNama($s["namaKelas"]);
         $siswa->setKelas($kelas);
         $siswas->append($siswa);
     }
     return $siswas;
 }
 public function get_mutasi_siswa_rombel()
 {
     if (Request::ajax()) {
         $setting = Setting::first();
         $awal = Input::get('tahun') . '-' . Input::get('awal');
         $siswa = DB::table('siswa_rombel')->where('kd_rombel', '=', $awal)->join('siswa', 'siswa.nis', '=', 'siswa_rombel.nis');
         $kode = Input::get('awal');
         $kelas = Kelas::find($kode);
         //cari data kelas yang tingkatnya sama dengan data kelas sekarang
         $lain = DB::table('kelas')->where('kelas', '=', $kelas->kelas)->where('kd_kelas', '<>', $kode)->get();
         return View::make('mutasi.siswa_rombel')->with('siswa', $siswa)->with('lain', $lain)->with('setting', $setting)->with('awal', $awal);
     }
 }
 public function cari_tinggal_kelas()
 {
     if (Request::ajax()) {
         $setting = Setting::first();
         $awal = Input::get('tahun') . '-' . Input::get('awal');
         $siswa = DB::select("select a.*,c.* from siswa_rombel a,\n\t\t\tsiswa c where kd_rombel='{$awal}'\n\t\t\tand kd_rombel in(select b.kd_rombel from nilai_ujian b\n                 where b.kd_rombel=a.kd_rombel)\n                 and c.nis=a.nis");
         $kelas = Kelas::find(Input::get('awal'));
         //cari data kelas yang tingkatnya sama dengan data kelas sekarang
         if ($kelas->kelas == '7') {
             $lain = DB::table('kelas')->where('kelas', '=', '8')->get();
         } else {
             if ($kelas->kelas == '8') {
                 $lain = DB::table('kelas')->where('kelas', '=', '9')->get();
             } else {
                 $lain = "";
             }
         }
         if (count($siswa) > 0) {
             return View::make('kenaikan.get_siswa_tinggal')->with('siswa', $siswa)->with('awal', $awal)->with('setting', $setting)->with('lain', $lain);
         } else {
             echo "<div class='alert alert-danger'>Tidak ada data</div>";
         }
     }
 }
    public static function kelasSelector($kelasActual, $urlOnChange)
    {
        $t = time();
        $kelas = new Kelas();
        $arr = $kelas->getWhere("kelas_aktiv=1 ORDER BY kelas_tingkatan ASC, kelas_name ASC", "kelas_id,kelas_name");
        //pr($arr);
        ?>
        <select id="selectkelas_<?php 
        echo $t;
        ?>
" class="form-control">
            <?php 
        foreach ($arr as $n => $kls) {
            if ($kelasActual->kelas_id == $kls->kelas_id) {
                $selected = "selected";
            } else {
                $selected = "";
            }
            ?>
                <option value="<?php 
            echo $kls->kelas_id;
            ?>
" <?php 
            echo $selected;
            ?>
><?php 
            echo $kls->kelas_name;
            ?>
</option>
            <?php 
        }
        ?>
        </select>
        <script type="text/javascript">
            $("#selectkelas_<?php 
        echo $t;
        ?>
").change(function () {
                var slc = $("#selectkelas_<?php 
        echo $t;
        ?>
").val();
                openLw(window.selected_page, "<?php 
        echo $urlOnChange;
        ?>
&klsid=" + slc, "fade");
            });
        </script>
    <?php 
    }
 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 getAllMyKelas()
 {
     global $db;
     $kelas = new Kelas();
     $q = "SELECT kelas_id,kelas_tingkatan,kelas_name,mk_ta_id FROM {$this->table_murid_kelas},{$kelas->table_name} WHERE mk_murid_id = '{$this->murid_id}' AND mk_kelas_id = kelas_id ORDER BY mk_ta_id ASC";
     //echo $q;
     $muridkelas = $db->query($q, 2);
     //pr($muridkelas);
     $newMurid = array();
     foreach ($muridkelas as $databasemurid) {
         $m = new Kelas();
         $m->fill(toRow($databasemurid));
         $newMurid[] = $m;
     }
     return $newMurid;
 }
 /**
 * Returns the data model based on the primary key given in the GET variable.
 * If the data model is not found, an HTTP exception will be raised.
 * @param integer the ID of the model to be loaded
 */
 public function loadModel($id)
 {
     $model = Kelas::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #11
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $rombel = DB::table('rombel')->where('kd_kelas', '=', $id)->count();
     if ($rombel > 0) {
         $html = "<hr><div class='alert alert-danger'>Kelas masih ada relasi dengan data Rombel : <ul>";
         $data = DB::table('rombel')->where('kd_kelas', '=', $id)->get();
         foreach ($data as $row) {
             $html .= "<li>" . $row->kd_rombel . "</li>";
         }
         $html .= "</ul></div>";
         Session::flash('pesan', $html);
         return Redirect::back();
     } else {
         Kelas::find($id)->delete();
         return Redirect::to('admin/kelas')->with('pesan', "<hr><div class='alert alert-info'>\n\t\t\t\t\tData Berhasil dihapus</div>");
     }
 }
 /**
  * @param string kelas
  * @soap
  */
 public function deleteKelas($kelas)
 {
     Kelas::model()->deleteAll("KELAS = '" . $kelas . "'");
 }
 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;
 }
Exemple #14
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $kelas = Kelas::all();
     $setting = Setting::first();
     return View::make('siswa.tambah')->with('kelas', $kelas)->with('setting', $setting);
 }
Exemple #15
0
<?php

/*
 * Created By Eko Budi Susilo
 * Sublime Text
 * CRUD Kelas For Insert, Edit, Delete
 */
ob_flush();
include 'class.Kelas.php';
$kode = htmlspecialchars($_POST['kelas_id']);
$info = htmlspecialchars($_POST['keterangan']);
$jmlkelas = htmlspecialchars($_POST['jumlah']);
$jurusan = $_POST['jurusan_pk'];
$data = new Kelas();
switch ($_GET['p']) {
    case "add":
        $stmt = $data->AddKelas($kode, $info, $jmlkelas, $jurusan);
        header('location:../main.php?m=007');
        break;
    case "edit":
        break;
    case "del":
        $id = htmlspecialchars($_REQUEST['id']);
        $stmt = $data->Delete($id);
        header('location:../main.php?m=007');
        break;
    default:
        echo "Not Founds";
}
ob_end_flush();
Exemple #16
0
 public function data_siswa()
 {
     $kelas = Kelas::all();
     return View::make('web.data_siswa')->with('kelas', $kelas);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $kelas = Kelas::find($id);
     if ($kelas->delete()) {
         return response()->json(array('success' => TRUE));
     }
 }
Exemple #18
0
 public function n_ujian()
 {
     $kelas = Kelas::all();
     $tahun = DB::table('rombel')->groupBy('thn_ajaran')->get();
     $mapel = Mapel::all();
     return View::make('laporan.ujian')->with('kelas', $kelas)->with('tahun', $tahun)->with('mapel', $mapel);
 }
 public function tablemengajar()
 {
     //load ta
     $ta = TahunAjaran::ta();
     //command switch
     $cmd = isset($_GET['cmd']) ? $_GET['cmd'] : "read";
     //edit mj
     if ($cmd == "edit") {
         $guru = new Guru();
         $return = $guru->loadMJGuruSelection($ta);
         $return['method'] = __FUNCTION__;
         $return['webClass'] = __CLASS__;
         //pr($return);
         //die();
         Mold::both("schoolsetup/tablemengajar_selection", $return);
         exit;
     }
     //submit mj
     if ($cmd == "editSubmit") {
         $guru = new Guru();
         $json = $guru->setMengajar();
         die(json_encode($json));
     }
     // edit homeroom
     if ($cmd == "editHr") {
         $guru = new Guru();
         $kelas_id = isset($_GET['kelas_id']) ? $_GET['kelas_id'] : 0;
         if ($kelas_id == 0) {
             die('kelas id must exists');
         }
         $return['hr'] = $guru->getHomeroomFromKelas($ta, $kelas_id);
         //load  guru aktiv
         $guru = new Guru();
         $arrGuru = $guru->getWhere("guru_aktiv = 1 ORDER BY nama_depan ASC", "guru_id,nama_depan");
         $return['hrid'] = $ta . "_" . $kelas_id;
         $return['arrGuru'] = $arrGuru;
         $return['method'] = __FUNCTION__;
         $return['webClass'] = __CLASS__;
         $return['loadid'] = time();
         Mold::both("schoolsetup/tablemengajar_homeroomselect", $return);
         exit;
     }
     //submit hr
     if ($cmd == "editSubmitHr") {
         $guru = new Guru();
         $json = $guru->setHomeroom();
         die(json_encode($json));
     }
     //load all mp aktiv
     $mp = new Matapelajaran();
     $arrMp = $mp->getWhere("mp_aktiv = 1 ORDER BY mp_group ASC,mp_singkatan ASC", "mp_id,mp_name,mp_singkatan,mp_group");
     //load all kelas aktiv
     $kls = new Kelas();
     $arrKelas = $kls->getWhere("kelas_aktiv = 1 ORDER BY kelas_name ASC,kelas_tingkatan ASC", "kelas_id,kelas_name,kelas_tingkatan");
     //pr($arrMp);pr($arrKelas);
     //load guru mengajar
     $guru = new Guru();
     $arrMj = $guru->getTableMengajar($ta);
     //bikin array yang pas
     $group = "";
     $newArr = array();
     $newArrID = array();
     $newArrObject = array();
     $totalPerBag = array();
     $totalPerKelas = array();
     $hrPerKelas = array();
     foreach ($arrMp as $mps) {
         if ($group != $mps->mp_group) {
             $group = $mps->mp_group;
         }
         foreach ($arrKelas as $kl) {
             //get homeroom
             if (!isset($hrPerKelas[$kl->kelas_name])) {
                 $hrPerKelas[$kl->kelas_name] = $guru->getHomeroomFromKelas($ta, $kl->kelas_id);
             }
             if (!isset($totalPerBag[$group][$kl->kelas_name])) {
                 $totalPerBag[$group][$kl->kelas_name] = 0;
             }
             if (!isset($totalPerKelas[$kl->kelas_name])) {
                 $totalPerKelas[$kl->kelas_name] = 0;
             }
             //masukan ke array
             $newArr[$group][$mps->mp_name][$kl->kelas_name] = null;
             //masukan id nya
             $newArrID[$mps->mp_name] = $mps->mp_id;
             $newArrID[$kl->kelas_name] = $kl->kelas_id;
             //save objectnya di array
             $newArrObject[$mps->mp_name] = $mps;
             $newArrObject[$kl->kelas_name] = $kl;
             foreach ($arrMj as $mj) {
                 if ($mps->mp_id == $mj->mj_mp_id && $kl->kelas_id == $mj->mj_kelas_id) {
                     $mj->mp_obj = $mps;
                     $mj->kelas_obj = $kl;
                     $newArr[$group][$mps->mp_name][$kl->kelas_name] = $mj;
                     $totalPerBag[$group][$kl->kelas_name] += $mj->mj_jam;
                     $totalPerKelas[$kl->kelas_name] += $mj->mj_jam;
                 }
             }
         }
         //$newArr[$group][$mps->mp_name]
     }
     //ksort($newArr);
     //pr($newArr);
     //pr($arrMj);
     //pasang ke table
     $return['ta'] = $ta;
     $return['webClass'] = __CLASS__;
     $return['method'] = __FUNCTION__;
     //yang array taruh bawah
     $return['mp'] = $arrMp;
     $return['kelas'] = $arrKelas;
     $return['arrMj'] = $arrMj;
     $return['sortArrMj'] = $newArr;
     $return['totalPerGroup'] = $totalPerBag;
     $return['totalPerKelas'] = $totalPerKelas;
     $return['hrPerKelas'] = $hrPerKelas;
     $return['arrIDs'] = $newArrID;
     $return['arrObjs'] = $newArrObject;
     Mold::both("schoolsetup/tablemengajar", $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);
     }
 }
Exemple #21
0
<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
include_once '/Applications/MAMP/htdocs/isias/classes/class.Kelas.php';
include_once '/Applications/MAMP/htdocs/isias/classes/class.Jurusans.php';
include_once '/Applications/MAMP/htdocs/isias/classes/paginator.class.php';
$jur = new Jurusans();
$n = $jur->countAll();
$data = new Kelas();
$stmt = $data->countAll();
$num_rows = $stmt->rowCount();
if ($num_rows > 0) {
    $pages = new Paginator($num_rows, 19);
    if (isset($_POST['cari'])) {
        $cari = $_POST['cari'];
        $stmt = $data->GetListKelas($pages->limit_start, $pages->limit_end);
    } else {
        $stmt = $data->GetListKelas($pages->limit_start, $pages->limit_end);
    }
}
?>
<div class="container">
    <div class="row">
        <a href="#myModal" role="button" class="btn btn-primary" data-toggle="modal" data-target="#add-Data">Kelas Baru</a>
        <div class="input-prepend pull-right">
            <span class="add-on"><i class="icon-search"></i></span>
            <input class="span2" id="prependedInput" type="text" name="cari" placeholder="Pencarian..">

        </div>