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(); }
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(); }