Пример #1
0
 public function updUniversitas()
 {
     $univ = new Universitas($this->registry);
     $univDao = new UniversitasDao();
     if (isset($_POST['upd_univ'])) {
         $kd_univ = $_POST['kd_univ'];
         $kode = $_POST['kode'];
         $nama = $_POST['nama'];
         $alamat = $_POST['alamat'];
         $telepon = $_POST['telepon'];
         $lokasi = $_POST['lokasi'];
         $pic = $_POST['pic'];
         $univDao->set_pic($pic);
         $univDao->set_kode($kode);
         $univDao->set_nama($nama);
         $univDao->set_telepon($telepon);
         $univDao->set_alamat($alamat);
         $univDao->set_lokasi($lokasi);
         $univDao->set_kode_in($kd_univ);
         if (!$univ->update_univ($univDao)) {
             $pic = new User($this->registry);
             $this->view->d_ubah = $univDao;
             $this->view->error = $univ->get_error();
             $this->view->data = $univ->get_univ();
             //        var_dump($this->view->d_ubah);
             $this->view->pic = $pic->get_user(TRUE);
             $this->view->render('admin/universitas');
         } else {
             ClassLog::write_log('universitas', 'ubah', $nama);
             header('location:' . URL . 'admin/addUniversitas/' . $halaman . '/' . $batas);
         }
     }
 }
Пример #2
0
 public function get_univ_by_pic($pic)
 {
     $table = "r_univ";
     $where = "KD_USER = '******'";
     $sql = "SELECT * FROM {$table} where {$where}";
     $result = $this->db->select($sql);
     //var_dump($result);
     $data = array();
     foreach ($result as $val) {
         //$univ = new $this($this->registry);
         $univ = new UniversitasDao();
         $univ->set_kode_in($val['KD_UNIV']);
         $univ->set_kode($val['SINGKAT_UNIV']);
         $univ->set_pic($val['KD_USER']);
         $univ->set_nama($val['NM_UNIV']);
         $univ->set_alamat($val['ALMT_UNIV']);
         $univ->set_telepon($val['TELP_UNIV']);
         $univ->set_status($val['STATUS_UNIV']);
         $univ->set_lokasi($val['LOK_UNIV']);
         $data[] = $univ;
     }
     return $data;
 }