示例#1
0
 function save()
 {
     //echo "save control";
     //exit;
     //print_r($this->_controllerUrl);
     //	exit;
     // Check for request forgeries
     // JRequest::checkToken() or die( 'Invalid Token' );
     //$this->laydulieuBDS();
     U_reModelProperties::save();
     $this->_setDefaultRedirect();
     /*
     if ( false ===  $this->_model->save() )
     {
         $this->edit();
     }
     else
     {
     	/*
     	$row =& $this->_model->getRow();
     	
       	if ( 'apply' == $this->getTask() )
       	{
       		$this->_controllerUrl .= '&task=edit&id=' . $row->id ;
       	}
       
       	$msg = JText::sprintf( 'Successfully saved property', $row->ref ) ;
         $this->setRedirect( $this->_controllerUrl  , $msg );
     }
     */
 }
示例#2
0
            $extension = 'mod_jea_search';
            $lang1->load($extension, $basePath, $lang, true);
            $ten = JText::_('CHON_PHUONG_XA');
            break;
        default:
            $extension = 'com_u_re';
            $lang1->load($extension, $basePath, $lang, true);
            $ten = JText::_('CHON_PHUONG_XA');
            break;
    }
} else {
    $lang1->load($extension, $basePath, $language, true);
    $ten = JText::_('CHON_PHUONG_XA');
}
$quanHuyenId = $_GET['quan_huyen_id'];
$propertyModel = new U_reModelProperties();
$rows = $propertyModel->layDanhSachPhuongXa($quanHuyenId, substr($language, 0, 2));
$ix_phuong_xa_id = JRequest::getVar('phuong_xa_id', 0);
if ($rows) {
    if ($ten != '') {
        $title = array('id' => 0, 'ten' => $ten);
        array_unshift($rows, $title);
    }
    echo JHTML::_('select.genericlist', $rows, 'phuong_xa_id', 'class="opt" size="1" ', 'id', 'ten', $ix_phuong_xa_id);
} else {
    echo "<select id='phuong_xa_id' name='phuong_xa_id' class='opt' >";
    if ($ten != '') {
        echo "<option value='0'>" . $ten . "</option>";
    }
    echo "</select>";
}
示例#3
0
 function untickEmail()
 {
     U_reModelProperties::untickYeuCauBDS();
 }
示例#4
0
function kieu_link($param)
{
    $town_id = $param['town_id'];
    if (JFactory::getURI()->getVar("town_id")) {
        $town_id = JFactory::getURI()->getVar("town_id");
    }
    $language = 'vi';
    $propertyModel = new U_reModelProperties();
    $rows = $propertyModel->layDanhSachQuanHuyen($town_id, $language);
    //$rows= lay_du_lieu($param['table']);
    $currentAreaId = JRequest::getInt('area_id', 1);
    $htm = '';
    foreach ($rows as $item) {
        $selectedStyle = "";
        if ($item['id'] == $currentAreaId) {
            $selectedStyle = "style='color:red; font-weight:bold;'";
        }
        $htm .= "<div id='filtertown' ><a {$selectedStyle} href=\"#\" onclick=\"HtlmLink('{$item['id']}',{$town_id});\">" . $item['ten'] . "</a><BR></div>";
    }
    return $htm;
}
 function themLuotXemBDS($bdsId, $luotXem)
 {
     global $u_reGlobalConfig;
     $DBConfig = ilandCommonUtils::getSiteDBConfig();
     // tinh so tang luot xem
     $luotXemStep = $u_reGlobalConfig['PROPERTY']['luot_xem_step'];
     if (!empty($luotXemStep) && $luotXemStep > 1) {
         // random tu 1 ... luot xem step
         $luotXemStep = rand(1, $luotXemStep);
     } else {
         $luotXemStep = 1;
     }
     // check SESSION
     $ip = $_SERVER['REMOTE_ADDR'];
     $session = JFactory::getSession();
     $ipSession = $session->get('bds_' . $bdsId);
     if (empty($ipSession) || $ipSession != $ip) {
         if (empty($luotXem)) {
             $luotXem = 1;
         } else {
             $luotXem = $luotXem + 1;
         }
         $param = ' luot_xem = ' . $luotXem;
         // update property
         $propertyModel = new U_reModelProperties();
         $propertyModel->getUpdateProperties($bdsId, $param, 'vi');
         $session->set('bds_' . $bdsId, $ip);
     }
 }
