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


PHP Default_Model_Employee::getEmployeesForOrgHead方法代碼示例

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


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

示例1: addorgheadAction

 public function addorgheadAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     $org_id = $this->_request->getParam('orgid', null);
     $msgarray = array();
     $prevorgheadId = '';
     $posted_prevorghead_rm = '';
     try {
         $user_model = new Default_Model_Usermanagement();
         $orgInfoModel = new Default_Model_Organisationinfo();
         $countriesModel = new Default_Model_Countries();
         $statesmodel = new Default_Model_States();
         $citiesmodel = new Default_Model_Cities();
         $role_model = new Default_Model_Roles();
         $prefixModel = new Default_Model_Prefix();
         $identity_code_model = new Default_Model_Identitycodes();
         $jobtitlesModel = new Default_Model_Jobtitles();
         $employeeModal = new Default_Model_Employee();
         $positionsmodel = new Default_Model_Positions();
         $form = new Default_Form_Organisationhead();
         $form->setAttrib('action', BASE_URL . 'organisationinfo/addorghead/orgid/' . $org_id);
         $identity_codes = $identity_code_model->getIdentitycodesRecord();
         $role_data = $role_model->getRolesList_orginfo();
         $flag = 'true';
         $emp_identity_code = isset($identity_codes[0]) ? $identity_codes[0]['employee_code'] : "";
         if ($emp_identity_code != '') {
             $emp_id = $emp_identity_code . str_pad($user_model->getMaxEmpId($emp_identity_code), 4, '0', STR_PAD_LEFT);
         } else {
             $emp_id = '';
             $msgarray['employeeId'] = 'Identity codes are not configured yet.';
             $flag = 'false';
         }
         $form->employeeId->setValue($emp_id);
         $form->emprole->addMultiOptions(array('' => 'Select Role') + $role_data);
         if (empty($role_data)) {
             $msgarray['emprole'] = 'Roles are not added yet.';
             $flag = 'false';
         }
         $prefixData = $prefixModel->getPrefixList();
         $form->prefix_id->addMultiOption('', 'Select Prefix');
         if (!empty($prefixData)) {
             foreach ($prefixData as $prefixres) {
                 $form->prefix_id->addMultiOption($prefixres['id'], $prefixres['prefix']);
             }
         } else {
             $msgarray['prefix_id'] = 'Prefixes are not configured yet.';
         }
         $jobtitleData = $jobtitlesModel->getJobTitleList();
         if (!empty($jobtitleData)) {
             foreach ($jobtitleData as $jobtitleres) {
                 $form->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
             }
         } else {
             $msgarray['jobtitle_id'] = 'Job titles are not configured yet.';
             $msgarray['position_id'] = 'Positions are not configured yet.';
         }
         $form->position_id->addMultiOption('', 'Select a Position');
         if (isset($_POST['jobtitle_id']) && $_POST['jobtitle_id'] != '') {
             $jobtitle_id = $_POST['jobtitle_id'];
             $positionlistArr = $positionsmodel->getPositionList($jobtitle_id);
             if (sizeof($positionlistArr) > 0) {
                 foreach ($positionlistArr as $positionlistres) {
                     $form->position_id->addMultiOption($positionlistres['id'], $positionlistres['positionname']);
                 }
             }
         }
         if (isset($_POST['prevorghead_rm']) && $_POST['prevorghead_rm'] != '') {
             $posted_prevorghead_rm = $_POST['prevorghead_rm'];
         }
         $orgheadsData = $employeeModal->getEmployeesForOrgHead();
         $emp_data = $employeeModal->fetchRow("is_orghead = 1");
         if (!empty($emp_data)) {
             $user_data = $user_model->fetchRow("id = " . $emp_data->user_id);
             if (!empty($user_data)) {
                 $prevorgheadId = $user_data->id;
             } else {
                 $form->removeElement('prevorghead_rm');
             }
         } else {
             $form->removeElement('prevorghead_rm');
         }
         if ($this->getRequest()->getPost()) {
             if ($form->isValid($this->_request->getPost()) && $flag != 'false') {
                 $jobtitle_id = $this->_request->getParam('jobtitle_id', null);
                 $position_id = $this->_request->getParam('position_id', null);
                 $date_of_joining = sapp_Global::change_date($this->_request->getParam('date_of_joining_head', null), 'database');
                 $employeeId = $this->_request->getParam('employeeId', null);
                 $emprole = $this->_request->getParam('emprole', null);
                 $emailaddress = $this->_request->getParam('emailaddress', null);
                 $emppassword = sapp_Global::generatePassword();
                 $first_name = trim($this->_request->getParam('firstname_orghead', null));
                 $last_name = trim($this->_request->getParam('lastname_orghead', null));
                 //$userfullname = trim($this->_request->getParam('orghead',null));
                 $userfullname = $first_name . ' ' . $last_name;
//.........這裏部分代碼省略.........
開發者ID:rajbrt,項目名稱:sentrifugo,代碼行數:101,代碼來源:OrganisationinfoController.php

示例2: changeorgheadAction

 public function changeorgheadAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     $org_user_id = (int) $this->getRequest()->getParam('orgid');
     $form = new Default_Form_Organisationheadchange();
     $user_model = new Default_Model_Usermanagement();
     $role_model = new Default_Model_Roles();
     $prefixModel = new Default_Model_Prefix();
     $identity_code_model = new Default_Model_Identitycodes();
     $jobtitlesModel = new Default_Model_Jobtitles();
     $employeeModal = new Default_Model_Employee();
     $positionsmodel = new Default_Model_Positions();
     $msgarray = array();
     $orgheadsData = array();
     $form->setAttrib('action', BASE_URL . 'employee/changeorghead/orgid/' . $org_user_id);
     if ($org_user_id) {
         $orgheadsData = $employeeModal->getEmployeesForOrgHead($org_user_id);
     }
     if (empty($orgheadsData)) {
         $msgarray['currentorghead'] = 'There are no employees added to assign to the current organization head.';
     }
     //echo '<pre>';print_r($orgheadsData);exit;
     $identity_codes = $identity_code_model->getIdentitycodesRecord();
     $role_data = $role_model->getRolesList_orginfo();
     $flag = 'true';
     $emp_identity_code = isset($identity_codes[0]) ? $identity_codes[0]['employee_code'] : "";
     if ($emp_identity_code != '') {
         $emp_id = $emp_identity_code . str_pad($user_model->getMaxEmpId($emp_identity_code), 4, '0', STR_PAD_LEFT);
     } else {
         $emp_id = '';
         $msgarray['employeeId'] = 'Identity codes are not configured yet.';
         $flag = 'false';
     }
     $form->employeeId->setValue($emp_id);
     $form->emprole->addMultiOptions(array('' => 'Select Role') + $role_data);
     if (empty($role_data)) {
         $msgarray['emprole'] = 'Roles are not added yet.';
         $flag = 'false';
     }
     $prefixData = $prefixModel->getPrefixList();
     $form->prefix_id->addMultiOption('', 'Select Prefix');
     if (!empty($prefixData)) {
         foreach ($prefixData as $prefixres) {
             $form->prefix_id->addMultiOption($prefixres['id'], $prefixres['prefix']);
         }
     } else {
         $msgarray['prefix_id'] = 'Prefixes are not configured yet.';
     }
     $jobtitleData = $jobtitlesModel->getJobTitleList();
     if (!empty($jobtitleData)) {
         foreach ($jobtitleData as $jobtitleres) {
             $form->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
         }
     } else {
         $msgarray['jobtitle_id'] = 'Job titles are not configured yet.';
         $msgarray['position_id'] = 'Positions are not configured yet.';
     }
     $form->position_id->addMultiOption('', 'Select a Position');
     if (isset($_POST['jobtitle_id']) && $_POST['jobtitle_id'] != '') {
         $jobtitle_id = $_POST['jobtitle_id'];
         $positionlistArr = $positionsmodel->getPositionList($jobtitle_id);
         if (sizeof($positionlistArr) > 0) {
             foreach ($positionlistArr as $positionlistres) {
                 $form->position_id->addMultiOption($positionlistres['id'], $positionlistres['positionname']);
             }
         }
     }
     if ($this->getRequest()->getPost()) {
         $orghead_repmangr = $this->_request->getParam('orghead_rep_manger', null);
         $selectedtab = $this->_request->getParam('selectedtab');
         $currentorghead = $this->_request->getParam('currentorghead', null);
         $first_name = trim($this->_request->getParam('firstname_orghead', null));
         $last_name = trim($this->_request->getParam('lastname_orghead', null));
         $date_of_joining = sapp_Global::change_date($this->_request->getParam('date_of_joining_head', null), 'database');
         $employeeId = $this->_request->getParam('employeeId', null);
         $emprole = $this->_request->getParam('emprole', null);
         $emailaddress = $this->_request->getParam('emailaddress', null);
         if ($orghead_repmangr == '') {
             $msgarray['orghead_rep_manger'] = 'Please select reporting manager to current organisation head.';
             $flag = 'false';
         }
         if ($selectedtab == 1) {
             if ($currentorghead == '') {
                 $msgarray['currentorghead'] = 'Please select current organisation head.';
                 $flag = 'false';
             }
         } else {
             if ($first_name == '') {
                 $msgarray['firstname_orghead'] = 'Please enter first name of organization head.';
                 $flag = 'false';
             }
             if ($last_name == '') {
                 $msgarray['lastname_orghead'] = 'Please enter last name of organization head.';
                 $flag = 'false';
             }
//.........這裏部分代碼省略.........
開發者ID:sura2k,項目名稱:sentrifugo,代碼行數:101,代碼來源:EmployeeController.php

示例3: changeorgheadAction

 public function changeorgheadAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     if ($loginuserRole == SUPERADMIN || $loginuserGroup == MANAGEMENT_GROUP || $loginuserGroup == HR_GROUP) {
         $org_user_id = (int) $this->getRequest()->getParam('orgid');
         $form = new Default_Form_Organisationheadchange();
         $user_model = new Default_Model_Usermanagement();
         $role_model = new Default_Model_Roles();
         $prefixModel = new Default_Model_Prefix();
         $identity_code_model = new Default_Model_Identitycodes();
         $jobtitlesModel = new Default_Model_Jobtitles();
         $employeeModal = new Default_Model_Employee();
         $positionsmodel = new Default_Model_Positions();
         $msgarray = array();
         $orgheadsData = array();
         $form->setAttrib('action', BASE_URL . 'employee/changeorghead/orgid/' . $org_user_id);
         if ($org_user_id) {
             $orgheadsData = $employeeModal->getEmployeesForOrgHead($org_user_id);
         }
         if (empty($orgheadsData)) {
             $msgarray['currentorghead'] = 'There are no employees added to assign to the current organization head.';
         }
         $identity_codes = $identity_code_model->getIdentitycodesRecord();
         $role_data = $role_model->getRolesList_orginfo();
         $flag = 'true';
         $emp_identity_code = isset($identity_codes[0]) ? $identity_codes[0]['employee_code'] : "";
         if ($emp_identity_code != '') {
             $emp_id = $emp_identity_code . str_pad($user_model->getMaxEmpId($emp_identity_code), 4, '0', STR_PAD_LEFT);
         } else {
             $emp_id = '';
             $msgarray['employeeId'] = 'Identity codes are not configured yet.';
             $flag = 'false';
         }
         $form->employeeId->setValue($emp_id);
         $form->emprole->addMultiOptions(array('' => 'Select Role') + $role_data);
         if (empty($role_data)) {
             $msgarray['emprole'] = 'Roles are not added yet.';
             $flag = 'false';
         }
         $prefixData = $prefixModel->getPrefixList();
         $form->prefix_id->addMultiOption('', 'Select Prefix');
         if (!empty($prefixData)) {
             foreach ($prefixData as $prefixres) {
                 $form->prefix_id->addMultiOption($prefixres['id'], $prefixres['prefix']);
             }
         } else {
             $msgarray['prefix_id'] = 'Prefixes are not configured yet.';
         }
         $jobtitleData = $jobtitlesModel->getJobTitleList();
         if (!empty($jobtitleData)) {
             foreach ($jobtitleData as $jobtitleres) {
                 $form->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
             }
         } else {
             $msgarray['jobtitle_id'] = 'Job titles are not configured yet.';
             $msgarray['position_id'] = 'Positions are not configured yet.';
         }
         $form->position_id->addMultiOption('', 'Select a Position');
         if (isset($_POST['jobtitle_id']) && $_POST['jobtitle_id'] != '') {
             $jobtitle_id = $_POST['jobtitle_id'];
             $positionlistArr = $positionsmodel->getPositionList($jobtitle_id);
             if (sizeof($positionlistArr) > 0) {
                 foreach ($positionlistArr as $positionlistres) {
                     $form->position_id->addMultiOption($positionlistres['id'], $positionlistres['positionname']);
                 }
             }
         }
         if ($this->getRequest()->getPost()) {
             $orghead_repmangr = $this->_request->getParam('orghead_rep_manger', null);
             $selectedtab = $this->_request->getParam('selectedtab');
             $currentorghead = $this->_request->getParam('currentorghead', null);
             $first_name = trim($this->_request->getParam('firstname_orghead', null));
             $last_name = trim($this->_request->getParam('lastname_orghead', null));
             $date_of_joining = sapp_Global::change_date($this->_request->getParam('date_of_joining_head', null), 'database');
             $employeeId = $this->_request->getParam('employeeId', null);
             $emprole = $this->_request->getParam('emprole', null);
             $emailaddress = $this->_request->getParam('emailaddress', null);
             if ($orghead_repmangr == '') {
                 $msgarray['orghead_rep_manger'] = 'Please select reporting manager to current organisation head.';
                 $flag = 'false';
             }
             if ($selectedtab == 1) {
                 if ($currentorghead == '') {
                     $msgarray['currentorghead'] = 'Please select current organisation head.';
                     $flag = 'false';
                 }
             } else {
                 if ($first_name == '') {
                     $msgarray['firstname_orghead'] = 'Please enter first name of organization head.';
                     $flag = 'false';
                 }
                 if ($last_name == '') {
                     $msgarray['lastname_orghead'] = 'Please enter last name of organization head.';
                     $flag = 'false';
                 }
//.........這裏部分代碼省略.........
開發者ID:rajbrt,項目名稱:sentrifugo,代碼行數:101,代碼來源:EmployeeController.php


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