예제 #1
0
 function getList()
 {
     // get param from session & search
     // $searchParams = $_SESSION['projectSearch'];
     $conditionParamStr = ' hien_thi_ra_ngoai = 1 ';
     if (!empty($_GET['key_search'])) {
         $conditionParamStr .= " AND ten LIKE '%" . $_GET['key_search'] . "%' ";
     }
     if (!empty($_GET['loai_du_an_id'])) {
         $conditionParamStr .= " AND loai_du_an_id = '" . $_GET['loai_du_an_id'] . "'";
     }
     if (!empty($_GET['tinh_thanh_id'])) {
         $conditionParamStr .= " AND tinh_thanh_id = '" . $_GET['tinh_thanh_id'] . "'";
     }
     $this->assignRef('lang', ilandCommonUtils::getLanguage());
     global $u_reGlobalConfig;
     // get return field
     $returnField = $u_reGlobalConfig['PROJECT']['project_list_return_field'];
     $limit = $u_reGlobalConfig['PROJECT']['list_limit'];
     if (JFactory::getURI()->getVar('limit')) {
         $limit = JFactory::getURI()->getVar('limit');
     }
     $orderby = $u_reGlobalConfig['PROJECT']['orderby'];
     // get current page & limit
     $limitstart =& JRequest::getVar('limitstart', 0);
     $page = ($limitstart + $limit) / $limit;
     $showPageTitle = $this->params->get('show_page_title', 0);
     $this->assignRef('showPageTitle', $showPageTitle);
     $pageTitle = $this->params->get('page_title', '');
     $this->assignRef('pageTitle', $pageTitle);
     $projectModel = new U_ReModelProjects();
     $projectList = $projectModel->getListProjects($returnField, $conditionParamStr, $page, $limit, $orderby);
     //$projectList['rows'][3]= ilandCommonUtils::boSungThongTinDuAn($projectList['rows'][3]);
     if ($u_reGlobalConfig['COMMON']['luot_xem_ds_du_an'] == 1) {
         $hien_thi = 1;
     } else {
         $hien_thi = 0;
     }
     $this->assignRef('hien_thi_luot_xem', $hien_thi);
     // get template
     $templateName = JFactory::getApplication()->getTemplate();
     $this->addTemplatePath(JPATH_THEMES . DS . $templateName . DS . "html" . DS . "com_u_re" . DS . "projects");
     $this->setLayout($u_reGlobalConfig['PROJECT']['list_template']);
     // get  paging
     $paging = ilandCommonUtils::getPage($projectList['rows'][0], $limit);
     $this->assignRef('paging', $paging);
     jimport('joomla.html.pagination');
     $this->pagination = new JPagination($projectList['rows'][0], $limitstart, $limit);
     // assign
     $this->assignRef('rows', $projectList['rows'][3]);
     parent::display();
 }
예제 #2
0
 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'));
 }
예제 #3
0
 function listIems()
 {
     jimport('joomla.html.pagination');
     JHTML::_('behavior.tooltip');
     global $u_reGlobalConfig;
     // get return field
     $returnField = $u_reGlobalConfig['REALTOR']['realtor_list_return_field'];
     //get limit
     $limit = $u_reGlobalConfig['REALTOR']['list_limit'];
     $limitstart =& JRequest::getVar('limitstart', 0);
     $page = ($limitstart + $limit) / $limit;
     //		print_r($returnField ."<br/>");
     //		print_r($limit ."<br/>");
     //		print_r($limitstart ."<br/>");
     //		print_r($page ."<br/>");
     //		exit;
     $ModelRealtors = new JeaModelRealtors();
     $Danhsachnhamoigioi = $ModelRealtors->layDanhSachNhaMoiGioi($returnField, $page, $limit);
     //print_r($Danhsachnhamoigioi['rows'][3]);
     //	exit;
     //		$model = $this->getModel();
     //		$items = $this->get('items');
     $this->assign('rows', $Danhsachnhamoigioi['rows'][3]);
     $this->assignRef('tongDong', $Danhsachnhamoigioi['rows'][0]);
     $this->assignRef('paging', ilandCommonUtils::getPage($Danhsachnhamoigioi['rows'][0], $limit));
     $this->pagination = new JPagination($this->tongDong, $limitstart, $limit);
     $this->assignRef('hien_thi', $Danhsachnhamoigioi['published']);
     // print_r($this->hien_thi);
     //	exit;
     JToolBarHelper::title(JText::_(ucfirst($this->get('category')) . ' management'), 'jea.png');
     JToolBarHelper::publish();
     JToolBarHelper::unpublish();
     JToolBarHelper::addNew();
     JToolBarHelper::customX('copy', 'copy.png', 'copy_f2.png', 'Copy');
     JToolBarHelper::editList();
     JToolBarHelper::deleteList(JText::_('CONFIRM_DELETE_MSG'));
     $templatePath = "../templates/WebGH/html/com_u_re/realtors/";
     $this->addTemplatePath($templatePath);
     $this->setLayout('list');
     parent::display();
 }
