當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Default_Model_Users::getDepartmentAddress方法代碼示例

本文整理匯總了PHP中Default_Model_Users::getDepartmentAddress方法的典型用法代碼示例。如果您正苦於以下問題:PHP Default_Model_Users::getDepartmentAddress方法的具體用法?PHP Default_Model_Users::getDepartmentAddress怎麽用?PHP Default_Model_Users::getDepartmentAddress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Default_Model_Users的用法示例。


在下文中一共展示了Default_Model_Users::getDepartmentAddress方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: comviewAction

 public function comviewAction()
 {
     if (defined('EMPTABCONFIGS')) {
         $empOrganizationTabs = explode(",", EMPTABCONFIGS);
         if (in_array('empcommunicationdetails', $empOrganizationTabs)) {
             $auth = Zend_Auth::getInstance();
             $empdata = array();
             $empDeptdata = array();
             $empDept = '';
             if ($auth->hasIdentity()) {
                 $loginUserId = $auth->getStorage()->read()->id;
             }
             $id = $this->getRequest()->getParam('userid');
             if ($id == '') {
                 $id = $loginUserId;
             }
             $callval = $this->getRequest()->getParam('call');
             if ($callval == 'ajaxcall') {
                 $this->_helper->layout->disableLayout();
             }
             $objName = 'empcommunicationdetails';
             $empcommdetailsform = new Default_Form_empcommunicationdetails();
             $empcommdetailsform->removeElement("submit");
             $elements = $empcommdetailsform->getElements();
             if (count($elements) > 0) {
                 foreach ($elements as $key => $element) {
                     if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
                         $element->setAttrib("disabled", "disabled");
                     }
                 }
             }
             try {
                 if ($id) {
                     $employeeModal = new Default_Model_Employee();
                     $empdata = $employeeModal->getsingleEmployeeData($id);
                     if ($empdata == 'norows') {
                         $this->view->rowexist = "norows";
                         $this->view->empdata = "";
                     } else {
                         $this->view->rowexist = "rows";
                         if (!empty($empdata)) {
                             $empDept = $empdata[0]['department_id'];
                             $empcommdetailsModal = new Default_Model_Empcommunicationdetails();
                             $usersModel = new Default_Model_Users();
                             $countriesModel = new Default_Model_Countries();
                             $statesmodel = new Default_Model_States();
                             $citiesmodel = new Default_Model_Cities();
                             $orgInfoModel = new Default_Model_Organisationinfo();
                             $msgarray = array();
                             $deptModel = new Default_Model_Departments();
                             if ($empDept != '' && $empDept != 'NULL') {
                                 $departmentAddress = $usersModel->getDepartmentAddress($empDept);
                             } else {
                                 $departmentAddress = $usersModel->getOrganizationAddress($empDept);
                             }
                             $data = $empcommdetailsModal->getsingleEmpCommDetailsData($id);
                             if (!empty($data)) {
                                 if ($data[0]['perm_country'] != '') {
                                     $countrieslistArr = $countriesModel->getCountryCode($data[0]['perm_country']);
                                     if (sizeof($countrieslistArr) > 0) {
                                         $empcommdetailsform->perm_country->addMultiOption('', 'Select Country');
                                         foreach ($countrieslistArr as $countrieslistres) {
                                             $empcommdetailsform->perm_country->addMultiOption($countrieslistres['id'], $countrieslistres['country_name']);
                                         }
                                     }
                                 }
                                 if ($data[0]['perm_country'] != '') {
                                     $statePermlistArr = $statesmodel->getStatesList($data[0]['perm_country']);
                                     if (sizeof($statePermlistArr) > 0) {
                                         $empcommdetailsform->perm_state->addMultiOption('', 'Select State');
                                         foreach ($statePermlistArr as $statelistres) {
                                             $empcommdetailsform->perm_state->addMultiOption($statelistres['id'] . '!@#' . $statelistres['state_name'], $statelistres['state_name']);
                                         }
                                     }
                                 }
                                 if ($data[0]['perm_state'] != '') {
                                     $cityPermlistArr = $citiesmodel->getCitiesList($data[0]['perm_state']);
                                     if (sizeof($cityPermlistArr) > 0) {
                                         $empcommdetailsform->perm_city->addMultiOption('', 'Select City');
                                         foreach ($cityPermlistArr as $cityPermlistres) {
                                             $empcommdetailsform->perm_city->addMultiOption($cityPermlistres['id'] . '!@#' . $cityPermlistres['city_name'], $cityPermlistres['city_name']);
                                         }
                                     }
                                 }
                                 if ($data[0]['current_country'] != '' && $data[0]['current_state'] != '') {
                                     $countriesArr = $countriesModel->getCountryCode($data[0]['current_country']);
                                     if (sizeof($countriesArr) > 0) {
                                         $empcommdetailsform->current_country->addMultiOption('', 'Select Country');
                                         foreach ($countriesArr as $countrieslistres) {
                                             $empcommdetailsform->current_country->addMultiOption($countrieslistres['id'], $countrieslistres['country_name']);
                                         }
                                     }
                                     $statecurrlistArr = $statesmodel->getStatesList($data[0]['current_country']);
                                     if (sizeof($statecurrlistArr) > 0) {
                                         $empcommdetailsform->current_state->addMultiOption('', 'Select State');
                                         foreach ($statecurrlistArr as $statecurrlistres) {
                                             $empcommdetailsform->current_state->addMultiOption($statecurrlistres['id'] . '!@#' . $statecurrlistres['state_name'], $statecurrlistres['state_name']);
                                         }
                                     }
                                     $currstateNameArr = $statesmodel->getStateName($data[0]['current_state']);
//.........這裏部分代碼省略.........
開發者ID:lukkyrich,項目名稱:sentrifugo,代碼行數:101,代碼來源:MyemployeesController.php

示例2: communicationAction

 public function communicationAction()
 {
     if (defined('EMPTABCONFIGS')) {
         $empOrganizationTabs = explode(",", EMPTABCONFIGS);
         if (in_array('empcommunicationdetails', $empOrganizationTabs)) {
             $empdata = array();
             $departmentAddress = array();
             $tabName = "communication";
             $emptyFlag = 0;
             $auth = Zend_Auth::getInstance();
             if ($auth->hasIdentity()) {
                 $loginUserId = $auth->getStorage()->read()->id;
                 $id = $loginUserId;
                 $employeeModal = new Default_Model_Employee();
                 $empdata = $employeeModal->getsingleEmployeeData($id);
                 if ($empdata == 'norows') {
                     $this->view->rowexist = "norows";
                     $this->view->empdata = "";
                 } else {
                     if (!empty($empdata)) {
                         $this->view->rowexist = "rows";
                         $empcommdetailsform = new Default_Form_empcommunicationdetails();
                         $empcommdetailsModal = new Default_Model_Empcommunicationdetails();
                         $usersModel = new Default_Model_Users();
                         $countriesModel = new Default_Model_Countries();
                         $statesmodel = new Default_Model_States();
                         $citiesmodel = new Default_Model_Cities();
                         $countrieslistArr = $countriesModel->getTotalCountriesList();
                         $msgarray = array();
                         //Department address
                         $deptId = $empdata[0]['department_id'];
                         if ($deptId != '' && $deptId != '') {
                             $departmentAddress = $usersModel->getDepartmentAddress($deptId);
                         } else {
                             $departmentAddress = $usersModel->getOrganizationAddress();
                         }
                         if (!empty($countrieslistArr)) {
                             $empcommdetailsform->perm_country->addMultiOption('', 'Select Country');
                             $empcommdetailsform->current_country->addMultiOption('', 'Select Country');
                             foreach ($countrieslistArr as $countrieslistres) {
                                 $empcommdetailsform->perm_country->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
                                 $empcommdetailsform->current_country->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
                             }
                         } else {
                             $msgarray['perm_country'] = 'Countries are not configured yet';
                             $msgarray['current_country'] = 'Countries are not configured yet';
                             $emptyFlag++;
                         }
                         //login Employee communication details.....
                         $data = $empcommdetailsModal->getsingleEmpCommDetailsData($loginUserId);
                         if (!empty($data)) {
                             $statePermlistArr = $statesmodel->getStatesList($data[0]['perm_country']);
                             if (sizeof($statePermlistArr) > 0) {
                                 $empcommdetailsform->perm_state->addMultiOption('', 'Select State');
                                 foreach ($statePermlistArr as $statelistres) {
                                     $empcommdetailsform->perm_state->addMultiOption($statelistres['id'] . '!@#' . $statelistres['state_name'], $statelistres['state_name']);
                                 }
                             }
                             $cityPermlistArr = $citiesmodel->getCitiesList($data[0]['perm_state']);
                             if (sizeof($cityPermlistArr) > 0) {
                                 $empcommdetailsform->perm_city->addMultiOption('', 'Select City');
                                 foreach ($cityPermlistArr as $cityPermlistres) {
                                     $empcommdetailsform->perm_city->addMultiOption($cityPermlistres['id'] . '!@#' . $cityPermlistres['city_name'], $cityPermlistres['city_name']);
                                 }
                             }
                             if ($data[0]['current_country'] != '' && $data[0]['current_state'] != '') {
                                 $statecurrlistArr = $statesmodel->getStatesList($data[0]['current_country']);
                                 if (sizeof($statecurrlistArr) > 0) {
                                     $empcommdetailsform->current_state->addMultiOption('', 'Select State');
                                     foreach ($statecurrlistArr as $statecurrlistres) {
                                         $empcommdetailsform->current_state->addMultiOption($statecurrlistres['id'] . '!@#' . $statecurrlistres['state_name'], $statecurrlistres['state_name']);
                                     }
                                 }
                                 $currstateNameArr = $statesmodel->getStateName($data[0]['current_state']);
                             }
                             if ($data[0]['current_country'] != '' && $data[0]['current_state'] != '' && $data[0]['current_city'] != '') {
                                 $cityCurrlistArr = $citiesmodel->getCitiesList($data[0]['current_state']);
                                 if (sizeof($cityCurrlistArr) > 0) {
                                     $empcommdetailsform->current_city->addMultiOption('', 'Select State');
                                     foreach ($cityCurrlistArr as $cityCurrlistres) {
                                         $empcommdetailsform->current_city->addMultiOption($cityCurrlistres['id'] . '!@#' . $cityCurrlistres['city_name'], $cityCurrlistres['city_name']);
                                     }
                                 }
                                 $currcityNameArr = $citiesmodel->getCityName($data[0]['current_city']);
                             }
                             $permstateNameArr = $statesmodel->getStateName($data[0]['perm_state']);
                             $permcityNameArr = $citiesmodel->getCityName($data[0]['perm_city']);
                             $empcommdetailsform->populate($data[0]);
                             $empcommdetailsform->setDefault('perm_country', $data[0]['perm_country']);
                             $empcommdetailsform->setDefault('perm_state', $permstateNameArr[0]['id'] . '!@#' . $permstateNameArr[0]['statename']);
                             $empcommdetailsform->setDefault('perm_city', $permcityNameArr[0]['id'] . '!@#' . $permcityNameArr[0]['cityname']);
                             if ($data[0]['current_country'] != '') {
                                 $empcommdetailsform->setDefault('current_country', $data[0]['current_country']);
                             }
                             if ($data[0]['current_state'] != '') {
                                 $empcommdetailsform->setDefault('current_state', $currstateNameArr[0]['id'] . '!@#' . $currstateNameArr[0]['statename']);
                             }
                             if ($data[0]['current_city'] != '') {
                                 $empcommdetailsform->setDefault('current_city', $currcityNameArr[0]['id'] . '!@#' . $currcityNameArr[0]['cityname']);
                             }
//.........這裏部分代碼省略.........
開發者ID:lukkyrich,項目名稱:sentrifugo,代碼行數:101,代碼來源:MydetailsController.php


注:本文中的Default_Model_Users::getDepartmentAddress方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。