Exemplo n.º 1
0
 public function updJurusan()
 {
     $jur = new Jurusan($this->registry);
     $kd_jur = $_POST['kd_jur'];
     $fak = $_POST['fakultas'];
     $strata = $_POST['strata'];
     $nama = $_POST['nama'];
     $alamat = $_POST['alamat'];
     $telepon = $_POST['telepon'];
     $pic_jur = $_POST['pic_jur'];
     $telp_pic_jur = $_POST['telp_pic_jur'];
     $status = $_POST['status'];
     $jur->set_kode_fakul($fak);
     $jur->set_kode_strata($strata);
     $jur->set_nama($nama);
     $jur->set_alamat($alamat);
     $jur->set_telepon($telepon);
     $jur->set_pic($pic_jur);
     $jur->set_telp_pic($telp_pic_jur);
     $jur->set_status($status);
     $jur->set_kode_jur($kd_jur);
     if (!$jur->update_jurusan()) {
         $fakul = new Fakultas($this->registry);
         $strata = new Strata();
         $this->view->d_ubah = $jur;
         $this->view->error = $jur->get_error();
         $this->view->fakul = $fakul->get_fakul();
         $this->view->strata = $strata->get_All();
         $this->view->data = $jur->get_jurusan();
         $this->view->render('admin/jurusan');
     } else {
         ClassLog::write_log('jurusan', 'ubah', $nama);
         header('location:' . URL . 'admin/addJurusan');
     }
 }
Exemplo n.º 2
0
 private function get_data_buku()
 {
     $d_st = $this->get_list_kode_st(true);
     $now = date('Y-m');
     $now .= "-1";
     $next_month = date('Y-m-d', strtotime('+1 MONTH', strtotime($now)));
     foreach ($d_st as $st) {
         $kd_st = $st['KD_ST'];
         //            print_r($kd_st);
         $d_bulan = $this->get_bulan_surat_tugas($kd_st, true);
         //            print_r($d_bulan);
         foreach ($d_bulan as $bulan) {
             $cek_proses = $this->cek_telah_bayar_elem(2, $bulan, $kd_st);
             //                echo $bulan; var_dump($cek_proses);
             $cek_bayar = $this->cek_telah_bayar_elem(2, $bulan, $kd_st, true);
             $tmp = explode("-", $bulan);
             $month = $tmp[1] == 1 ? 3 : 9;
             $tanggal_akhir = date('Y-m-d', strtotime($tmp[0] . "-" . $month . "-1"));
             //                var_dump(date('Y-m-d',$tanggal_akhir));
             $cek_bulan = strtotime($tanggal_akhir) == strtotime($next_month);
             if ($cek_proses) {
                 if (!$cek_bayar) {
                     $notif = $this->get_data_buku_by_st($kd_st, $bulan);
                     $notif->set_link($bulan);
                     $notif->set_status_notif('proses');
                     //                        echo $kd_st."-".$bulan."-".$notif->get_jenis_notif()."-".$notif->get_jurusan()."-".$notif->get_tahun_masuk()."-".$notif->get_univ()."-".$notif->get_status_notif()."</br>";
                     //                        print_r($notif);
                     $this->_notif_data[] = $notif;
                 }
             } else {
                 $notif = new NotifikasiDao();
                 $st = new SuratTugas($this->registry);
                 $st->set_kd_st($kd_st);
                 $d_st = $st->get_surat_tugas_by_id($st);
                 $notif->set_jatuh_tempo($bulan);
                 $notif->set_jenis_notif('buku');
                 /** jurusan **/
                 $jur = new Jurusan($this->registry);
                 $jur->set_kode_jur($d_st->get_jur());
                 $d_jur = $jur->get_jur_by_id($jur);
                 $notif->set_jurusan($d_jur->get_nama());
                 $notif->set_kode_link('');
                 $notif->set_link($bulan);
                 $notif->set_status_notif('belum');
                 $notif->set_tahun_masuk($d_st->get_th_masuk());
                 /** universitas **/
                 $fakul = new Fakultas($this->registry);
                 $fakul->set_kode_fakul($d_jur->get_kode_fakul());
                 $d_fakul = $fakul->get_fakul_by_id($fakul);
                 $univ = new Universitas($this->registry);
                 $univ->set_kode_in($d_fakul->get_kode_univ());
                 $d_univ = $univ->get_univ_by_id($univ);
                 $notif->set_univ($d_univ->get_kode());
                 /** pic **/
                 $pic = new User($this->registry);
                 $d_pic = $pic->getUser_id($d_univ->get_pic());
                 $pic_arr = array('kode' => $d_pic->get_id(), 'nama' => $d_pic->get_nmUser(), 'foto' => $d_pic->get_foto());
                 $notif->set_pic($pic_arr);
                 //
                 if ($cek_bulan) {
                     $is_notif = $this->is_write_notif('buku', $tanggal_akhir);
                     if ($is_notif) {
                         //                            echo $kd_st."-".$bulan."-".$notif->get_jenis_notif()."-".$notif->get_jurusan()."-".$notif->get_tahun_masuk()."-".$notif->get_univ()."-".$notif->get_status_notif()."</br>";
                         $this->_notif_data[] = $notif;
                     }
                 } else {
                     //                        echo $kd_st."-".$bulan."-".$notif->get_jenis_notif()."-".$notif->get_jurusan()."-".$notif->get_tahun_masuk()."-".$notif->get_univ()."-".$notif->get_status_notif()."</br>";
                     $this->_notif_data[] = $notif;
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 /**
  * 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 = Fakultas::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 4
0
                    <div class="mcb_Con">
                        <?php 
    foreach ($fakultas as $fakultas_1) {
        ?>
                            <div class="mcbrow" id="jobDialog1">
                                <ul>
                                    <li class="gtcol1" onclick="details('<?php 
        echo $fakultas_1->id;
        ?>
');" style="cursor:pointer;">

                                        <?php 
        echo $fakultas_1->kode_fakultas . ' - ' . $fakultas_1->nama_fakultas;
        ?>
                                        <?php 
        $fakultas = Fakultas::model()->findByAttributes(array('id' => $fakultas_1->id, 'is_deleted' => 0));
        $programstudi = ProgramStudi::model()->findAll("id_fakultas=:x AND is_deleted=:y", array(':x' => $fakultas_1->id, ':y' => 0));
        ?>
                                        <span><?php 
        echo count($programstudi);
        ?>
 - Program Studi</span>
                                    </li>
                                    <li class="col2">
                                        <?php 
        echo CHtml::ajaxLink(Yii::t('Fakultas', 'Ubah'), $this->createUrl('fakultas/Edit'), array('onclick' => '$("#jobDialog11").dialog("open"); return false;', 'update' => '#jobDialog1', 'type' => 'GET', 'data' => array('val1' => $fakultas_1->id), 'dataType' => 'text'), array('id' => 'showJobDialog123' . $fakultas_1->id, 'class' => 'edit'));
        ?>
                                    </li>
                                    <li class="col3">
                                        <?php 
        echo CHtml::link(Yii::t('Fakultas', 'Hapus'), array('deactivate', 'id' => $fakultas_1->id), array('confirm' => "Apakah anda yakin ingin menghapus data ini?", 'class' => 'delete'));