Beispiel #1
0
 function LayDSDuAn($param)
 {
     $field = 'id,ten';
     $condition = 'hien_thi_ra_ngoai=1';
     $orderby = '';
     if ($param->get('ma_so', '0') != '0') {
         $orderby .= 'id ' . $param->get('ma_so', 'ASC');
     }
     if ($param->get('thu_tu', '0') != '0') {
         if ($orderby != '') {
             $orderby .= ',';
         }
         $orderby .= 'ordering ' . $param->get('thu_tu', 'ASC');
     }
     if ($param->get('noi_bat', '0') != '0') {
         if ($orderby != '') {
             $orderby .= ',';
         }
         $orderby .= 'noi_bat ' . $param->get('noi_bat', 'ASC');
     }
     if ($param->get('moi_nhat', '0') != '0') {
         if ($orderby != '') {
             $orderby .= ',';
         }
         $orderby .= 'moi_nhat ' . $param->get('moi_nhat', 'ASC');
     }
     $pagesize = $param->get('so_duan', '10');
     $DBConfig = ilandCommonUtils::getSiteDBConfig();
     $lang = ilandCommonUtils::getLanguage();
     $dsduan = iland4_layDanhSachDuAn($DBConfig, $field, $condition, 1, $pagesize, $orderby, $lang);
     return $dsduan;
 }
Beispiel #2
0
 function getProject(&$params)
 {
     $returnField = U_ReConfig::getValueByKey('SLIDESHOWIMAGE', 'slide_show_list_return_field');
     $limit = U_ReConfig::getValueByKey('SLIDESHOWIMAGE', 'list_limit');
     $orderby = U_ReConfig::getValueByKey('SLIDESHOWIMAGE', 'orderby');
     $limitstart =& JRequest::getVar('limitstart', 0);
     $page = ($limitstart + $limit) / $limit;
     $language = ilandCommonUtils::getLanguage();
     $DBConfig = ilandCommonUtils::getSiteDBConfig();
     $conditionParams = ' hien_thi_ra_ngoai=1 AND noi_bat=1 ';
     $rows = iland4_layDanhSachDuAn($DBConfig, $returnField, $conditionParams, $page, $limit, $orderby, $language);
     return $rows[3];
 }
 function layMaSo($table = 'bat_dong_san')
 {
     $language = ilandCommonUtils::getLanguage();
     $DBConfig = ilandCommonUtils::getSiteDBConfig();
     switch ($table) {
         case 'bat_dong_san':
             $value = iland4_layDanhSachBDS($DBConfig, 'MAX(id) AS id', '1', 1, 1, '', $language);
             break;
         case 'du_an':
             $value = iland4_layDanhSachDuAn($DBConfig, 'MAX(id) AS id', '1', 1, 1, '', $language);
             break;
     }
     $stt = $value[3][0]['id'];
     if ($stt == NULL) {
         $stt = 0;
     }
     return $stt + 1;
 }
Beispiel #4
0
 function laydanhsachduanmulti($quanHuyenId = null, $tinhThanhId = null, $lang = 'vi')
 {
     // return id & name
     $DBConfig = ilandCommonUtils::getSiteDBConfig();
     $paramfield = 'id, ten, alias';
     $page = 1;
     $limit = 10000;
     $condition = ' 1 ';
     if (!empty($quanHuyenId)) {
         $condition .= ' AND quan_huyen_id in (' . $quanHuyenId . ' )';
     }
     if (!empty($tinhThanhId)) {
         $condition .= ' AND tinh_thanh_id = ' . $tinhThanhId . ' ';
     }
     $orderby = 'ten';
     $language = 'vi';
     $result = iland4_layDanhSachDuAn($DBConfig, $paramfield, $condition, $page, $limit, $orderby, $language);
     return $result[3];
 }
Beispiel #5
0
 function getListProjects($returnField, $page, $limit)
 {
     $result = array();
     $context = 'com_jea.projects';
     $mainframe =& JFactory::getApplication();
     $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();
     $offsetLimitArr = ilandCommonUtils::getOffsetLimit($page, $limit);
     $DBConfig = ilandCommonUtils::getSiteDBConfig();
     $conditionParams = '1';
     //gan tam
     if ($emphasis != -1) {
         $conditionParams .= ' AND noi_bat = ' . $emphasis;
     }
     if ($published != -1) {
         $conditionParams .= ' AND hien_thi_ra_ngoai = ' . $published;
     }
     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 . '"';
     }
     $result['search'] = $search;
     $result['town_id'] = $town_id;
     $result['area_id'] = $area_id;
     $result['published'] = $published;
     $result['emphasis'] = $emphasis;
     $result['type_id'] = $type_id;
     //$result['rows'] = iland4_layDanhSachDuAn($DBConfig, $returnField, $conditionParams , $offsetLimitArr, $limit, $language);	//
     $result['rows'] = iland4_layDanhSachDuAn($DBConfig, $returnField, $conditionParams, $page, $limit, $orderby, $language);
     return $result;
 }