Esempio n. 1
0
 public function get_penerima_by_name($pb = Penerima, $kd_user = 0, $filter_st = false)
 {
     $sql = "SELECT * FROM " . $this->_tb_penerima;
     $sql .= " a LEFT JOIN r_jur b ON a.KD_JUR=b.KD_JUR\r\n                LEFT JOIN r_fakul c ON b.KD_FAKUL=c.KD_FAKUL\r\n                LEFT JOIN r_univ d ON c.KD_UNIV=d.KD_UNIV ";
     $sql .= " WHERE NM_PB LIKE '%" . $pb->get_nama() . "%'";
     if ($kd_user != 0) {
         $sql .= " AND d.KD_USER="******" AND a.KD_ST=" . $pb->get_st();
     }
     $result = $this->db->select($sql);
     $data = array();
     foreach ($result as $val) {
         $penerima = new $this($this->registry);
         $st = new SuratTugas($this->registry);
         $st->set_kd_st($val['KD_ST']);
         $d_st = $st->get_surat_tugas_by_id($st, $kd_user);
         if ($kd_user == 0) {
             $d_st = $st->get_surat_tugas_by_id($st);
         }
         $tglmulsel = $d_st->get_tgl_mulai() . ";" . $d_st->get_tgl_selesai();
         $penerima->set_kd_pb($val['KD_PB']);
         $penerima->set_st($tglmulsel);
         $jur = new Jurusan($this->registry);
         $jur->set_kode_jur($val['KD_JUR']);
         $d_jur = $jur->get_jur_by_id($jur);
         $nm_jur = $d_jur->get_nama();
         $penerima->set_jur($nm_jur);
         $penerima->set_bank($val['KD_BANK']);
         $stb = new Status();
         $d_stb = $stb->get_by_id($val['KD_STS_TB']);
         $penerima->set_status($d_stb->nm_status);
         $penerima->set_nip($val['NIP_PB']);
         $penerima->set_nama($val['NM_PB']);
         $penerima->set_jkel($val['JK_PB']);
         $penerima->set_gol($val['KD_GOL']);
         $penerima->set_unit_asal($val['UNIT_ASAL_PB']);
         $penerima->set_email($val['EMAIL_PB']);
         $penerima->set_telp($val['TELP_PB']);
         $penerima->set_alamat($val['ALMT_PB']);
         $penerima->set_no_rek($val['NO_REKENING_PB']);
         $penerima->set_foto($val['FOTO_PB']);
         $penerima->set_tgl_lapor($val['TGL_LAPOR_PB']);
         $penerima->set_skl($val['NO_SKL_PB']);
         $penerima->set_spmt($val['NO_SPMT_PB']);
         $penerima->set_skripsi($val['JUDUL_SKRIPSI_PB']);
         $data[] = $penerima;
     }
     return $data;
 }
