public function login() { $user = $_POST['user']; $pass = $_POST['pass']; $pwd = Hash::create('sha1', $pass, HASH_SALT_KEY); $cuser = new User($this->registry); $res = $cuser->login($user, $pwd); if ((int) $res[0] == 1) { $univ = new Universitas($this->registry); $d_univ = array(); $d_jur = array(); $aruniv = $univ->get_univ(); foreach ($aruniv as $v) { if ($v->get_pic() == $res[2]) { $d_univ[] = $v->get_kode_in(); $jur = new Jurusan($this->registry); $arjur = $jur->get_jur_by_univ($v->get_kode_in()); foreach ($arjur as $w) { $d_jur[] = $w->get_kode_jur(); } } } Session::createSession(); Session::set('loggedin', TRUE); Session::set('user', $user); Session::set('role', $res[1]); Session::set('kd_user', $res[3]); Session::set('univ', $d_univ); Session::set('jur', $d_jur); ClassLog::write_log("login", "login", "user " . $user . " role:" . $res[1]); header('location:' . URL); } else { if ((int) $res[0] == 0) { $this->view->error = "user tidak ditemukan!"; $this->view->load('admin/login'); } else { $this->view->error = "database tidak valid!"; $this->view->load('admin/login'); } } }
public function get_jur_by_univ() { $univ = $_POST['param']; $jur = new Jurusan($this->registry); $data = $jur->get_jur_by_univ($univ); echo "<option value=''>-Pilih Jurusan-</option>"; foreach ($data as $val) { echo "<option value=" . $val->get_kode_jur() . ">" . $val->get_nama() . "</option>"; } }
public function get_jur_by_univ() { if (isset($_POST['univ']) && $_POST['univ'] != "") { $univ = $_POST['univ']; $jurusan = new Jurusan($this->registry); $data = $jurusan->get_jur_by_univ($univ); echo "<option value=\"\">Pilih Jurusan</option>"; foreach ($data as $jur) { if (isset($_POST['jur_def'])) { if ($jur->get_kode_jur() == $_POST['jur_def']) { $select = " selected"; } else { $select = ""; } echo "<option value=" . $jur->get_kode_jur() . "" . $select . ">" . $jur->get_nama() . "</option>\n"; } else { echo "<option value=" . $jur->get_kode_jur() . ">" . $jur->get_nama() . "</option>\n"; } } } else { echo "<option value=''>Pilih Jurusan</option>"; } }
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 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; }
public function datast($id = 0, $halaman = 1, $batas = 10) { $st = new SuratTugas($this->registry); if (isset($_POST['sb_add'])) { $jur = $_POST['jur']; $jenis = $_POST['jns_st']; $st_lama = $_POST['st_lama']; $nomor = $_POST['no_st']; $tgl_st = $_POST['tgl_st']; $tgl_mulai = $_POST['tgl_mulai']; $tgl_selesai = $_POST['tgl_selesai']; $th_masuk = $_POST['th_masuk']; $pemb = $_POST['pemb']; $upload = $this->registry->upload; $upload->init('fupload'); $upload->setDirTo('files/st/'); $nama = array($nomor, $tgl_st); $upload->changeFileName($upload->getFileName(), $nama); $data = array('KD_JUR' => $jur, 'KD_PEMB' => $pemb, 'KD_JENIS_ST' => $jenis, 'KD_ST_LAMA' => $st_lama, 'NO_ST' => $nomor, 'TGL_ST' => Tanggal::ubahFormatTanggal($tgl_st), 'TGL_MUL_ST' => Tanggal::ubahFormatTanggal($tgl_mulai), 'TGL_SEL_ST' => Tanggal::ubahFormatTanggal($tgl_selesai), 'THN_MASUK' => $th_masuk, 'FILE_ST' => $upload->getFileTo()); $st->add_st($data); $upload->uploadFile(); $ref = " no ST " . $nomor; ClassLog::write_log('surat_tugas', 'rekam', $ref); } $aksi = array(); if ($id != 0) { $st->set_kd_st($id); $this->view->d_ubah = $st->get_surat_tugas_by_id($st, $this->kd_user); $is_exist_file = $this->view->d_ubah->get_file() != NULL ? true : false; $file = array('file_exist' => $is_exist_file); $aksi = array('aksi' => 'ubah'); } else { $aksi = array('aksi' => 'rekam'); $file = array('file_exist' => false); } $univ = new Universitas($this->registry); $jur = new Jurusan($this->registry); $pemb = new PemberiBeasiswa(); $this->view->d_pemb = $pemb->get_All(); if (Session::get('role') == 2) { $this->view->d_st_lama = $st->get_surat_tugas($this->kd_user); } $this->view->d_jst = $st->get_st_class(); if (Session::get('role') == 2) { $this->view->d_univ = $univ->get_univ($this->kd_user); } else { $this->view->d_univ = $univ->get_univ(); } $this->view->d_jur = $jur->get_jurusan(); $this->view->d_th_masuk = $st->get_list_th_masuk(true); $this->view->d_th_masuk_input = $st->get_list_th_masuk(false); if (Session::get('role') == 2) { $this->view->d_st_all = $st->get_surat_tugas($this->kd_user); } else { $this->view->d_st_all = $st->get_surat_tugas(); } $this->view->aksi = json_encode($aksi); $this->view->d_file_exist = json_encode($file); if ($id != 0) { $jur = $this->view->d_ubah->get_jur(); $univ = $univ->get_univ_by_jur($jur); $this->view->univ = $univ->get_kode_in(); } /**start paging**/ $url = ''; if ($id == 0) { $url = 'surattugas/datast/0'; } else { $url = 'surattugas/datast/' . $id; } $this->view->url = $url; $this->view->paging = new Paging($url, $batas, $halaman); $this->view->jmlData = count($this->view->d_st_all); $posisi = $this->view->paging->cari_posisi(); if (Session::get('role') == 2) { $this->view->d_st = $st->get_surat_tugas_limit($posisi, $batas, $this->kd_user); } else { $this->view->d_st = $st->get_surat_tugas_limit($posisi, $batas); } /**end paging**/ $this->view->render('riwayat_tb/data_st'); }
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'); }