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


PHP Default_Model_Employee::getMngmntEmployees方法代碼示例

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


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

示例1: changeorgheadAction


//.........這裏部分代碼省略.........
                 }
                 if ($employeeId == '') {
                     $msgarray['employeeId'] = 'Identity codes are not configured yet.';
                     $flag = 'false';
                 }
                 if ($emprole == '') {
                     $msgarray['emprole'] = 'Please select role.';
                     $flag = 'false';
                 }
                 if ($emailaddress == '') {
                     $msgarray['emailaddress'] = 'Please enter email.';
                     $flag = 'false';
                 }
                 if ($date_of_joining == '') {
                     $msgarray['date_of_joining_head'] = 'Please select date of joining.';
                     $flag = 'false';
                 }
             }
             if ($form->isValid($this->_request->getPost()) && $flag != 'false') {
                 $emppassword = sapp_Global::generatePassword();
                 $jobtitle_id = $this->_request->getParam('jobtitle_id', null);
                 $position_id = $this->_request->getParam('position_id', null);
                 $userfullname = $first_name . ' ' . $last_name;
                 $prefix_id = $this->_request->getParam('prefix_id', null);
                 $user_id = $this->_request->getParam('user_id', null);
                 $old_org_head = array('reporting_manager' => $orghead_repmangr, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'is_orghead' => 0);
                 $old_org_where = array('user_id=?' => $org_user_id);
                 if ($selectedtab == 1) {
                     $new_org_head = array('reporting_manager' => 0, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'is_orghead' => 1);
                     $new_org_where = array('user_id=?' => $currentorghead);
                 } else {
                     $user_data = array('emprole' => $emprole, 'firstname' => $first_name, 'lastname' => $last_name, 'userfullname' => $userfullname, 'emailaddress' => $emailaddress, 'jobtitle_id' => $jobtitle_id, 'emppassword' => md5($emppassword), 'employeeId' => $employeeId, 'selecteddate' => $date_of_joining, 'userstatus' => 'old', 'modeofentry' => 'Direct', 'createdby' => $loginUserId, 'createddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'isactive' => 1);
                     $emp_data = array('jobtitle_id' => $jobtitle_id, 'position_id' => $position_id, 'prefix_id' => $prefix_id, 'reporting_manager' => 0, 'date_of_joining' => $date_of_joining, 'createdby' => $loginUserId, 'createddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'isactive' => 1, 'is_orghead' => 1);
                 }
                 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 = '';
                 }
                 $user_data['employeeId'] = $emp_id;
                 $db = Zend_Db_Table::getDefaultAdapter();
                 $db->beginTransaction();
                 try {
                     $employeeModal->SaveorUpdateEmployeeData($old_org_head, $old_org_where);
                     if ($selectedtab == 1) {
                         $employeeModal->SaveorUpdateEmployeeData($new_org_head, $new_org_where);
                     } else {
                         $user_id = $user_model->SaveorUpdateUserData($user_data, '');
                         $emp_data['user_id'] = $user_id;
                         $employeeModal->SaveorUpdateEmployeeData($emp_data, '');
                     }
                     $tableid = $user_id;
                     $actionflag = 1;
                     $menuID = EMPLOYEE;
                     $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
                     $db->commit();
                     //Sending mails to SuperAdmin,Management Employees
                     $mangmntEmployees = $employeeModal->getMngmntEmployees();
                     //Preparing Employee array for Bcc
                     $empArr = array();
                     if (!empty($mangmntEmployees)) {
                         $empArrList = '';
                         $org_head_name = '';
                         foreach ($mangmntEmployees as $emp) {
                             array_push($empArr, $emp['emailaddress']);
                             if ($selectedtab == 1 && $currentorghead == $emp['user_id']) {
                                 $org_head_name = $emp['userfullname'];
                             }
                         }
                     }
                     $new_org_head_name = $org_head_name == '' ? $userfullname : $org_head_name;
                     $options['subject'] = APPLICATION_NAME . ': New Organizaion Head';
                     $options['header'] = 'New organization head';
                     $options['toEmail'] = SUPERADMIN_EMAIL;
                     $options['toName'] = 'Super Admin';
                     $options['bcc'] = $empArr;
                     $options['message'] = "<div style='padding: 0; text-align: left; font-size:14px; font-family:Arial, Helvetica, sans-serif;'>\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span style='color:#3b3b3b;'>Hi,</span><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='padding:20px 0 0 0;color:#3b3b3b;'><b>{$new_org_head_name}</b> is our new organization head. </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div style='padding:20px 0 10px 0;'>Please <a href=" . BASE_URL . " target='_blank' style='color:#b3512f;'>click here</a> to login  to your <b>" . APPLICATION_NAME . "</b> account to check the details.</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div> ";
                     $mail_id = sapp_Global::_sendEmail($options);
                     $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Organization head changed succesfully."));
                     $this->_redirect('employee');
                 } catch (Exception $e) {
                     $db->rollBack();
                 }
             } else {
                 $messages = $form->getMessages();
                 foreach ($messages as $key => $val) {
                     foreach ($val as $key2 => $val2) {
                         $msgarray[$key] = $val2;
                         break;
                     }
                 }
             }
         }
         $this->view->form = $form;
         $this->view->orgheadsData = $orgheadsData;
         $this->view->msgarray = $msgarray;
     } else {
         $this->_redirect('error');
     }
 }
開發者ID:rajbrt,項目名稱:sentrifugo,代碼行數:101,代碼來源:EmployeeController.php


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