} else { echo global_common::convertToXML($arrHeader, array("rs"), array(0), array(0)); return; } } else { echo global_common::convertToXML($arrHeader, array("rs", 'info'), array(0, global_common::STRING_REQUIRE_LOGIN), array(0, 1)); } return; } elseif ($_pgR['act'] == model_City::ACT_CHANGE_PAGE) { $intPage = $_pgR['p']; $outPutHTML = $objCity->getListCity($intPage); echo global_common::convertToXML($strMessageHeader, array('rs', 'inf'), array(1, $outPutHTML), array(0, 1)); return; } elseif ($_pgR['act'] == model_City::ACT_SHOW_EDIT) { $strCityID = $_pgR['id']; $arrCity = $objCity->getCityByID($strCityID); echo global_common::convertToXML($strMessageHeader, array('rs', 'CityID', 'CityName', 'Status'), array(1, 'CityID', 'CityName', 'Status'), array(0, 1, 1, 1)); return; } elseif ($_pgR["act"] == model_City::ACT_GET) { $sectionID = $_pgR["sect"]; $arrSection = $objMenu->getAllMenuBySection($sectionID); if ($arrSection) { $strHTML = $objMenu->outputHTMLMenu($arrSection); echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, $strHTML), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array("rs", 'inf'), array(0, 'Kh?ng c? nh?m h?ng'), array(0, 0)); return; } } elseif ($_pgR['act'] == model_City::ACT_DELETE) { $IDName = "menu_id";
public function actionAfter() { parent::actionAfter(); $aCurrentCity = Model_City::getCityByID($this->iCurrCityID); $this->assign('aCurrentCity', $aCurrentCity); $this->_assignUrl(); }
public function getRetailerByID($objID, $selectField = '*') { $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, self::TBL_SL_RETAILER, 'WHERE RetailerID = \'' . $objID . '\' ')); //echo '<br>SQL:'.$strSQL; $arrResult = $this->_objConnection->selectCommand($strSQL); if (!$arrResult) { global_common::writeLog('get sl_retailer ByID:' . $strSQL, 1, $_mainFrame->pPage); return null; } $retailer = $arrResult[0]; $objStatus = new Model_Status($this->_objConnection); $objCity = new Model_City($this->_objConnection); $city = $objCity->getCityByID($retailer[global_mapping::CityID]); $retailer[global_mapping::CityName] = $city[global_mapping::CityName]; $status = $objStatus->getStatusByID($retailer[global_mapping::ProductStatusID]); $retailer[global_mapping::StatusName] = $status[global_mapping::StatusName]; //print_r($arrResult); return $retailer; }
public function getUserByID($objID, $selectField = '*') { $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, self::TBL_SL_USER, 'WHERE UserID = \'' . $objID . '\' ')); //echo '<br>SQL:'.$strSQL; $arrResult = $this->_objConnection->selectCommand($strSQL); if (!$arrResult) { global_common::writeLog('get sl_user ByID:' . $strSQL, 1, $_mainFrame->pPage); return null; } $objCity = new Model_City($this->_objConnection); $city = $objCity->getCityByID($arrResult[0][global_mapping::CityID]); $arrResult[0][global_mapping::CityName] = $city[global_mapping::CityName]; //print_r($arrResult); if (!$arrResult[0][global_mapping::Avatar]) { if ($arrResult[0][global_mapping::Sex]) { $arrResult[0][global_mapping::Avatar] = global_common::DEFAUTL_MALE_AVATAR; } else { $arrResult[0][global_mapping::Avatar] = global_common::DEFAUTL_FEMALE_AVATAR; } } return $arrResult[0]; }
public function getStoreByID($objID, $selectField = '*') { $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, self::TBL_SL_STORE, 'WHERE StoreID = \'' . $objID . '\' ')); //echo '<br>SQL:'.$strSQL; $arrResult = $this->_objConnection->selectCommand($strSQL); if (!$arrResult) { global_common::writeLog('get sl_store ByID:' . $strSQL, 1, $_mainFrame->pPage); return null; } $objCity = new Model_City($this->_objConnection); $objDistrict = new Model_District($this->_objConnection); $district = $objDistrict->getDistrictByID($arrResult[0][global_mapping::DistrictID]); $arrResult[0][global_mapping::DistrictName] = $district[global_mapping::DistrictName]; $city = $objCity->getCityByID($arrResult[0][global_mapping::CityID]); $arrResult[0][global_mapping::CityName] = $city[global_mapping::CityName]; $objArticle = new Model_Article($this->_objConnection); $arrArticle = $objArticle->getArticleByStoreID($objID); $arrResult[0]["Articles"] = $arrArticle; $arrResult[0][global_mapping::CheckIn] = global_common::getTotalRecord(self::TBL_SL_CHECKIN, $this->_objConnection, 'where StoreID = \'' . $objID . '\''); //print_r($arrResult); return $arrResult[0]; }