function editItem() { global $u_reGlobalConfig; if (isset($_SESSION['tmp']) && $_SESSION['tmp']['sess_tmp'] != 2) { unset($_SESSION['tmp']); } // check if exist info in session $cid = JRequest::getVar('cid', array(0), '', 'array'); if ($idurl = JFactory::getURI()->getVar("id")) { $id = $idurl; } else { $id = $cid[0]; } // get template $currentTemplate = JFactory::getApplication()->getTemplate(); $templatePath = JPATH_THEMES . DS . $currentTemplate . DS . "html" . DS . "com_u_re" . DS . "properties"; JRequest::setVar('hidemainmenu', 1); // khoi tao cac gia tri mac dinh $published = 1; $this->newsestChecked = ''; $this->emphasisChecked = ''; $phapLyId = 0; $huongId = 0; $loaiBDSId = 0; $loaiGiaoDichId = 0; $duanId = 0; $tinhThanhId = $u_reGlobalConfig['COMMON']['tinh_thanh_mac_dinh']; $quanHuyenId = $u_reGlobalConfig['COMMON']['quan_huyen_mac_dinh']; $donViTien = 1; $donViDienTich = 1; $viTriId = 0; $nhaMoiGioiId = 0; $tieuDeBDS = JText::_('New'); $this->mainImage = ''; $this->secondariesImage = ''; // add phuong xa, duong pho $phuongXaId = 0; $duongPhoId = 0; // TODO: remove hard code id // $id = 174; $this->propertyData['kinh_do'] = '10.7818082'; $this->propertyData['vi_do'] = '106.68513600000006'; $this->propertyData['loai_tin_id'] = 1; $this->propertyData['alias'] = ''; $this->propertyData['tieu_de_trang'] = ''; $this->propertyData['tu_khoa_trang'] = ''; $this->propertyData['mo_ta_trang'] = ''; $this->propertyData['tieu_de'] = ''; $this->propertyData['ma_so'] = ''; $this->propertyData['dia_chi'] = ''; $this->propertyData['so_nha'] = ''; //vanganh $this->propertyData['duong_pho'] = ''; //vanganh $this->propertyData['gia'] = ''; $this->propertyData['dien_tich_khuon_vien_rong'] = ''; $this->propertyData['dien_tich_khuon_vien_rong_truoc'] = ''; $this->propertyData['dien_tich_khuon_vien_dai'] = ''; $this->propertyData['phuong_xa'] = ''; $this->propertyData['du_an_id'] = ''; /* */ $this->propertyData['loai_bds'] = ''; $this->propertyData['phap_ly'] = ''; $this->propertyData['phong_ngu'] = ''; $this->propertyData['phong_tam'] = ''; $this->propertyData['phong_khac'] = ''; $this->propertyData['dien_tich_khuon_vien'] = ''; ////// $this->propertyData['dien_tich_su_dung'] = ''; $this->propertyData['ghi_chu_nguoi_lien_he'] = ''; $this->propertyData['mo_ta_chi_tiet'] = ''; $this->propertyData['dien_tich_xay_dung_dai'] = ''; $this->propertyData['dien_tich_xay_dung_rong'] = ''; $this->propertyData['loai_bds_id'] = ''; $this->propertyData['don_vi_tien'] = ''; $this->propertyData['id'] = ''; $this->propertyData['don_vi_tien_id'] = ''; $propertyData['tien_ich_id'] = ''; $propertyData['don_vi_dien_tich_id'] = ''; $this->propertyData['loai_giao_dich'] = ''; $this->propertyData['ten_nguoi_lien_he'] = ''; $this->propertyData['dia_chi_nguoi_lien_he'] = ''; $this->propertyData['dien_thoai_nguoi_lien_he'] = ''; $this->propertyDataen['tieu_de'] = ''; $this->propertyDataen['dia_chi'] = ''; $this->propertyDataen['mo_ta_chi_tiet'] = ''; $this->propertyDataen['ten_nguoi_lien_he'] = ''; $this->propertyDataen['dia_chi_nguoi_lien_he'] = ''; $this->propertyDataen['ghi_chu_nguoi_lien_he'] = ''; $this->propertyDataen['tieu_de_trang'] = ''; $this->propertyDataen['tu_khoa_trang'] = ''; $this->propertyDataen['mo_ta_trang'] = ''; $this->propertyDataen['loai_bds'] = ''; $this->propertyDataen['loai_giao_dich'] = ''; $this->propertyDataen['phap_ly'] = ''; $this->propertyDataen['don_vi_dien_tich'] = ''; $this->propertyDataen['don_vi_tien'] = ''; $this->propertyDataen['nha_moi_gioi_ten'] = ''; $this->propertyDataen['tinh_thanh'] = ''; $this->propertyDataen['quan_huyen'] = ''; $this->propertyDataen['phuong_xa'] = ''; //vanganh $this->propertyDataen['duong_pho'] = ''; //vanganh $this->propertyDataen['tien_ich'] = ''; //$this->propertyDataen['tien_ich_id'] = ''; //vanganh $this->propertyDataen['huong'] = ''; $this->propertyData['phong_khach'] = 0; $realtorId = ''; $this->mainImage['isfile'] = ''; $imageData = array(); $mainImage = ''; $subImages = ''; $imageData['id'] = 0; $imageData['status'] = 1; $imageData['title'] = ''; $imageTemplateName = 'image_block'; $this->propertyData['alias'] = ''; if ($id) { $propertyData = U_reModelProperties::layChiTietBDS($id, 'vi'); $propertyDataen = U_reModelProperties::layChiTietBDS($id, 'en'); $this->assign('propertyData', $propertyData); $this->assign('propertyDataen', $propertyDataen); $mainImage = ilandCommonUtils::getPropertyMainImage($id); $subImages = ilandCommonUtils::getPropertySubImages($id); $imageData['id'] = $id; $published = $propertyData['hien_thi_ra_ngoai']; if ($propertyData['moi_nhat'] == 1) { $this->newsestChecked = "checked"; } if ($propertyData['noi_bat'] == 1) { $this->emphasisChecked = "checked"; } $phapLyId = $propertyData['phap_ly_id']; $quanHuyenId = $propertyData['quan_huyen_id']; $tinhThanhId = $propertyData['tinh_thanh_id']; $huongId = $propertyData['huong_id']; $loaiGiaoDichId = $propertyData['loai_giao_dich_id']; $loaiBDSId = $propertyData['loai_bds_id']; $nhaMoiGioiId = $propertyData['nha_moi_gioi_id']; $tieuDeBDS = $propertyData['tieu_de']; $duanId = $propertyData['du_an_id']; // add phuong xa, duong pho $phuongXaId = $propertyData['phuong_xa_id']; $duongPhoId = $propertyData['duong_pho_id']; $imageData['title'] = $propertyData['tieu_de']; } if (isset($_SESSION['tao_yeu_cau'])) { unset($_SESSION['tmp']); unset($_SESSION['tao_yeu_cau']); } $_SESSION['dang_tin'] = 'yes'; if (isset($_SESSION['tmp'])) { $loaiGiaoDichId = $_SESSION['tmp']['kind_id']; $loaiBDSId = $_SESSION['tmp']['type_id']; $tinhThanhId = $_SESSION['tmp']['town_id']; $quanHuyenId = $_SESSION['tmp']['area_id']; $huongId = $_SESSION['tmp']['direction_id']; $duanId = $_SESSION['tmp']['du_an_id']; $propertyData['don_vi_dien_tich_id'] = $_SESSION['tmp']['price_area_unit']; if ($_SESSION['tmp']['tien_ich'] != '') { $propertyData['tien_ich_id'] = implode(",", $_SESSION['tmp']['tien_ich']); } } $InsertPrice = $this->propertyData['gia']; //$InsertPrice=$this->getInsertPrice( $this->propertyData['gia'], $this->propertyData['don_vi_tien_id'], '1'); //get price unit value $PriceUnit = $this->getInsertPrice($this->propertyData['gia'], $this->propertyData['don_vi_tien_id']); $title = U_reViewmanage::getPageTitle($this->get('category'), $tieuDeBDS); $editor =& JFactory::getEditor(); $this->assignRef('editor', $editor); $user =& JFactory::getUser(); $usertype = $user->get('usertype'); $this->assignRef('usertype', $usertype); //lay 2 ky tu cua ngon ngu hien tai //EX: Vi, En, Ja, Ch... $language =& JFactory::getLanguage(); $lang = substr($language->getTag(), 0, 2); $this->assignRef('lang', $lang); //get params values // TODO: get from global config $this->googlemapDisplay = $u_reGlobalConfig['MAP']['property_map_function_on']; $this->googlemapEnable = $u_reGlobalConfig['MAP']['property_map_function_enable']; // lay list lua chon hien thi ra ngoai $publishedHTML = JHTML::_('select.booleanlist', 'hien_thi_ra_ngoai', 'class="inputbox"', $published); $this->assignRef('published', $publishedHTML); // hien thi layout dang tin o backend $this->status = 1; $legal = ilandCommonUtils::getSelectBox('phap_ly', 'legal_status', JText::_('SELECT_LEGAL'), $phapLyId, '', '', '', 'class=opt'); $this->assignRef('legalStatusList', $legal); $directions = ilandCommonUtils::getSelectBox('huong', 'direction_id', 'Vui lòng chọn', $huongId, '', '', '', ''); $this->assignRef('directions', $directions); $tienIchTemplate = $u_reGlobalConfig['PROPERTY']['admin_tien_ich_template']; $tienIchHTML = U_ReModelProperties::fetchTienIchTemplate($propertyData['tien_ich_id'], $templatePath, $tienIchTemplate, true, $lang); $this->assignRef('tienIchHTML', $tienIchHTML); $realtorbds = ilandCommonUtils::getSelectBox('nha_moi_gioi', 'realtor_id', JText::_('realtor'), $realtorId, '', '', "style='width:148px'"); $this->assignRef('realtor_bds', $realtorbds); $this->assignRef('InsertPrice', $InsertPrice); $this->assignRef('PriceUnit', $PriceUnit); // exit; $this->assignRef('properties_key', $propertyData['ma_so']); // don vi //$getDonVi = U_reViewmanage::getDonVi(); $price_area_unit = ilandCommonUtils::getSelectBox('don_vi_dien_tich', 'price_area_unit', '', $propertyData['don_vi_dien_tich_id'], '', '', '', 'class=dangtin_donvitien'); $this->assignRef('Unit', $price_area_unit); // towns $areas = ilandCommonUtils::getSelectBox('quan_huyen', 'area_id', '', $quanHuyenId, 'layDanhSachDuAn(this.value,"vi","' . JURI::root() . '")', $tinhThanhId, "style='width:160px'"); $this->assignRef('areas', $areas); // towns layseachquanhuyen $towns = ilandCommonUtils::getSelectBox('tinh_thanh', 'town_id', '', $tinhThanhId, 'layseachquanhuyen("area_id",this.value,"vi-VN","' . JURI::base() . '","quanhuyens") ', '', "style='width:160px'"); $this->assignRef('towns', $towns); $kinds = ilandCommonUtils::getSelectBox('loai_giao_dich', 'kind_id', '', $loaiGiaoDichId, 'layDanhSachDienTich("price_area_unit",this.value,"vi-VN","' . JURI::base() . '","price_area_unit")', '', '', "class='opt'"); $this->assignRef('kinds', $kinds); // onchange=getonchangevalue(\'type_id\',\'divtype\',\'\',0) //$onchangeType = "getonchangevalue(\"type_id\",\"divtype\",\"\",0)"; $onchangeType = ''; $types = ilandCommonUtils::getSelectBox('loai_bds', 'type_id', '', $loaiBDSId, $onchangeType, '', '', "class='opt'"); $this->assignRef('types', $types); // add phuong xa, duong pho combo box $phuongXaListHTML = ilandCommonUtils::getSelectBox('phuong_xa', 'phuong_xa_id', 'Vui lòng chọn', $phuongXaId, "", $quanHuyenId, "style='width:160px'"); $this->assignRef('phuongXaListHTML', $phuongXaListHTML); $duongPhoListHTML = ilandCommonUtils::getSelectBox('duong_pho', 'duong_pho_id', 'Vui lòng chọn', $duongPhoId, "", $quanHuyenId, "style='width:160px'"); $this->assignRef('duongPhoListHTML', $duongPhoListHTML); $duAnHTML = ilandCommonUtils::getSelectBox('du_an', 'du_an_id', 'Vui lòng chọn', $duanId, '', $quanHuyenId, "style='width: 200px;padding: 2px;border: 1px solid #96A6C5;'"); $this->assignRef('duAnHTML', $duAnHTML); $imageData['mainImage'] = $mainImage; $imageData['subImages'] = $subImages; $imageBlockHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, $imageTemplateName, $imageData); $this->assignRef('imageBlockHTML', $imageBlockHTML); $this->addTemplatePath($templatePath); $this->setLayout($u_reGlobalConfig['PROPERTY']['detail_template']); // hoan dang lam parent::display(); }
function displayPropertyDetail($id) { global $u_reGlobalConfig; $language = ilandCommonUtils::getLanguage(); // get data $propertyModel = new U_ReModelProperties(); $propertyData = $propertyModel->layChiTietBDS($id, $language); // get template $templateName = JFactory::getApplication()->getTemplate(); $templatePath = JPATH_THEMES . DS . $templateName . DS . "html" . DS . "com_u_re" . DS . "properties"; $this->addTemplatePath($templatePath); $hien_thi_luot_xem = 0; if (isset($propertyData['hien_thi_ra_ngoai']) && $propertyData['hien_thi_ra_ngoai'] != 0 || !empty($_GET['preview'])) { $ip = $_SERVER['REMOTE_ADDR']; $session = JFactory::getSession(); $ipSession = $session->get('bds_' . $propertyData['id']); ilandCommonUtils::themLuotXemBDS($id, $propertyData['luot_xem']); if (empty($ipSession) || $ipSession != $ip) { $propertyData['luot_xem'] += 1; } //$propertyData['luot_xem'] += 1; //$propertyData['luot_xem'] = ilandCommonUtils::demLuotXemBDS($id, 0); if ($u_reGlobalConfig['COMMON']['luot_xem_bds'] == 1) { $hien_thi_luot_xem = 1; } else { $hien_thi_luot_xem = 0; } $this->setLayout($u_reGlobalConfig['PROPERTY']['detail_template']); } else { $this->setLayout($u_reGlobalConfig['PROPERTY']['detail_template'] . '_error'); parent::display(); return; } $this->assign('hien_thi_luot_xem', $hien_thi_luot_xem); // neu la loai can mua, can thue, hien thi template can mua can thue if ($propertyData['loai_giao_dich_id'] == '3' || $propertyData['loai_giao_dich_id'] == '4') { $this->assignRef('propertyData', $propertyData); $this->setLayout($u_reGlobalConfig['PROPERTY']['can_mua_template']); parent::display(); return; } // status 0 => trang chi tiet bat dong san $this->assign('status', 0); $this->assign('googlemapDisplay', $u_reGlobalConfig['MAP']['property_map_function_on']); $this->assign('googlemapEnable', $u_reGlobalConfig['MAP']['property_map_function_enable']); // hien thi cho trinh dien anh $mainImage = ilandCommonUtils::getPropertyMainImage($id); //$this->assignRef('mainImage' , $mainImage ); // hien thi cho trinh dien anh $subImages = ilandCommonUtils::getPropertySubImages($id); //$this->assignRef('secondariesImages' , $secondariesImages ); $imageData = array(); $imageData['mainImage'] = $mainImage; $imageData['subImages'] = $subImages; $imageData['status'] = 0; // chi tiet bds front end $imageData['id'] = $id; // chi tiet bds front end $imageTemplateName = 'image_block'; $imageData['title'] = $propertyData['tieu_de']; $imageBlockHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, $imageTemplateName, $imageData); $this->assignRef('imageBlockHTML', $imageBlockHTML); // Lấy chuỗi thông tin diện tích khuôn viên $areaInfoString = U_ReViewProperties::getAreaInfoString($propertyData['dien_tich_khuon_vien_rong'], $propertyData['dien_tich_khuon_vien_dai']); $this->assignRef('areaInfoString', $areaInfoString); // Lấy chuỗi thông tin diện tích sử dụng $usedAreaInfoString = U_ReViewProperties::getAreaInfoString($propertyData['dien_tich_su_dung_rong'], $propertyData['dien_tich_su_dung_dai']); $this->assignRef('usedAreaInfoString', $usedAreaInfoString); // Lấy chuỗi thông tin diện tích xay dung $construcAreaInfoString = U_ReViewProperties::getAreaInfoString($propertyData['dien_tich_xay_dung_rong'], $propertyData['dien_tich_xay_dung_dai']); $this->assignRef('construcAreaInfoString', $construcAreaInfoString); $livingSpaceString = U_ReViewProperties::getLivingSpaceString($propertyData['dien_tich_su_dung']); $this->assignRef('livingSpaceString', $livingSpaceString); // phong khach if (empty($propertyData['phong_khach'])) { $propertyData['phong_khach'] = '_'; } // phong ngu if (empty($propertyData['phong_ngu'])) { $propertyData['phong_ngu'] = '_'; } // phong tam if (empty($propertyData['phong_tam'])) { $propertyData['phong_tam'] = '_'; } // cac phong khac if (empty($propertyData['phong_khac'])) { $propertyData['phong_khac'] = '_'; } // huong if (empty($propertyData['huong'])) { $propertyData['huong'] = '_'; } // dien tich xay dung if (empty($propertyData['dien_tich_xay_dung_dai'])) { $propertyData['dien_tich_xay_dung_dai'] = '_'; } if (empty($propertyData['dien_tich_xay_dung_rong'])) { $propertyData['dien_tich_xay_dung_rong'] = '_'; } // phap ly if (empty($propertyData['phap_ly'])) { $propertyData['phap_ly'] = '_'; } if (empty($propertyData['dia_chi'])) { $propertyData['dia_chi'] = ilandCommonUtils::ketHopDiaChi($propertyData['so_nha'], $propertyData['duong_pho'], $propertyData['phuong_xa'], $propertyData['quan_huyen'], $propertyData['tinh_thanh']); } /* * Get same properties * - Get id * - Get current page */ // mặc định là trang 1 $currentPage = 1; // get data & fetch template $returnFieldList = U_ReConfig::getValueByKey('PROPERTY', 'bdslq_truong_du_lieu'); $conditionStr = U_ReConfig::getValueByKey('PROPERTY', 'bdslq_dieu_kien'); $sameProperties = $propertyModel->getSameProperties($language, $returnFieldList, $conditionStr, $propertyData, $currentPage); $sameProperties[3] = ilandCommonUtils::boSungThongTinBDS($sameProperties[3], $templatePath, 'bdslq'); // get ajax paging $samePropertiesConditionParam = ilandCommonUtils::genBDSLQConditionParam($conditionStr, $propertyData); $samePropertiesTemplate = $u_reGlobalConfig['PROPERTY']['bdslq_template']; $url = JURI::base() . 'ajax_function.php?task=bdslq&page=' . $currentPage . '&id=' . $id . '&condition=' . $conditionStr . '&return_field=' . $returnFieldList . '&template_path=' . $templatePath . '&template_name=' . $samePropertiesTemplate . '&tienTemplatePath=tiente3&moduleId=tranga&id=' . $propertyData['id'] . '&idContentElement=tranga' . '&ajaxPagingTemplate=' . $u_reGlobalConfig['COMMON']['ajax_paging_template']; $conditionParam = explode(',', $conditionStr); foreach ($conditionParam as $param) { $url .= '&' . $param . '=' . $propertyData[$param]; } $idContentElement = 'tranga'; $totalPage = $sameProperties[1]; $samePropertiesAjaxPagingTemplateName = $u_reGlobalConfig['COMMON']['ajax_paging_template']; $samePropertiesAjaxPagingHTML = ilandCommonUtils::getAjaxPagination($idContentElement, $url, $currentPage, $totalPage, $templatePath, $samePropertiesAjaxPagingTemplateName); if (!empty($sameProperties[3])) { $samePropertiesHTML = ilandCommonUtils::fetchPropertiesTemplate($templatePath, $samePropertiesTemplate, $sameProperties[3]); } else { $samePropertiesHTML = 0; } $this->assignRef('samePropertiesHTML', $samePropertiesHTML); $this->assignRef('samePropertiesAjaxPagingHTML', $samePropertiesAjaxPagingHTML); // getAdvantageslist // $advantagesList = $propertyModel->layDanhSachTienIch( $id ); // $this->assignRef( 'advantagesList', $advantagesList ); $tempalateName = 'tien_te3'; // lay template gia tien $gia = array($propertyData['VND'], $propertyData['USD'], $propertyData['SJC']); $donViTien = array('VND', 'USD', 'SJC'); $templateTien = $u_reGlobalConfig['PROPERTY']['tien_template']; $tienHTML = ilandCommonUtils::fetchCurrencyTemplate($propertyData, $templatePath, 'chitietBDS', $tempalateName); $this->assignRef('tienHTML', $tienHTML); $gia_nguyen_can = ilandCommonUtils::reFormatPrice($propertyData['gia_nguyen_can']); $gia_m2 = ilandCommonUtils::reFormatPrice($propertyData['gia_m2']); /* $giam2 = ilandCommonUtils::layGiaM2( array('dien_tich_su_dung'=>$propertyData['dien_tich_su_dung'],'gia'=>$propertyData['gia']) ); $gia1 = ilandCommonUtils::layGiaTien( array('don_vi_tien_id'=>$propertyData['don_vi_tien_id'], 'don_vi_dien_tich_id'=>$propertyData['don_vi_dien_tich_id'], 'gia'=>$propertyData['gia']) ); */ $this->assignRef('gia_nguyen_can', $gia_nguyen_can); $this->assignRef('gia_m2', $gia_m2); //$this->assignRef( 'gia', ilandCommonUtils::reFormatPrice($gia1 )); // get all flag & fetch tien ich template $tienIchAllFlag = $u_reGlobalConfig['PROPERTY']['tien_ich_all_flag']; $tienIchTemplate = $u_reGlobalConfig['PROPERTY']['tien_ich_template']; $tienIchHTML = $propertyModel->fetchTienIchTemplate($propertyData['tien_ich_id'], $templatePath, $tienIchTemplate, $tienIchAllFlag, $language); $this->assignRef('tienIchHTML', $tienIchHTML); // get map config $this->assignRef('mapZoom', $u_reGlobalConfig['MAP']['map_zoom']); // get comment $commentHTML = ilandCommonUtils::getComment($propertyData['id'], $propertyData['tieu_de'], 'bds'); $this->assignRef('commentHTML', $commentHTML); /* thông tắt 2 mod // get module tim kiem bat dong san $timKiemBDSHTML = ilandCommonUtils::getModuleTimKiemBDS( 'TÌM KIẾM BẤT ĐỘNG SẢN TRANG CHI TIẾT' ); $this->assignRef( 'timKiemBDSHTML', $timKiemBDSHTML ); // get quang cao*/ $moduleChiase = 'CHIA SE'; $quangCaoHTML = ilandCommonUtils::getChiaSe($moduleChiase); $this->assignRef('chiase', $quangCaoHTML); $moduleQC = 'Banner Ad - Chi tiết tin'; $QCHTML = $this->getModuleQC($moduleQC); $this->assignRef('quangcao', $QCHTML); // $propertyData['dien_tich_khuon_vien'] =''; $this->assignRef('propertyData', $propertyData); $document =& JFactory::getDocument(); $subject = $this->propertyData['tieu_de']; $nguoinhan = $this->propertyData['email_nguoi_lien_he']; $tennguoinhan = $this->propertyData['ten_nguoi_lien_he']; $lienhe = $this->getModule('mod_jdcontact', 'mod_jdcontact', 'raw', $subject, $nguoinhan, $tennguoinhan); $this->assignRef('lienhe', $lienhe); // print_r( $u_reGlobalConfig['SEO']['mo_ta_trang_mac_dinh'] ); if ($this->escape($propertyData['tieu_de_trang']) == NULL) { if ($propertyData['du_an'] == 'Vui lòng chọn') { $da = ''; } else { $da = $propertyData['du_an']; } // $page_title = $propertyData['thong_tin_tong_quan'] ; $title = $propertyData['loai_giao_dich'] . " " . $propertyData['loai_bds'] . " " . $da . ", " . $propertyData['quan_huyen'] . ", " . $propertyData['tinh_thanh']; $page_title = $title; } else { $page_title = ucfirst($this->escape($propertyData['tieu_de_trang'])); } if ($this->escape($propertyData['tu_khoa_trang']) == NULL) { $page_keywords = $u_reGlobalConfig['SEO']['tu_khoa_trang_mac_dinh']; } else { $page_keywords = ucfirst($this->escape($propertyData['tu_khoa_trang'])); } $document->setMetaData('keywords', $page_keywords); if ($this->escape($propertyData['mo_ta_trang']) == NULL) { $page_description = $u_reGlobalConfig['SEO']['mo_ta_trang_mac_dinh']; } else { $page_description = ucfirst($this->escape($propertyData['mo_ta_trang'])); } $document->setMetaData('description', $page_description); $mainframe =& JFactory::getApplication(); $pathway =& $mainframe->getPathway(); $pathway->addItem($page_title); $document->setTitle($page_title); parent::display(); }
function getlistproperties() { global $u_reGlobalConfig; $backEndList = $u_reGlobalConfig['IFRAME']['backEndList']; if ($backEndList == 1) { // echo "<strong><a href='index.php?option=com_jea&controller=properties&task=add'>".JText::_('ADD_NEW_PROPERTY')."</a></strong>"; $templatePath = "../templates/mlbds/html/com_u_re/properties/"; $this->addTemplatePath($templatePath); $this->setLayout('admin_list'); } else { jimport('joomla.html.pagination'); $cat =& JRequest::getVar('cat', ''); //JToolBarHelper::title( JText::_( ucfirst( $this->get('category') ) . ' management' ), 'jea.png' ); JToolBarHelper::title(JText::_(ucfirst($cat) . ' management'), 'jea.png'); JToolBarHelper::publish('unspamlist', 'Bỏ qua sai phạm'); JToolBarHelper::publish(); JToolBarHelper::unpublish(); JToolBarHelper::addNew(); JToolBarHelper::editList(); JToolBarHelper::deleteList(JText::_('CONFIRM_DELETE_MSG')); $this->assignRef('lang', $this->getLanguage()); $this->assignRef('cat', $cat); // get return field $returnField = $u_reGlobalConfig['PROPERTY']['du_lieu_tra_ve']; $returnField .= ',da_ban'; $limit = $u_reGlobalConfig['PROPERTY']['list_limit']; $orderby = $u_reGlobalConfig['PROPERTY']['orderby']; $limitstart =& JRequest::getVar('limitstart', 0); $page = ($limitstart + $limit) / $limit; $propertiesModel = new U_ReModelProperties(); $propertiesData = $propertiesModel->layDanhSachBatDongSan($returnField, $page, $limit, $this->lang, $orderby); $this->assignRef('tongDong', $propertiesData['rows'][0]); $this->pagination = new JPagination($this->tongDong, $limitstart, $limit); $this->assignRef('rows', $propertiesData['rows'][3]); $db = JFactory::getDBO(); if (!empty($this->rows)) { foreach ($this->rows as $k => $row) { $id = $row['id']; $mainImage = ilandCommonUtils::getPropertyMainImage($id); $subImages = ilandCommonUtils::getPropertySubImages($id); if (!is_file($mainImage['isfile'])) { $mainImage['max_url'] = JURI::root() . "images/noimage.jpg"; } $this->rows[$k]['hinhanh1'] = $mainImage; $this->rows[$k]['hinhanh'] = $subImages; $tien = array('gia' => $row['gia'], 'don_vi_tien_id' => $row['don_vi_tien_id'], 'don_vi_dien_tich_id' => $row['don_vi_dien_tich_id']); $gia = ilandCommonUtils::layGiaTien($tien); $this->rows[$k]['gia'] = $gia; $query = "SELECT username FROM jos_users WHERE id=" . $row['ma_nguoi_dang']; $db->setQuery($query); $tennguoidang = $db->loadRow(); $this->rows[$k]['ten_nguoi_dang'] = $tennguoidang[0]; } } $this->assignRef('loai_bds_id', $propertiesData['loai_bds_id']); $type = ilandCommonUtils::getSelectBox('loai_bds', 'loai_bds_id', JText::_('TYPE'), $this->loai_bds_id, 'onchange=document.adminForm.submit()'); $this->assignRef('loai_bds', $type); $this->assignRef('town_id', $propertiesData['town_id']); $towns = ilandCommonUtils::getSelectBox('tinh_thanh', 'town_id', JText::_('TOWNS'), $this->town_id, 'document.adminForm.submit()'); $this->assignRef('towns', $towns); $this->assignRef('area_id', $propertiesData['area_id']); $areas = ilandCommonUtils::getSelectBox('quan_huyen', 'area_id', JText::_('AREAS'), $this->area_id, 'onchange=document.adminForm.submit()', $this->town_id); $this->assignRef('areas', $areas); $this->assignRef('emphasis', $propertiesData['emphasis']); $this->assignRef('published', $propertiesData['published']); $this->assignRef('spam', $propertiesData['spam']); $this->assignRef('search', $propertiesData['search']); } parent::display(); }