Esempio 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;
                 }
             }
         }
     }
 }
 public function addpb($id)
 {
     $st = new SuratTugas($this->registry);
     $pb = new Penerima($this->registry);
     $univ = new Universitas($this->registry);
     $bank = new Bank($this->registry);
     $st->set_kd_st($id);
     $pb->set_st($id);
     $this->view->kd_st = $id;
     $this->view->d_bank = $bank->get_bank();
     $this->view->d_univ = $univ->get_univ();
     if (Session::get('role') == 2) {
         $this->view->d_st = $st->get_surat_tugas_by_id($st, $this->kd_user);
         $this->view->d_pb = $pb->get_penerima_by_st($pb, $this->kd_user);
     } else {
         $this->view->d_st = $st->get_surat_tugas_by_id($st);
         $this->view->d_pb = $pb->get_penerima_by_st($pb);
     }
     $this->view->d_th_masuk = $st->get_list_th_masuk();
     //        var_dump($this->view->d_st);
     $this->view->render('riwayat_tb/pb_to_st');
 }
 public function cetak_profil($id)
 {
     $pb = new Penerima($this->registry);
     //mendapatkan informasi pb
     $st = new SuratTugas($this->registry);
     //mendapatkan informasi surat tugas
     $el = new ElemenBeasiswa($this->registry);
     //mendapatkan pembayaran
     $bank = new Bank($this->registry);
     //mendapatkan nama bank
     $jst = new JenisSuratTugas($this->registry);
     //mendapatkan jenis surat tugas
     $jur = new Jurusan($this->registry);
     $univ = new Universitas($this->registry);
     $nilai = new Nilai($this->registry);
     $cuti = new Cuti($this->registry);
     $mas = new MasalahPenerima($this->registry);
     $pemb = new PemberiBeasiswa();
     $beaya = new Biaya();
     $role = Session::get('role');
     $pb->set_kd_pb($id);
     $this->view->d_pb = $pb->get_penerima_by_id($pb, $this->kd_user);
     if ($role == 3) {
         $this->view->d_pb = $pb->get_penerima_by_id($pb);
     }
     $st->set_kd_st($this->view->d_pb->get_st());
     $this->view->d_st = $st->get_surat_tugas_by_id($st, $this->kd_user);
     if ($role == 3) {
         $this->view->d_st = $st->get_surat_tugas_by_id($st);
     }
     $pemb = $pemb->get_by_id($this->view->d_st->get_pemberi());
     $this->view->d_pemb = $pemb->nama_pemberi;
     $this->view->d_bank = $bank->get_bank_id($this->view->d_pb->get_bank());
     $jur->set_kode_jur($this->view->d_pb->get_jur());
     $this->view->d_jur = $jur->get_jur_by_id($jur);
     $jst->set_kode($this->view->d_st->get_jenis_st());
     $this->view->d_jst = $jst->get_jst_by_id($jst);
     $this->view->d_univ = $univ->get_univ_by_jur($this->view->d_jur->get_kode_jur());
     $this->view->d_nil = $nilai->get_nilai($pb);
     $this->view->d_cur_ipk = $nilai->get_current_ipk($pb);
     $this->view->d_cuti = $cuti->get_cuti($this->kd_user, $pb);
     if ($role == 3) {
         $this->view->d_cuti = $cuti->get_cuti(0, $pb);
     }
     $this->view->d_rwt_beas = $pb->get_penerima_by_column($pb, $this->kd_user, 'nip', true);
     if ($role == 3) {
         $this->view->d_rwt_beas = $pb->get_penerima_by_column($pb, 0, 'nip', true);
     }
     $elem = $el->get_elem_per_pb($pb, false);
     $bea = $beaya->get_cost_per_pb($pb, false);
     $this->view->d_mas = $mas->get_masalah($pb);
     $d_bea = array();
     /*
      * sementara versi dummy dulu ye :p
      */
     foreach ($elem as $v) {
         $d = new BiayaPenerimaBeasiswa();
         $is_jadup = $v->get_kd_r() == 'tunjangan hidup';
         $is_buku = $v->get_kd_r() == 'buku';
         $nama = $v->get_kd_r();
         if ($is_jadup) {
             $nama .= " " . $v->get_bln() . " " . $v->get_thn();
         }
         if ($is_buku) {
             $bulan = Tanggal::bulan_num($v->get_bln());
             $bulan = $bulan == 1 ? 'ganjil' : 'genap';
             $nama .= " semester " . $bulan . " " . $v->get_thn();
         }
         $d->set_nama_biaya($nama);
         $d->set_jumlah_biaya($v->get_total_bayar());
         $d_bea[] = $d;
     }
     foreach ($bea as $v) {
         $d = new BiayaPenerimaBeasiswa();
         $d->set_nama_biaya($v->nama_tagihan);
         $d->set_jumlah_biaya($v->biaya_per_pegawai);
         $d_bea[] = $d;
     }
     $this->view->d_bea = $d_bea;
     $this->view->load('profil/cetak_profil');
 }