本文整理汇总了PHP中sapp_Global::buildlocations方法的典型用法代码示例。如果您正苦于以下问题:PHP sapp_Global::buildlocations方法的具体用法?PHP sapp_Global::buildlocations怎么用?PHP sapp_Global::buildlocations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sapp_Global
的用法示例。
在下文中一共展示了sapp_Global::buildlocations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configureorganisationAction
public function configureorganisationAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$popConfigPermission = array();
$new_stateId = '';
if (sapp_Global::_checkprivileges(COUNTRIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'country');
}
if (sapp_Global::_checkprivileges(STATES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'state');
}
if (sapp_Global::_checkprivileges(CITIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'city');
}
$msgarray = array();
$new_stateId = '';
$new_cityId = '';
$id = $this->getRequest()->getParam('id');
$form = new Default_Form_Organisationinfo();
$orgInfoModel = new Default_Model_Organisationinfo();
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$wizard_model = new Default_Model_Wizard();
$wizardData = $wizard_model->getWizardData();
$orginfodata = $orgInfoModel->getOrganisationInfo();
$allCountriesData = $countriesModel->fetchAll('isactive=1', 'country')->toArray();
$allStatesData = $statesmodel->fetchAll('isactive=1', 'state')->toArray();
$allCitiesData = $citiesmodel->fetchAll('isactive=1', 'city')->toArray();
$form->setAttrib('action', DOMAIN . 'wizard/configureorganisation');
$flag = 'true';
if (empty($allCountriesData)) {
$msgarray['country'] = 'Countries are not configured yet.';
$flag = 'false';
}
if (empty($allStatesData)) {
$msgarray['state'] = 'States are not configured yet.';
$flag = 'false';
}
if (empty($allCitiesData)) {
$msgarray['city'] = 'Cities are not configured yet.';
$flag = 'false';
}
if (!empty($orginfodata)) {
try {
$data = $orginfodata[0];
$data['org_startdate'] = sapp_Global::change_date($data['org_startdate'], 'view');
$form->populate($data);
$countryId = $data['country'];
$stateId = $data['state'];
$cityId = $data['city'];
$actionpage = 'edit';
if (count($_POST) > 0) {
$countryId = isset($_POST['country']) ? $_POST['country'] : "";
$stateId = isset($_POST['state']) ? $_POST['state'] : "";
$cityId = isset($_POST['city']) ? $_POST['city'] : "";
}
if ($countryId != '') {
$statesData = $statesmodel->getBasicStatesList((int) $countryId);
foreach ($statesData as $res) {
if ($stateId == $res['state_id_org']) {
$new_stateId = $res['state_id_org'] . '!@#' . utf8_encode($res['state']);
}
$form->state->addMultiOption($res['state_id_org'] . '!@#' . utf8_encode($res['state']), utf8_encode($res['state']));
}
if (count($_POST) == 0) {
$stateId = $new_stateId;
}
}
if ($stateId != '') {
$citiesData = $citiesmodel->getBasicCitiesList((int) $stateId);
foreach ($citiesData as $res) {
if ($cityId == $res['city_org_id']) {
$new_cityId = $res['city_org_id'] . '!@#' . utf8_encode($res['city']);
}
$form->city->addMultiOption($res['city_org_id'] . '!@#' . utf8_encode($res['city']), utf8_encode($res['city']));
}
if (count($_POST) == 0) {
$cityId = $new_cityId;
}
}
$form->setDefault('country', $countryId);
$form->setDefault('state', $stateId);
$form->setDefault('city', $cityId);
$this->view->domainValue = $data['domain'];
$this->view->org_image = $data['org_image'];
$this->view->ermsg = '';
$this->view->datarr = $data;
} catch (Exception $e) {
$this->view->ermsg = 'nodata';
}
} else {
sapp_Global::buildlocations($form, $wizardData);
}
$this->view->form = $form;
//.........这里部分代码省略.........