示例#6
0
 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();
 }
示例#7
0
 function editItem()
 {
     global $u_reGlobalConfig;
     $backEndDetail = $u_reGlobalConfig['IFRAME']['backEndDetail'];
     if ($backEndDetail == 1) {
         // echo "<strong><a href='index.php?option=com_jea&controller=properties&task=add'>dang them </a></strong>";
         $templatePath = "../templates/mlbds/html/com_u_re/properties/";
         //$templatePath = "../templates/WebGH/html/com_u_re/properties/";
         $this->addTemplatePath($templatePath);
         $this->setLayout('admin_detail');
         parent::display();
         return;
     }
     $templatePath = "../templates/mlbds/html/com_u_re/properties/";
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     if ($idurl = JFactory::getURI()->getVar("id")) {
         $id = $idurl;
     } else {
         $id = $cid[0];
     }
     //	$id = 14;
     //echo "edit ";
     JRequest::setVar('hidemainmenu', 1);
     //$item = & $this->get('item');
     // lay du lieu
     // khoi tao cac gia tri mac dinh
     $published = 1;
     $this->newsestChecked = '';
     $this->emphasisChecked = '';
     $this->daBanChecked = '';
     $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['loai_tin_id'] = '';
     $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['gia'] = '';
     $this->propertyData['dien_tich_khuon_vien_rong'] = '';
     $this->propertyData['dien_tich_khuon_vien'] = '';
     $this->propertyData['dien_tich_khuon_vien_dai'] = '';
     $this->propertyData['phuong_xa'] = '';
     $this->propertyData['alias'] = '';
     /* */
     $this->propertyData['loai_bds'] = '';
     $this->propertyData['phap_ly'] = '';
     $this->propertyData['phong_ngu'] = '';
     $this->propertyData['phong_tam'] = '';
     $this->propertyData['phong_khac'] = '';
     //////
     $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'] = '';
     $propertyData['phuong_xa'] = '';
     $this->propertyData['chinh_chu'] = '';
     $this->propertyData['speak_english'] = '';
     $this->propertyData['duong_pho'] = '';
     $this->propertyData['so_nha'] = '';
     $this->propertyData['phong_khach'] = '';
     $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_en_dien_tich'] = '';
     $this->propertyDataen['don_en_tien'] = '';
     $this->propertyDataen['nha_moi_gioi_ten'] = '';
     $this->propertyDataen['tinh_thanh'] = '';
     $this->propertyDataen['quan_huyen'] = '';
     $this->propertyDataen['tien_ich'] = '';
     $this->propertyDataen['huong'] = '';
     $realtorId = '';
     $this->mainImage['isfile'] = '';
     $imageData = array();
     $mainImage = '';
     $subImages = '';
     $imageData['id'] = 0;
     $imageData['title'] = $this->propertyData['tieu_de'];
     $imageData['status'] = 2;
     $imageData['title'] = '';
     $imageTemplateName = 'image_block';
     if ($id) {
         $propertyData = U_reModelProperties::layChiTietBDS($id, 'vi');
         $propertyDataen = U_reModelProperties::layChiTietBDS($id, 'en');
         // print_r($propertyData);
         $this->assign('propertyData', $propertyData);
         $this->assign('propertyDataen', $propertyDataen);
         //print_r($this->propertyDataen);
         //exit;
         //get edit main image
         //$this->assignRef( 'mainImage', ilandCommonUtils::getPropertyMainImage( $id ) );
         $mainImage = ilandCommonUtils::getPropertyMainImage($id);
         //get edit sub image
         //$this->assignRef( 'secondariesImage', ilandCommonUtils::getPropertySubImages( $id ) );
         $subImages = ilandCommonUtils::getPropertySubImages($id);
         $imageData['mainImage'] = $mainImage;
         $imageData['subImages'] = $subImages;
         $imageData['id'] = $propertyData['id'];
         // chi tiet bds front end
         $this->assignRef('imageBlockHTML', $imageBlockHTML);
         $published = $propertyData['hien_thi_ra_ngoai'];
         // $this->newsestChecked = "checked";
         if ($propertyData['moi_nhat'] == 1) {
             $this->newsestChecked = "checked";
         }
         if ($propertyData['noi_bat'] == 1) {
             $this->emphasisChecked = "checked";
         }
         if ($propertyData['da_ban'] == 1) {
             $this->daBanChecked = "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'];
         //$viTriId = $propertyData['vi_tri_id'];
         $viTriId = 1;
         $nhaMoiGioiId = $propertyData['nha_moi_gioi_id'];
         $tieuDeBDS = $propertyData['tieu_de'];
         // add phuong xa, duong pho
         $phuongXaId = $propertyData['phuong_xa_id'];
         $duongPhoId = $propertyData['duong_pho_id'];
     }
     //		get price insert value
     $InsertPrice = $this->propertyData['gia'];
     //$InsertPrice=JeaViewProperties::getInsertPrice( $this->propertyData['gia'],$this->propertyData['don_vi_tien_id'], '1');
     //get price unit value
     $PriceUnit = JeaViewProperties::getInsertPrice($this->propertyData['gia'], $this->propertyData['don_vi_tien_id']);
     $title = JeaViewProperties::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 = 2;
     $legal = ilandCommonUtils::getSelectBox('phap_ly', 'legal_status', JText::_('SELECT_LEGAL'), $phapLyId, "onchange=getonchangevalue('legal_status','divlegalstatus','',0)", '', '', 'class=opt');
     $this->assignRef('legalStatusList', $legal);
     //get direction
     $directions = ilandCommonUtils::getSelectBox('huong', 'direction_id', JText::_('Directions'), $huongId, '', '', '', 'class=opt');
     $this->assignRef('directions', $directions);
     //$propertyData['tien_ich_id'] = '-2-3-';
     $Advantage = ilandCommonUtils::getSelectAdvantage($lang, $propertyData['tien_ich_id']);
     $this->assignRef('Advantage', $Advantage);
     //get realtor
     //	$realtorId=1;
     $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);
     $this->assignRef('properties_key', $propertyData['ma_so']);
     // don vi
     //$getDonVi =  JeaViewProperties::getDonVi();
     $price_area_unit = ilandCommonUtils::getSelectBox('don_vi_dien_tich', 'price_area_unit', '', $propertyData['don_vi_dien_tich_id']);
     $this->assignRef('Unit', $price_area_unit);
     // towns
     //		$areas =  ilandCommonUtils:: getSelectBox('quan_huyen', 'area_id', '',
     //									$quanHuyenId,"", $tinhThanhId, "style='width:137px'");
     $areas = ilandCommonUtils::getSelectBox('quan_huyen', 'area_id', '', $quanHuyenId, 'layDanhSachDuAn(this.value,"vi","' . JURI::root() . '")', $tinhThanhId, "style='width:160px'");
     $this->assignRef('areas', $areas);
     $baseurl = $u_reGlobalConfig['COMMON']['root'];
     // towns
     $towns = ilandCommonUtils::getSelectBox('tinh_thanh', 'town_id', '', $tinhThanhId, 'layseachquanhuyen("area_id",this.value,"vi-VN","' . $baseurl . '","area_id")', '', "style='width:160px'");
     $this->assignRef('towns', $towns);
     // add phuong xa, duong pho
     $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);
     $onchangedonvidientich = 'onchange=' . '"layDanhSachDienTich(' . "'price_area_unit',this.value,'vi-VN','" . $baseurl . "','price_area_unit')" . '"';
     $kinds = ilandCommonUtils::getSelectBox('loai_giao_dich', 'kind_id', '', $loaiGiaoDichId, $onchangedonvidientich, '', '', 'class=opt');
     $this->assignRef('kinds', $kinds);
     $types = ilandCommonUtils::getSelectBox('loai_bds', 'type_id', '', $loaiBDSId, 'onchange=getonchangevalue(\'type_id\',\'divtype\',\'\',0)', '', '', 'class=opt');
     $this->assignRef('types', $types);
     // print_r($this->types);
     // lay position
     $position = ilandCommonUtils::getSelectBox('vi_tri', 'position', '', $viTriId);
     $this->assignRef('position', $position);
     if (empty($this->propertyData['ten_nguoi_lien_he']) && empty($this->propertyData['dien_thoai_nguoi_lien_he']) && empty($this->propertyData['dia_chi_nguoi_lien_he'])) {
         // Chau add: get realtor info
         /*
         $realtor = $this->getRealtorById($nhaMoiGioiId);
         $this->propertyData['ten_nguoi_lien_he'] = $realtor->name;
         $this->propertyData['dien_thoai_nguoi_lien_he'] = $realtor->phone;
         $this->propertyData['dia_chi_nguoi_lien_he'] = $realtor->address;
         $row->realtor_link = array('profile' => $realtor->link['profile'],
         						   'listing' => $realtor->link['listing']);
         */
         if ($nhaMoiGioiId > 0) {
             $row->realtor_avatar = $realtor->image['image']['name'];
         }
     }
     //$templatePath = "../templates/WebGH/html/com_u_re/properties/";
     //$templatePath = "../templates/WebVHL/html/com_u_re/properties/";
     $tienIchTemplate = $u_reGlobalConfig['PROPERTY']['admin_tien_ich_template'];
     $tienIchHTML = U_ReModelProperties::fetchTienIchTemplate($propertyData['tien_ich_id'], $templatePath, $tienIchTemplate, true, $lang);
     $this->assignRef('tienIchHTML', $tienIchHTML);
     // image block
     $imageData['mainImage'] = $mainImage;
     $imageData['subImages'] = $subImages;
     $imageBlockHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, $imageTemplateName, $imageData);
     $this->assignRef('imageBlockHTML', $imageBlockHTML);
     $this->addTemplatePath($templatePath);
     // $this->setLayout('admin_detail');
     $this->setLayout('detail');
     JToolBarHelper::title($title, 'jea.png');
     parent::display();
 }
