public function addJurusan($id = null)
 {
     $jur = new Jurusan($this->registry);
     $fakul = new Fakultas($this->registry);
     $this->view->fakul = $fakul->get_fakul();
     if (isset($_POST['add_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);
         if (!$jur->add_jurusan()) {
             $this->view->d_rekam = $jur;
             $this->view->error = $jur->get_error();
         } else {
             ClassLog::write_log('jurusan', 'rekam', $nama);
         }
     }
     if (!is_null($id)) {
         $fakul = new Fakultas($this->registry);
         $jur->set_kode_jur($id);
         $this->view->d_ubah = $jur->get_jur_by_id($jur);
         $this->view->fakul = $fakul->get_fakul();
     }
     $strata = new Strata();
     $this->view->strata = $strata->get_All();
     $this->view->data = $jur->get_jurusan();
     $this->view->render('admin/jurusan');
 }
 public function editBiaya($id = null, $tab = null)
 {
     if (Session::get('role') != 2) {
         $this->display();
         exit;
     }
     if ($id != "") {
         $biaya = new Biaya();
         $data_biaya = $biaya->get_by_id($id);
         //mendapatkan data biaya berdasarkan id=kd_biaya
         //var_dump($data_biaya);
         $kontrak = new Kontrak();
         //$kd_kontrak = $_POST['kd_kontrak'];
         $data_kontrak = $kontrak->get_by_id($data_biaya->kd_kontrak);
         //var_dump($kontrak);
         $universitas = new Universitas($this->registry);
         $univ = $universitas->get_univ_by_jur($data_kontrak->kd_jurusan);
         $nama_univ = $univ->get_kode();
         //mendapatkan nama singkatan universitas
         $kontrak_lama = $kontrak->get_by_id($data_kontrak->kontrak_lama);
         //mendapatkan objek kontrak lama
         //var_dump($kontrak_lama);
         //echo $kontrak_lama->no_kontrak;
         if ($kontrak_lama != false) {
             $kon_lama = $kontrak_lama->no_kontrak;
         } else {
             $kon_lama = "";
         }
         $jurusan = new Jurusan($this->registry);
         $jurusan->set_kode_jur($data_kontrak->kd_jurusan);
         $jur = $jurusan->get_jur_by_id($jurusan);
         //var_dump($jur->get_nama());
         $nama_jur = $jur->get_nama();
         //mendapatkan nama jurusan
         //menampilkan daftar biaya berdasarkan kontrak
         if ($tab == "" || $tab > 2) {
             $tab = 0;
         }
         $this->view->total_biaya_kontrak = $biaya->get_biaya_by_kontrak($data_biaya->kd_kontrak);
         $this->view->nama_univ = $nama_univ;
         $this->view->nama_jur = $nama_jur;
         $this->view->biaya = $data_biaya;
         $this->view->kontrak = $data_kontrak;
         $this->view->tab = $tab;
         $this->view->render('kontrak/edit_biaya');
     } else {
         header('location:' . URL . 'kontrak/display');
     }
 }
 public function editSkripsi($id = null)
 {
     if (Session::get('role') != 2) {
         $this->viewSkripsi();
         exit;
     }
     if ($id != "") {
         $elemen = new ElemenBeasiswa();
         $elemen->set_kd_d($id);
         $elemen2 = $elemen->get_elem_by_id($elemen);
         $this->view->elemen = $elemen2;
         $jur = new Jurusan($this->registry);
         $jur->set_kode_jur($elemen2->get_kd_jur());
         $jur2 = $jur->get_jur_by_id($jur);
         //var_dump($jur2);
         $this->view->jur = $jur2;
         $univ = new Universitas($this->registry);
         $univ2 = $univ->get_univ_by_jur($jur2->get_kode_jur());
         $this->view->univ = $univ2;
         $this->view->render('bantuan/ubah_skripsi');
     } else {
         header('location:' . URL . 'elemenBeasiswa/viewSkripsi');
     }
 }
 public function get_penerima_filter($univ, $thn_masuk, $status, $kd_user = 0, $posisi = null, $batas = null)
 {
     $sql = "SELECT a.KD_PB as KD_PB,";
     $sql .= "a.KD_ST as KD_ST,\r\n            a.KD_JUR as KD_JUR,\r\n            a.KD_STS_TB as KD_STS_TB,\r\n            b.TGL_MUL_ST as TGL_MUL_ST,\r\n            b.TGL_SEL_ST as TGL_SEL_ST,\r\n            a.KD_BANK as KD_BANK,";
     $sql .= "\r\n            a.KD_GOL as KD_GOL,\r\n            a.NIP_PB as NIP_PB,\r\n            a.NM_PB as NM_PB,\r\n            a.JK_PB as JK_PB,\r\n            a.UNIT_ASAL_PB as UNIT_ASAL_PB,\r\n            a.EMAIL_PB as EMAIL_PB,\r\n            a.TELP_PB as TELP_PB,\r\n            a.ALMT_PB as ALMT_PB,\r\n            a.NO_REKENING_PB as NO_REKENING_PB,\r\n            a.FOTO_PB as FOTO_PB,\r\n            a.TGL_LAPOR_PB as TGL_LAPOR_PB,\r\n            a.NO_SKL_PB as NO_SKL_PB,\r\n            a.NO_SPMT_PB as NO_SPMT_PB,\r\n            a.JUDUL_SKRIPSI_PB as JUDUL_SKRIPSI_PB\r\n            FROM " . $this->_tb_penerima . " a ";
     $sql .= "LEFT JOIN d_srt_tugas b ON a.KD_ST=b.KD_ST\r\n            LEFT JOIN r_jur c ON b.KD_JUR=c.KD_JUR\r\n            LEFT JOIN r_fakul f ON c.KD_FAKUL=f.KD_FAKUL\r\n            LEFT JOIN r_univ g ON f.KD_UNIV=g.KD_UNIV\r\n            LEFT JOIN r_stb d ON a.KD_STS_TB=d.KD_STS_TB\r\n            LEFT JOIN r_bank e ON a.KD_BANK=e.KD_BANK \r\n            LEFT JOIN r_strata h ON c.KD_STRATA=h.KD_STRATA ";
     if ($univ == 0 && $thn_masuk == 0 && $status != 0) {
         $sql .= "WHERE a.KD_STS_TB=" . $status;
         if ($kd_user != 0) {
             $sql .= " AND g.KD_USER="******"WHERE b.THN_MASUK=" . $thn_masuk . " AND a.KD_STS_TB=" . $status;
             if ($kd_user != 0) {
                 $sql .= " AND g.KD_USER="******"WHERE g.KD_UNIV=" . $univ . " AND b.THN_MASUK=" . $thn_masuk . " AND a.KD_STS_TB=" . $status;
                 if ($kd_user != 0) {
                     $sql .= " AND g.KD_USER="******"WHERE g.KD_UNIV=" . $univ . " AND b.THN_MASUK=" . $thn_masuk;
                     if ($kd_user != 0) {
                         $sql .= " AND g.KD_USER="******"WHERE g.KD_UNIV=" . $univ;
                         if ($kd_user != 0) {
                             $sql .= " AND g.KD_USER="******"WHERE b.THN_MASUK=" . $thn_masuk;
                             if ($kd_user != 0) {
                                 $sql .= " AND g.KD_USER="******"WHERE g.KD_UNIV=" . $univ . "  AND a.KD_STS_TB=" . $status;
                                 if ($kd_user != 0) {
                                     $sql .= " AND g.KD_USER="******" WHERE g.KD_USER="******" LIMIT " . $posisi . "," . $batas;
     }
     //        echo $sql;
     $result = $this->db->select($sql);
     $data = array();
     foreach ($result as $val) {
         $penerima = new $this($this->registry);
         $penerima->set_kd_pb($val['KD_PB']);
         $st = new SuratTugas($this->registry);
         $penerima->set_st($val['TGL_MUL_ST'] . ";" . $val['TGL_SEL_ST']);
         $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;
         unset($jur);
     }
     return $data;
 }
Exemple #5
0
 public function get_cuti_by_pb_name($name, $kd_user = null)
 {
     $sql = "SELECT a.KD_CUTI as KD_CUTI,\r\n                a.KD_JNS_SRT_CUTI as KD_JNS_SRT_CUTI,\r\n                a.KD_PB as KD_PB,\r\n                a.NO_CUTI as NO_CUTI,\r\n                a.TGL_CUTI AS TGL_CUTI,\r\n                a.PRD_MUL_CUTI as PRD_MUL_CUTI,\r\n                a.PRD_SEL_CUTI as PRD_SEL_CUTI,\r\n                a.PERK_STOP as PERK_STOP,\r\n                a.PERK_GO as PERK_GO,\r\n                a.FILE_CUTI as FILE_CUTI\r\n                FROM " . $this->t_cuti . " a \r\n                LEFT JOIN d_pb b ON a.KD_PB=b.KD_PB\r\n                LEFT JOIN r_jur c ON b.KD_JUR=c.KD_JUR\r\n                LEFT JOIN r_fakul d ON c.KD_FAKUL=d.KD_FAKUL\r\n                LEFT JOIN r_univ e ON d.KD_UNIV=e.KD_UNIV\r\n                WHERE b.NM_PB LIKE '%" . $name . "%'";
     if (!is_null($kd_user)) {
         $sql .= " AND e.KD_USER="******"-" . $d_pb->get_nip() . "-" . $d_jur->get_nama());
         $cuti->set_no_surat_cuti($v['NO_CUTI']);
         $cuti->set_tgl_surat_cuti($v['TGL_CUTI']);
         $cuti->set_prd_mulai($v['PRD_MUL_CUTI']);
         $cuti->set_prd_selesai($v['PRD_SEL_CUTI']);
         $cuti->set_perk_stop($v['PERK_STOP']);
         $cuti->set_perk_go($v['PERK_GO']);
         unset($pb);
         unset($jur);
         $data[] = $cuti;
     }
     return $data;
 }
 public function get_child($kd_st)
 {
     $sql = "SELECT * FROM d_srt_tugas WHERE KD_ST_LAMA=" . $kd_st;
     $d_st = $this->db->select($sql);
     $data = array();
     foreach ($d_st as $val) {
         $st = new SuratTugas($this->registry);
         $st = new $this($this->registry);
         $st->set_kd_st($val['KD_ST']);
         $jur = new Jurusan($this->registry);
         $jur->set_kode_jur($val['KD_JUR']);
         $d_jur = $jur->get_jur_by_id($jur);
         $st->set_jur($d_jur->get_nama());
         $st->set_nomor($val['NO_ST']);
         $st->set_pemberi($val['KD_PEMB']);
         $st->set_st_lama($val['KD_ST_LAMA']);
         $jst = new JenisSuratTugas($this->registry);
         $jst->set_kode($val['KD_JENIS_ST']);
         $d_jst = $jst->get_jst_by_id($jst);
         $st->set_jenis_st($d_jst->get_nama());
         $st->set_tgl_st($val['TGL_ST']);
         $st->set_tgl_mulai($val['TGL_MUL_ST']);
         $st->set_tgl_selesai($val['TGL_SEL_ST']);
         $st->set_th_masuk($val['THN_MASUK']);
         $st->set_file($val['FILE_ST']);
         unset($jur);
         unset($jst);
         $data[] = $st;
     }
     return $data;
 }
 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 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');
 }