Exemplo n.º 1
0
 public function delFakultas($id)
 {
     $fakul = new Fakultas($this->registry);
     if (is_null($id)) {
         throw new Exception();
         echo "id belum dimasukkan!";
         return;
     }
     $fakul->set_kode_fakul($id);
     $d_fakul = $fakul->get_fakul_by_id($fakul);
     $nama = $d_fakul->get_nama();
     $fakul->delete_fakul();
     ClassLog::write_log('fakultas', 'hapus', $nama);
     header('location:' . URL . 'admin/addFakultas/' . $halaman . "/" . $batas);
 }
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;
                 }
             }
         }
     }
 }