function listItems() { $language = 'vi'; jimport('joomla.html.pagination'); global $u_reGlobalConfig; //get limit $limit = $u_reGlobalConfig['PROJECTGROUP']['list_limit']; $limitstart =& JRequest::getVar('limitstart', 0); $page = ($limitstart + $limit) / $limit; //print_r('lm'.$limit); $ModelFeatures = new JeaModelFeatures(); $DanhSachBDS = $ModelFeatures->layDanhSachBatDongSan($language); $this->assignRef('rows', $DanhSachBDS['value']); $this->assignRef('rows2', $DanhSachBDS['value2']); // print_r($this->row2); // $this->assignRef('rows_en' , $DanhSachBDS['value2'] ); $this->assignRef('tenBang', $DanhSachBDS['name']); $this->assignRef('townId', $DanhSachBDS['townId']); $this->assignRef('tien_ichID', $DanhSachBDS['tien_ichID']); // print_r($this->tien_ichID); // exit; $tablesTranslations = array('loai_bds' => 'LOAI_BDS', 'tinh_thanh' => 'TINH_THANH', 'quan_huyen' => 'QUAN_HUYEN', 'tien_ich' => 'TIEN_ICH', 'phap_ly' => 'PHAP_LY', 'don_vi_tien' => 'DON_VI_TIEN', 'don_vi_dien_tich' => 'DON_VI_DIEN_TICH'); $options = array(); foreach ($tablesTranslations as $tableName => $translation) { $options[] = JHTML::_('select.option', $tableName, JText::_($translation)); } $selectTableList = JHTML::_('select.genericlist', $options, 'table', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $this->tenBang); if ($this->tenBang == 'quan_huyen') { $towns = ilandCommonUtils::getSelectBox('tinh_thanh', 'tinh_thanh', '', $this->townId, 'onchange=document.adminForm.submit()'); $this->assignRef('tinh_thanh', $towns); } if ($this->tenBang == 'tien_ich') { $loai_tien_ich = ilandCommonUtils::getSelectBox('loai_tien_ich', 'loai_tien_ich', '', $this->tien_ichID, 'onchange=test(),document.adminForm.submit()'); $this->assignRef('loai_tien_ich', $loai_tien_ich); } $this->assignRef('tongDong', count($this->rows)); $this->assignRef('paging', ilandCommonUtils::getPage($this->tongDong, $limit)); $this->pagination = new JPagination($this->tongDong, $limitstart, $limit); $this->assignRef('chonDanhSachBDS', $selectTableList); JToolBarHelper::title(JText::_($this->tenBang), 'jea.png'); JToolBarHelper::addNew(); JToolBarHelper::editList(); JToolBarHelper::deleteList(JText::_('CONFIRM_DELETE_MSG')); }
function editItem() { global $u_reGlobalConfig; $cid = JRequest::getVar('cid', array(0), '', 'array'); if ($idurl = JFactory::getURI()->getVar("id")) { $id = $idurl; } else { $id = $cid[0]; } $tinhThanhId = $u_reGlobalConfig['COMMON']['tinh_thanh_mac_dinh']; $quanHuyenId = $u_reGlobalConfig['COMMON']['quan_huyen_mac_dinh']; $templatePath = "../templates/" . $u_reGlobalConfig['DB']['template'] . "/html/com_u_re/projects/"; $this->assignRef('lang', ilandCommonUtils::getLanguage()); $this->status = 2; $projectModel = new U_ReModelProjects(); $projectData = $projectModel->getProjectById($id, $this->lang); $tinhThanhId = $projectData['tinh_thanh_id']; $quanHuyenId = $projectData['quan_huyen_id']; $projectDataEn = $projectModel->getProjectById($id, 'en'); $this->assignRef('row', $projectData); $this->assignRef('rowEn', $projectDataEn); $this->assignRef('town_id', $projectData['tinh_thanh_id']); $towns = ilandCommonUtils::getSelectBox('tinh_thanh', 'town_id', '', $tinhThanhId, 'layseachquanhuyenadmin("area_id",this.value,"vi-VN","' . JURI::root() . '","area_id") ', '', "style='width:264px!important'", "class='inputbox2'"); $this->assignRef('towns', $towns); $this->assignRef('area_id', $projectData['quan_huyen_id']); $areas = ilandCommonUtils::getSelectBox('quan_huyen', 'area_id', '', $quanHuyenId, '', $tinhThanhId, "style='width:264px!important'", "class='inputbox2'"); $this->assignRef('areas', $areas); // $type_selected = $this->row['loai_du_an_id'] ; //$type_id = ilandCommonUtils::getSelectBox( 'loai_du_an', 'type_id','', $type_selected,'','','','',$this->lang); //$this->assignRef( 'type', $type_id ); // hien thi cho chinh $mainImage = ilandCommonUtils::getProjectMainImage($id); // hien thi cho trinh dien anh $subImages = ilandCommonUtils::getProjectSubImages($id); // get image block $imageData = array(); $imageData['status'] = 2; $imageTemplateName = 'image_block'; $imageData['mainImage'] = $mainImage; $imageData['subImages'] = $subImages; $imageData['title'] = ''; $imageData['id'] = $id; $imageBlockHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, $imageTemplateName, $imageData); $this->assignRef('imageBlockHTML', $imageBlockHTML); // lay cac hinh anh dac biet: so do mat bang, noi that, ngoai that // so do mat bang $soDoMatBangImageData = array(); $soDoMatBangImageData['id'] = 0; $soDoMatBangImageData['status'] = 2; $soDoMatBangImageData['images'] = ''; $soDoMatBangImageData['folder'] = 'sodomatbang'; $soDoMatBangImageData['spec_name'] = 'so_do_mat_bang_img'; // noi that $noiThatImageData = array(); $noiThatImageData['id'] = 0; $noiThatImageData['status'] = 2; $noiThatImageData['images'] = ''; $noiThatImageData['folder'] = 'noithat'; $noiThatImageData['spec_name'] = 'noi_that_img'; // ngoai that $ngoaiThatImageData = array(); $ngoaiThatImageData['id'] = 0; $ngoaiThatImageData['status'] = 2; $ngoaiThatImageData['images'] = ''; $ngoaiThatImageData['folder'] = 'ngoaithat'; $ngoaiThatImageData['spec_name'] = 'ngoai_that_img'; if ($id) { // so do mat bang $soDoMatBangImageData['id'] = $id; $soDoMatBangImageData['images'] = ilandCommonUtils::layHinhAnhSoDoMatBang($id, 'project'); // noi that $noiThatImageData['id'] = $id; $noiThatImageData['images'] = ilandCommonUtils::layHinhAnhNoiThat($id, 'project'); // ngoai that $ngoaiThatImageData['id'] = $id; $ngoaiThatImageData['images'] = ilandCommonUtils::layHinhAnhNgoaiThat($id, 'project'); } // fetch hinh anh so do mat bang, noi that, ngoai that $soDoMatBangImageHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, 'spec_image_block', $soDoMatBangImageData); $this->assignRef('soDoMatBangImageHTML', $soDoMatBangImageHTML); $noiThatImageHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, 'spec_image_block', $noiThatImageData); $this->assignRef('noiThatImageHTML', $noiThatImageHTML); $ngoaiThatImageHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, 'spec_image_block', $ngoaiThatImageData); $this->assignRef('ngoaiThatImageHTML', $ngoaiThatImageHTML); // lay thong tin dat cho $this->row['status'] = 2; JRequest::setVar('hidemainmenu', 1); $title = ""; $title .= ' : '; $title .= $this->row['ten'] ? JText::_('Edit') . ' ' . $this->row['ten'] : JText::_('New'); JToolBarHelper::title($title, 'jea.png'); $app =& JFactory::getApplication(); $this->addTemplatePath($templatePath); $this->setLayout('detail'); parent::display(); }
function getlistproperties() { jimport('joomla.html.pagination'); $this->assignRef('lang', $this->getLanguage()); global $u_reGlobalConfig; // get return field $returnField = $u_reGlobalConfig['PROPERTY']['du_lieu_tra_ve']; $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, 1); $this->assignRef('tongDong', $propertiesData['rows'][0]); $this->pagination = new JPagination($this->tongDong, $limitstart, $limit); $this->assignRef('rows', $propertiesData['rows'][3]); // print_r( $propertiesData ); // exit; foreach ($this->rows as $k => $row) { $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; // lay luot xem $this->rows[$k]['luot_xem'] = ilandCommonUtils::demLuotXemBDS($this->rows[$k]['id']); } $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, 'onchange=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('search', $propertiesData['search']); // get template $currentTemplate = JFactory::getApplication()->getTemplate(); $templatePath = JPATH_THEMES . DS . $currentTemplate . DS . "html" . DS . "com_u_re" . DS . "properties"; $this->addTemplatePath($templatePath); $this->setLayout($u_reGlobalConfig['PROPERTY']['dang_tin_fontend_template']); 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(); }
echo ilandCommonUtils::getSelectBox('vi_tri', 'position', JText::_('position'), $ch_position, '', '', '', '', $lang); echo $strbreak; // [3]huong: huong dong, huong tay... echo ilandCommonUtils::getSelectBox('huong', 'direction_id', JText::_('Directions'), $ch_direction_id, '', '', '', '', $lang); echo $strbreak; // [4] don vi nha dat: m2, nguyen can... echo ilandCommonUtils::getSelectBox('don_vi_dien_tich', 'price_area_unit', '', $ch_price_area_unit, '', '', "style='width:80px'", '', $lang); echo $strbreak; // [5]loai bds: nha tam, biet thu... echo ilandCommonUtils::getSelectBox('loai_bds', 'type_id', JText::_('PROPERTIES_TYPE'), $ch_type_id, 'onchange="jea_types_filter(this.value); onchange=getonchangvalue(\'type_id\',\'divtype\',\'\',0)"', '', '', '', $lang); echo $strbreak; // [6]tinh thanh: hcm, ha noi... echo ilandCommonUtils::getSelectBox('tinh_thanh', 'town_id', JText::_('town'), $ch_town_id, "onchange=getCompoChangeLang('{$lang}','{$fontend}','area')", "", "style='width:137px'", '', $lang); echo $strbreak; // [7]quan huyen: quan thu duc... echo ilandCommonUtils::getSelectBox('quan_huyen', 'area_id', JText::_('area'), $ch_area_id, "", $ch_town_id, "style='width:137px'", '', $lang); echo $strbreak; // [8] don vi tien: vnd, usd.... $selectedtr = ''; $selectedti = ''; $selectedusd = ''; $selectedsjc = ''; switch ($ch_price_unit) { case '8': $selectedtr = "selected"; break; case '7': $selectedti = "selected"; break; case '2': $selectedusd = "selected";
echo $strbreak; // [28] echo JText::_('SEO_PAGE_TITLE'); echo $strbreak; // [29] echo JText::_('SEO_PAGE_KEYWORDS'); echo $strbreak; // [30] echo JText::_('SEO_PAGE_DESCRIPTION'); echo $strbreak; // [31] echo JText::_('HIEN_THI'); echo $strbreak; // [32] echo JText::_('SECONDARIES_PROPERTY_PICTURES'); echo $strbreak; // [33] echo "<input class='button' type='button' value='" . JText::_('SEND') . "' onclick=\"submitbutton('apply')\" />"; echo $strbreak; // [34] echo ilandCommonUtils::getSelectBox('loai_du_an', 'type_id', '', $type_id, '', '', '', '', $lang); echo $strbreak; // [35] echo JText::_('CHI_TIET_DU_AN'); echo $strbreak; // [42] echo JText::_('LUU'); echo $strbreak; // [43] echo JText::_('HUY'); echo $strbreak;