function boSungLuotXemBDS($propertyList)
 {
     $propertyListCount = count($propertyList);
     for ($i = 0; $i < $propertyListCount; $i++) {
         $propertyList[$i]['luot_xem'] = ilandCommonUtils::demLuotXemBDS($propertyList[$i]['id']);
     }
     return $propertyList;
 }
Exemple #2
0
 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();
 }