예제 #4
0
 function getlistproject()
 {
     jimport('joomla.html.pagination');
     JToolBarHelper::title(JText::_(ucfirst($this->get('category')) . ' management'), 'jea.png');
     JToolBarHelper::publish();
     JToolBarHelper::unpublish();
     JToolBarHelper::addNew();
     JToolBarHelper::editList();
     JToolBarHelper::deleteList(JText::_('CONFIRM_DELETE_MSG'));
     global $u_reGlobalConfig;
     // get return field
     $returnField = $u_reGlobalConfig['PROJECT']['project_list_return_field'];
     //get limit
     $limit = $u_reGlobalConfig['PROJECT']['list_limit'];
     $orderby = $u_reGlobalConfig['PROJECT']['orderby'];
     // get condition param
     $context = 'com_jea.projects';
     $mainframe =& JFactory::getApplication();
     $patch_split_f = split("/", JFactory::getURI()->_path);
     $type_id = $mainframe->getUserStateFromRequest($context . 'type_id', 'type_id', 0, 'int');
     $town_id = $mainframe->getUserStateFromRequest($context . 'town_id', 'town_id', 0, 'int');
     $area_id = $mainframe->getUserStateFromRequest($context . 'area_id', 'area_id', 0, 'int');
     $search = $mainframe->getUserStateFromRequest($context . 'search', 'search', '', 'string');
     $published = $mainframe->getUserStateFromRequest($context . 'published', 'published', -1, 'int');
     $emphasis = $mainframe->getUserStateFromRequest($context . 'emphasis', 'emphasis', -1, 'int');
     $language = ilandCommonUtils::getLanguage();
     $DBConfig = ilandCommonUtils::getSiteDBConfig();
     $conditionParams = ' 1 ';
     //$loai_du_an_id = JFactory::getURI()->getVar("loai_du_an_id");
     $isfontend = 1;
     foreach ($patch_split_f as $patch_value) {
         if ($patch_value == 'administrator') {
             $isfontend = 0;
             break;
         }
     }
     if ($isfontend) {
         $conditionParams .= ' AND hien_thi_ra_ngoai = 1';
     }
     //else
     //{
     //	if ( $published!=-1 ) $conditionParams .= ' AND hien_thi_ra_ngoai = '.$published;
     //}
     //if( $emphasis != -1 ) $conditionParams .= ' AND noi_bat = '.$emphasis;
     if ($town_id != 0) {
         $conditionParams .= ' AND tinh_thanh_id = ' . $town_id;
     }
     if ($area_id != 0 && $town_id != 0) {
         $conditionParams .= ' AND quan_huyen_id = ' . $area_id;
     }
     //if ( $type_id!= 0 )  $conditionParams .= ' AND loai_du_an_id = '.$type_id;
     if ($search != NULL) {
         $conditionParams .= ' AND ten LIKE \'%' . $search . '%\'';
     }
     //if( $loai_du_an_id ) $conditionParams .= ' AND loai_du_an_id = '.$loai_du_an_id;
     // end get condition param
     $limitstart =& JRequest::getVar('limitstart', 0);
     $page = ($limitstart + $limit) / $limit;
     $projectModel = new U_ReModelProjects();
     $projectData = $projectModel->getListProjects($returnField, $conditionParams, $page, $limit, $orderby);
     //$this->assignRef( 'type_id', $projectData['type_id'] );
     //$type = ilandCommonUtils::getSelectBox( 'loai_du_an', 'type_id', JText::_('LOAI_DU_AN'), $type_id, 'onchange=document.adminForm.submit()');
     //$this->assignRef( 'type', $type );
     $this->assignRef('town_id', $town_id);
     $towns = ilandCommonUtils::getSelectBox('tinh_thanh', 'town_id', JText::_('TINH_THANH'), $town_id, 'onchange=document.adminForm.submit()');
     $this->assignRef('towns', $towns);
     $this->assignRef('area_id', $projectData['area_id']);
     $areas = ilandCommonUtils::getSelectBox('quan_huyen', 'area_id', JText::_('QUAN_HUYEN'), $area_id, 'onchange=document.adminForm.submit()', $this->town_id);
     $this->assignRef('areas', $areas);
     $this->assignRef('paging', ilandCommonUtils::getPage($projectData['rows'][0], $limit));
     $this->assignRef('rows', $projectData['rows'][3]);
     //$this->assignRef( 'emphasis', $emphasis );
     $this->assignRef('published', $published);
     $this->assignRef('search', $search);
     $this->pagination = new JPagination($projectData['rows'][0], $limitstart, $limit);
     parent::display();
 }