Пример #1
0
 function editTYCBDS()
 {
     $lang = JFactory::getLanguage();
     $user =& JFactory::getUser();
     $userid = $user->get('id');
     if (isset($_SESSION['dang_tin'])) {
         unset($_SESSION['tmp']);
         unset($_SESSION['dang_tin']);
     }
     $_SESSION['tao_yeu_cau'] = 'yes';
     if (isset($_SESSION['tmp'])) {
         $data = $_SESSION['tmp'];
         $tienich = $data['tienich'];
         $loai_bds_id = $data['loai_bds_id'];
         $quan_huyen_id = $data['quanhuyen'];
         $loai_giao_dich_id = $data['loai_giao_dich_id'];
         $tinh_thanh_id = $data['tinh_thanh_id'];
         $du_an_id = $data['du_an_id'];
         $huong_id = $data['huong_id'];
         $tinh_trang_noi_that = $data['tinh_trang_noi_that'];
     } else {
         $data = U_reModelProperties::layChiTietYeuCauBDS($userid);
         $tienich = $data->tien_ich_id;
         $loai_bds_id = $data->loai_bds_id;
         $quan_huyen_id = $data->quan_huyen_id;
         $loai_giao_dich_id = $data->loai_giao_dich_id;
         $tinh_thanh_id = $data->tinh_thanh_id;
         $du_an_id = $data->du_an_id;
         $huong_id = $data->huong_id;
         $tinh_trang_noi_that = $data->tinh_trang_noi_that;
     }
     $quan_huyen_id = explode(',', $quan_huyen_id);
     $loai_giao_dich = U_reViewmanage::kieu_compobox($param = array('table' => 'loai_giao_dich', 'div_id' => 'loai_giao_dich_id', 'classname' => 'input-s', 'title' => null, 'index' => $loai_giao_dich_id, 'is_town' => '0', 'onchang' => ''));
     $loai_bds = U_reViewmanage::kieu_compobox($param = array('table' => 'loai_bds', 'div_id' => 'loai_bds_id', 'title' => 'Bất kỳ', 'classname' => 'input-s', 'index' => $loai_bds_id, 'is_town' => '0', 'onchang' => ''));
     $onchangeTinhThanh1 = "onchange=" . '"layseachquanhuyen1' . "('quan_huyen_id',this.value,'" . $lang->getTag() . "','" . JURI::root() . "', 'quan_huyen_search', 'input-s')" . '"';
     $onchangeQuanHuyen = "onchange=" . '"layDanhSachDuAn' . "(this.value,'" . $lang->getTag() . "','" . JURI::root() . "')" . '"';
     $tinh_thanh_ycbds = U_reViewmanage::kieu_compobox($param = array('table' => 'tinh_thanh', 'div_id' => 'tinh_thanh_id', 'title' => 'Bất kỳ', 'classname' => 'input-s', 'index' => $tinh_thanh_id, 'is_town' => 'true', 'onchang' => $onchangeTinhThanh1));
     $quan_huyen = U_reViewmanage::kieu_compobox($param = array('table' => 'quan_huyen', 'div_id' => 'quan_huyen_id', 'classname' => 'input-s', 'title' => 'Bất kỳ', 'index' => $quan_huyen_id, 'is_town' => $tinh_thanh_id, 'onchang' => $onchangeQuanHuyen));
     $huongHTML = U_reViewmanage::kieu_compobox($param = array('table' => 'huong', 'div_id' => 'huong_id', 'title' => 'Bất kỳ', 'classname' => 'input-s', 'index' => $huong_id, 'is_town' => '', 'onchang' => ''));
     $duAnHTML = U_reViewmanage::kieu_compobox($param = array('table' => 'du_an', 'div_id' => 'du_an_id', 'classname' => 'input-s', 'title' => 'Bất kỳ', 'index' => $du_an_id, 'is_town' => '0', 'onchang' => ''));
     // lay tien ich
     $tienIchData = U_reViewmanage::lay_du_lieu('tien_ich');
     $tienIchCurrent = $tienich;
     $tienIchCurrentArray = explode(',', $tienIchCurrent);
     array_pop($tienIchCurrentArray);
     $countTienIchCurrentArray = count($tienIchCurrentArray);
     $tienIchHTML = U_reViewmanage::genListCheckBox($tienIchData[0]['data'], 'tien_ich', 'tien_ich', 'ck', '', $tienIchCurrentArray);
     $this->assignRef('loai_giao_dich', $loai_giao_dich);
     $this->assignRef('loai_bds', $loai_bds);
     $this->assignRef('tinh_thanh_ycbds', $tinh_thanh_ycbds);
     $this->assignRef('quan_huyen', $quan_huyen);
     $this->assignRef('duong_pho', $duong_pho);
     $this->assignRef('duAnHTML', $duAnHTML);
     $this->assignRef('huongHTML', $huongHTML);
     $this->assignRef('tienIchHTML', $tienIchHTML);
     $this->assignRef('data', $data);
     $this->addTemplatePath('modules/mod_taoyeucau/tmpl/');
     $this->setLayout('default');
     parent::display();
 }