예제 #1
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();
 }
예제 #2
0
 function boSungThongTinBDS($propertyList, $templatePath, $moduleId, $tempalateName = NULL)
 {
     $propertyListCount = count($propertyList);
     for ($i = 0; $i < $propertyListCount; $i++) {
         // lay link va hinh anh thumbnail
         $tempImage = ilandCommonUtils::getPropertyThumbnail($propertyList[$i]['id']);
         $propertyList[$i]['image'] = $tempImage['min_url'];
         if (empty($propertyList[$i]['alias'])) {
             $propertyList[$i]['alias'] = unicode($propertyList[$i]['tieu_de']);
         }
         $propertyList[$i]['link'] = ilandCommonUtils::getPropertyLink($propertyList[$i]['alias'], $propertyList[$i]['id']);
         // lay template tien te
         $propertyList[$i]['tien_te_HTML'] = ilandCommonUtils::fetchCurrencyTemplate($propertyList[$i], $templatePath, $moduleId, $tempalateName);
         if (!empty($propertyList[$i]['ngay_dang'])) {
             $propertyList[$i]['ngay_dang'] = date('d-m-Y', $propertyList[$i]['ngay_dang']);
         }
         if (!empty($propertyList[$i]['ngay_chinh_sua'])) {
             $propertyList[$i]['ngay_chinh_sua'] = date('d-m-Y', $propertyList[$i]['ngay_chinh_sua']);
         }
         $propertyList[$i]['dia_chi'] = ilandCommonUtils::ketHopDiaChi($propertyList[$i]['so_nha'], $propertyList[$i]['duong_pho'], $propertyList[$i]['phuong_xa'], $propertyList[$i]['quan_huyen'], $propertyList[$i]['tinh_thanh']);
         $propertyList[$i]['gia_m2'] = ilandCommonUtils::reFormatPrice($propertyList[$i]['gia_m2']);
         $propertyList[$i]['gia_nguyen_can'] = ilandCommonUtils::reFormatPrice($propertyList[$i]['gia_nguyen_can']);
         /*									 
         			if($propertyList[$i]['don_vi_dien_tich_id']==1||$propertyList[$i]['don_vi_dien_tich_id']==3){
         				$propertyList[$i]['gia_nguyen_can'] =  ilandCommonUtils::layGiaNguyenCan( array('dien_tich_su_dung'=>$propertyList[$i]['dien_tich_su_dung'],
         											 									'gia'=>$propertyList[$i]['gia']) );
         			}
         			else if($propertyList[$i]['don_vi_dien_tich_id']==2||$propertyList[$i]['don_vi_dien_tich_id']==4){
         				$propertyList[$i]['gia_m2'] =  ilandCommonUtils::layGiaM2( array('dien_tich_su_dung'=>$propertyList[$i]['dien_tich_su_dung'], 
         											 									'gia'=>$propertyList[$i]['gia']) );
         			}
         			* 
         */
         $propertyList[$i]['gia'] = ilandCommonUtils::layGiaTien(array('don_vi_tien_id' => $propertyList[$i]['don_vi_tien_id'], 'don_vi_dien_tich_id' => $propertyList[$i]['don_vi_dien_tich_id'], 'gia' => $propertyList[$i]['gia']));
         //$propertyList[$i]['gia'] = ilandCommonUtils::reFormatPrice($propertyList[$i]['gia']);
         $propertyList[$i]['luot_xem'] = ilandCommonUtils::demLuotXemBDS($propertyList[$i]['id']);
     }
     return $propertyList;
 }
예제 #3
0
 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();
 }