示例#8
0
        default:
            $extension = 'com_u_re';
            //$lang1->load($extension, $basePath, $lang, true);
            $ten = '';
            break;
    }
} else {
    //$lang1->load($extension, $basePath, $language, true);
    $ten = '';
}
$area_name = $_REQUEST['area_name'];
$townId = $_REQUEST['town_id'];
$QHID = $_REQUEST['quan_huyen_id'];
$classstyle = JRequest::getVar('style', 'input-s');
$isadmin = JRequest::getVar('isadmin', 0);
$propertyModel = new U_reModelProperties();
$rows = $propertyModel->layDanhSachQuanHuyen($townId, substr($language, 0, 2));
for ($i = 0; $i < count($rows); $i++) {
    // $rows[$i]['title'] = $rows[$i]['id'] . '-' . $rows[$i]['alias'];
    $rows[$i]['title'] = $rows[$i]['alias'];
}
//$ix_quan_huyen_id = JRequest::getVar('quan_huyen_id', 367);
$ix_quan_huyen_id = 0;
if ($QHID != 0) {
    $onchangeQuanHuyen = "onchange=" . '"layDanhSachDuAn1' . "(this.value,'" . $language . "','" . JURI::root() . "')" . '"';
} else {
    $onchangeQuanHuyen = 'onchange="setValQH()"';
}
if ($rows) {
    if ($ten != '') {
        $title = array('id' => 0, 'ten' => $ten);
示例#9
0
            $extension = 'com_u_re';
            //$lang1->load($extension, $basePath, $lang, true);
            $ten = 'Bất kỳ';
            break;
    }
} else {
    //$lang1->load($extension, $basePath, $language, true);
    $ten = 'Bất kỳ';
}
$loaiBDSName = $_GET['loai_bds_name'];
$loaiBDSId = $_GET['loai_bds_id'];
$quanHuyenId = $_GET['quan_huyen_id'];
$tinhThanhId = $_GET['tinh_thanh_id'];
$classstyle = JRequest::getVar('style', 'input-s');
$isadmin = JRequest::getVar('isadmin', 0);
$propertyModel = new U_reModelProperties();
$rows = $propertyModel->layDanhSachLoaiBDSTheoQuanHuyen('vi', $quanHuyenId, $tinhThanhId);
for ($i = 0; $i < count($rows); $i++) {
    // $rows[$i]['title'] = $rows[$i]['id'] . '-' . $rows[$i]['alias'];
    $rows[$i]['title'] = $rows[$i]['alias'];
}
//$ix_quan_huyen_id = JRequest::getVar('quan_huyen_id', 367);
$ix_loai_bds_id = 0;
if ($rows) {
    if ($ten != '') {
        $title = array('id' => 0, 'ten' => $ten);
        array_unshift($rows, $title);
    }
    if ($isadmin == 1) {
        echo JHTML::_('select.genericlist', $rows, $loaiBDSName, 'class="' . $classstyle . '" size="1" ', 'id', 'ten', $ix_loai_bds_id);
    } else {