public function cek_pb_konek_st_ct(Penerima $pb, $jenis_cek = 'all', $is_lulus = false, $luaran = false) { if ($pb->get_kd_pb() == '' || is_null($pb->get_kd_pb())) { return false; } if ($pb->get_st() == '' || is_null($pb->get_st())) { $pb = $pb->get_penerima_by_id($pb); } $kd_st = $pb->get_st(); $status = $pb->get_status(); switch ($jenis_cek) { case 'all': if (!$is_lulus) { //status belum lulus $sts_cuti = $this->cek_pb_konek_st_ct($pb, 'cuti', false); //cek masih cuti? // var_dump($sts_cuti); if ($sts_cuti) { $status = $this->cek_pb_konek_st_ct($pb, 'cuti', false, true); if ($luaran) { return $status; } return true; } else { //jika tidak dalam keadaan cuti $status = $this->cek_pb_konek_st_ct($pb, 'st', false, true); return $status; } } else { //TO DO cek lebih ke st, tp cek dulu dia dalam keadaancuti apa tidak //klo dalam keadaan cuti ya tidak bisa dong, harus dikembalikan ke cuti $sts_cuti = $this->cek_pb_konek_st_ct($pb, 'cuti', true); if ($sts_cuti) { $status = $this->cek_pb_konek_st_ct($pb, 'cuti', true, true); if ($luaran) { return $status; } return true; } else { $status = $this->cek_pb_konek_st_ct($pb, 'st', true, true); return $status; } } break; case 'cuti': $ct = new Cuti($this->registry); $d_ct = $ct->get_cuti(Session::get('kd_user'), $pb); //TO DO cek apakah masa cuti masih ada $exist_data = count($d_ct) > 0; if ($exist_data) { if ($luaran) { return 4; //saat cuti tidak boleh lulus } else { return true; } } else { if ($is_lulus) { //untuk kode lulus if ($luaran) { $status = $this->cek_pb_konek_st_ct($pb, 'st', true, true); //kode untuk lulus return $status; } else { //TO DO kembalian boolean return true; } } else { //untuk kode belum lulus if ($luaran) { $status = $this->cek_pb_konek_st_ct($pb, 'st', false, true); //kode sebelum lulus return $status; } else { //TO DO kembalian boolean return false; } } if (!$luaran) { return false; } } break; case 'st': $st = new SuratTugas($this->registry); $st->set_kd_st($kd_st); $st = $st->get_surat_tugas_by_id($st); $tgl_sel_st = $st->get_tgl_selesai(); $child = $st->is_child($kd_st); //child pertama if ($child) { $st_child = new SuratTugas($this->registry); $st_child->set_kd_st($st->get_st_lama()); //st parent $st_child = $st_child->get_surat_tugas_by_id($st_child); $second_child = $st_child->is_child($st_child->get_kd_st()); if ($second_child) { //jika child kedua if ($is_lulus) { //untuk status lulus if ($pb->get_tgl_lapor() == '' || is_null($pb->get_tgl_lapor())) { $tgl_lapor = date('Y-m-d'); } else { $tgl_lapor = $pb->get_tgl_lapor(); } $status = $pb->get_status_change_pb($st, $tgl_lapor, $tgl_sel_st); } else { $status = 3; } return $status; } else { if ($is_lulus) { if ($pb->get_tgl_lapor() == '' || is_null($pb->get_tgl_lapor())) { $tgl_lapor = date('Y-m-d'); } else { $tgl_lapor = $pb->get_tgl_lapor(); } $status = $pb->get_status_change_pb($st, $tgl_lapor, $tgl_sel_st); } else { $status = 2; } return $status; } } else { return 1; } break; default: throw new Exception(); } }
public function viewSkripsi() { $univ = new Universitas($this->registry); $jur = new Jurusan($this->registry); $user = Session::get('kd_user'); if (Session::get('role') == 2) { $data = $univ->get_univ_by_pic($user); $jurusan = $jur->get_jur_by_pic($user); } else { $data = $univ->get_univ(); $jurusan = $jur->get_jurusan(); } $myArray = array(); foreach ($jurusan as $val2) { $st = new SuratTugas($this->registry); $thn = $st->get_thn_masuk_by_jur($val2->get_kode_jur()); //var_dump($thn); foreach ($thn as $th) { $penerima = new Penerima($this->registry); $pb = $penerima->get_penerima_by_skripsi($val2->get_kode_jur(), $th); $jml = count($pb); //echo $jml; $un = new Universitas($this->registry); $c_univ = $un->get_univ_by_jur($val2->get_kode_jur()); $penerima_elemen = new PenerimaElemenBeasiswa(); $byr = $penerima_elemen->get_elemen_dibayar("3", $val2->get_kode_jur(), $th); //echo $byr; $pros = $penerima_elemen->get_elemen_proses_dibayar("3", $val2->get_kode_jur(), $th); //echo $pros; $arr = array('jur' => $val2->get_nama() . " " . $c_univ->get_kode(), 'thn' => $th, 'jml' => $jml, 'byr' => $byr, 'pros' => $pros); array_push($myArray, $arr); } } //var_dump($myArray); foreach ($myArray as $c => $key) { $sort_jur[] = $key['jur']; $sort_thn[] = $key['thn']; $sort_jml[] = $key['jml']; $sort_byr[] = $key['byr']; $sort_pros[] = $key['pros']; } if (!empty($myArray)) { array_multisort($sort_thn, SORT_DESC, $myArray); } $this->view->univ = $data; $this->view->arr = $myArray; $this->view->render('bantuan/biaya_skripsi'); }
public function printpdf($id) { $surat = SuratTugas::find($id); $data['no'] = 1; $data['sites'] = $surat->activities; $data['surat'] = $surat; $pdf = PDF::loadView('templatesurat.surat_tugas', $data); return $pdf->setPaper('a4')->stream(); }
public function cek_exist_nomor() { $nomor = $_POST['nomor']; // $nomor = 'ST-1349/PB.1/2012'; $nomor = Validasi::remove_space($nomor); $st = new SuratTugas($this->registry); $cek = $st->cek_exist_nomor($nomor); if ($cek) { echo 1; } else { echo 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 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'); }
public function datasc($id = 0, $halaman = 1, $batas = 10) { $ct = new Cuti($this->registry); if (isset($_POST['sb_add'])) { $noct = $_POST['no_sc']; $jsc = $_POST['jsc']; $tgl_sc = $_POST['tgl_sc']; $kd_pb = $_POST['kd_pb']; // $jur = $_POST['jur']; $sem_mul = $_POST['sem_mulai']; $thn_mul = $_POST['thn_mulai']; $sem_sel = $_POST['sem_sel']; $thn_sel = $_POST['thn_sel']; $bln_stop = $_POST['bln_stop']; $thn_stop = $_POST['thn_stop']; $bln_go = $_POST['bln_go']; $thn_go = $_POST['thn_go']; $data = $noct . " " . $jsc . " " . $tgl_sc . " " . $kd_pb . " " . $jur . " " . $sem_mul . " " . $sem_sel . " " . $thn_mul . " " . $thn_sel . " " . $bln_stop . " " . $bln_go . " " . $thn_stop . " " . $thn_go . " " . $_FILES['fupload']['name']; // echo $data; $pb = new Penerima($this->registry); $pb->set_kd_pb($kd_pb); $d_pb = $pb->get_penerima_by_id($pb); // $upload = $this->registry->upload; $cname = array('CUTI', $d_pb->get_nip(), $thn_mul); $this->registry->upload->init('fupload'); $this->registry->upload->setDirTo('files/cuti/'); $this->registry->upload->changeFileName($this->registry->upload->getFileName(), $cname); $file = $this->registry->upload->getFileTo(); // echo $file; $ct->set_no_surat_cuti($noct); $ct->set_jenis_cuti($jsc); $ct->set_tgl_surat_cuti(Tanggal::ubahFormatTanggal($tgl_sc)); $ct->set_pb($kd_pb); $ct->set_prd_mulai($sem_mul . " " . $thn_mul); $ct->set_prd_selesai($sem_sel . " " . $thn_sel); $ct->set_perk_stop($bln_stop . " " . $thn_stop); $ct->set_perk_go($bln_go . " " . $thn_go); $ct->set_file($file); if ($ct->add_cuti()) { // $pb->set_kd_pb($kd); $d_pb->set_status(4); $d_pb->update_penerima(); $this->registry->upload->uploadFile(); $ref = " no SC " . $noct; ClassLog::write_log('cuti', 'rekam', $ref); header('location:' . URL . 'cuti/datasc'); } else { $this->view->d_rekam = $ct; } } if ($id != 0) { $ct->set_kode_cuti($id); $this->view->d_ubah = $ct->get_cuti_by_id($ct, $this->kd_user); // var_dump($this->view->d_ubah); $pb = new Penerima($this->registry); $pb->set_kd_pb($ct->get_pb()); $this->view->d_pb_ubah = $pb->get_penerima_by_id($pb, $this->kd_user); $is_exist_file = $this->view->d_ubah->get_file() != NULL && $this->view->d_ubah->get_file() != '' ? true : false; $file = array('file_exist' => $is_exist_file); } else { $file = array('file_exist' => false); } $jsc = new JenisSuratCuti($this->registry); $univ = new Universitas($this->registry); $st = new SuratTugas($this->registry); $pb = new Penerima($this->registry); if (Session::get('role') == 2) { $this->view->d_pb = $pb->get_penerima($this->kd_user); $this->view->d_ct_all = $ct->get_cuti($this->kd_user); $this->view->d_univ = $univ->get_univ($this->kd_user); } else { $this->view->d_pb = $pb->get_penerima(0); $this->view->d_ct_all = $ct->get_cuti(0); $this->view->d_univ = $univ->get_univ(); } $this->view->d_jsc = $jsc->get_jsc(); $this->view->d_th_masuk = $st->get_list_th_masuk(); $this->view->curr_year = date('Y'); $this->view->d_file_exist = json_encode($file); /**start paging**/ $url = ''; if ($id == 0) { $url = 'cuti/datasc/0'; } else { $url = 'cuti/datasc/' . $id; } $this->view->url = $url; $this->view->paging = new Paging($url, $batas, $halaman); $this->view->jmlData = count($this->view->d_ct_all); $posisi = $this->view->paging->cari_posisi(); if (Session::get('role') == 2) { $this->view->d_ct = $ct->get_cuti_limit($posisi, $batas, $this->kd_user); } else { $this->view->d_ct = $ct->get_cuti_limit($posisi, $batas, 0); } /**end paging**/ $this->view->render('riwayat_tb/data_cuti'); }