本文整理匯總了PHP中Default_Model_Usermanagement::getRefferedByForUsers方法的典型用法代碼示例。如果您正苦於以下問題:PHP Default_Model_Usermanagement::getRefferedByForUsers方法的具體用法?PHP Default_Model_Usermanagement::getRefferedByForUsers怎麽用?PHP Default_Model_Usermanagement::getRefferedByForUsers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Default_Model_Usermanagement
的用法示例。
在下文中一共展示了Default_Model_Usermanagement::getRefferedByForUsers方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: indexAction
public function indexAction()
{
$editPrivilege = "";
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $loginUserId;
$data = array();
$tabName = "employee";
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$employeeform = new Default_Form_employee();
try {
if ($id != '' && $id > 0) {
$employeeModal = new Default_Model_Employee();
$usersModel = new Default_Model_Users();
$employmentstatusModel = new Default_Model_Employmentstatus();
$busineesUnitModel = new Default_Model_Businessunits();
$deptModel = new Default_Model_Departments();
$role_model = new Default_Model_Roles();
$user_model = new Default_Model_Usermanagement();
$candidate_model = new Default_Model_Candidatedetails();
$jobtitlesModel = new Default_Model_Jobtitles();
$positionsmodel = new Default_Model_Positions();
$prefix_model = new Default_Model_Prefix();
$data = $employeeModal->getsingleEmployeeData($id);
if ($data == 'norows') {
$this->view->rowexist = "norows";
$this->view->empdata = "";
} else {
if (!empty($data)) {
$this->view->rowexist = "rows";
$this->view->empdata = $data;
$elements = $employeeform->getElements();
if (count($elements) > 0) {
foreach ($elements as $key => $element) {
if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
$element->setAttrib("disabled", "disabled");
}
}
}
$employeeform->removeElement("submit");
$data = $data[0];
if ($loginUserId == SUPERADMIN) {
//If login user is superAdmin..... role is 'Super Admin'.
$employeeform->emprole->addMultiOption('superAdmin', 'Super Admin');
} else {
$roles_arr = $role_model->getRolesDataByID($data['emprole']);
if (sizeof($roles_arr) > 0) {
$employeeform->emprole->addMultiOption($roles_arr[0]['id'] . '_' . $roles_arr[0]['group_id'], utf8_encode($roles_arr[0]['rolename']));
}
}
$prefix_data = $prefix_model->getsinglePrefixData($data['prefix_id']);
if ($prefix_data != 'norows') {
$prefix_data = $prefix_data[0];
$employeeform->prefix_id->addMultiOption($prefix_data['id'], $prefix_data['prefix']);
}
$referedby_options = $user_model->getRefferedByForUsers();
/* Code for reporting manager dropdown */
$reportingManagerData = $usersModel->getUserDetailsByID($data['reporting_manager']);
if (!empty($reportingManagerData)) {
$employeeform->reporting_manager->addMultiOption($reportingManagerData[0]['id'], $reportingManagerData[0]['userfullname']);
}
$employmentStatusData = $employmentstatusModel->getempstatuslist();
if (sizeof($employmentStatusData) > 0) {
$employeeform->emp_status_id->addMultiOption('', 'Select a Employment Status');
foreach ($employmentStatusData as $employmentStatusres) {
$employeeform->emp_status_id->addMultiOption($employmentStatusres['workcodename'], $employmentStatusres['statusname']);
}
}
$businessunitData = $busineesUnitModel->getDeparmentList();
if (sizeof($businessunitData) > 0) {
$employeeform->businessunit_id->addMultiOption('0', 'No Business Unit');
foreach ($businessunitData as $businessunitres) {
$employeeform->businessunit_id->addMultiOption($businessunitres['id'], $businessunitres['unitname']);
}
}
$departmentsData = $deptModel->getDepartmentList($data['businessunit_id']);
if (sizeof($departmentsData) > 0) {
$employeeform->department_id->addMultiOption('', 'Select a Department');
foreach ($departmentsData as $departmentsres) {
$employeeform->department_id->addMultiOption($departmentsres['id'], $departmentsres['deptname']);
}
}
$jobtitleData = $jobtitlesModel->getJobTitleList();
if (sizeof($jobtitleData) > 0) {
$employeeform->jobtitle_id->addMultiOption('', 'Select a Job Title');
foreach ($jobtitleData as $jobtitleres) {
$employeeform->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
}
}
$positionlistArr = $positionsmodel->getPositionList($data['jobtitle_id']);
if (sizeof($positionlistArr) > 0) {
$employeeform->position_id->addMultiOption('', 'Select a Position');
foreach ($positionlistArr as $positionlistres) {
$employeeform->position_id->addMultiOption($positionlistres['id'], $positionlistres['positionname']);
}
//.........這裏部分代碼省略.........
示例2: viewAction
public function viewAction()
{
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$objName = 'employee';
$employeeform = new Default_Form_employee();
$employeeform->removeElement("submit");
$elements = $employeeform->getElements();
if (count($elements) > 0) {
foreach ($elements as $key => $element) {
if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
$element->setAttrib("disabled", "disabled");
}
}
}
if ($id) {
$employeeModal = new Default_Model_Employee();
$usersModel = new Default_Model_Users();
$employmentstatusModel = new Default_Model_Employmentstatus();
$busineesUnitModel = new Default_Model_Businessunits();
$deptModel = new Default_Model_Departments();
$role_model = new Default_Model_Roles();
$user_model = new Default_Model_Usermanagement();
$candidate_model = new Default_Model_Candidatedetails();
$jobtitlesModel = new Default_Model_Jobtitles();
$positionsmodel = new Default_Model_Positions();
$prefixModel = new Default_Model_Prefix();
$data = $employeeModal->getsingleEmployeeData($id);
if ($data == 'norows') {
$this->view->rowexist = "norows";
} else {
if (!empty($data)) {
$this->view->rowexist = "rows";
$data = $data[0];
$employeeData = $employeeModal->getsingleEmployeeData($data['user_id']);
$roles_arr = $role_model->getRolesDataByID($data['emprole']);
if (sizeof($roles_arr) > 0) {
$employeeform->emprole->addMultiOption($roles_arr[0]['id'] . '_' . $roles_arr[0]['group_id'], utf8_encode($roles_arr[0]['rolename']));
}
$referedby_options = $user_model->getRefferedByForUsers();
$reportingManagerData = $usersModel->getReportingManagerList($data['department_id'], $data['id'], $roles_arr[0]['group_id']);
if (!empty($reportingManagerData)) {
$employeeform->reporting_manager->addMultiOption('', 'Select a Reporting Manager');
if ($roles_arr[0]['group_id'] == MANAGEMENT_GROUP) {
$employeeform->reporting_manager->addMultiOption(SUPERADMIN, 'Super Admin');
}
foreach ($reportingManagerData as $reportingManagerres) {
$employeeform->reporting_manager->addMultiOption($reportingManagerres['id'], $reportingManagerres['name']);
}
}
$employeeform->setDefault('reporting_manager', $data['reporting_manager']);
$employmentStatusData = $employmentstatusModel->getempstatuslist();
if (sizeof($employmentStatusData) > 0) {
$employeeform->emp_status_id->addMultiOption('', 'Select a Employment Status');
foreach ($employmentStatusData as $employmentStatusres) {
$employeeform->emp_status_id->addMultiOption($employmentStatusres['workcodename'], $employmentStatusres['statusname']);
}
}
$businessunitData = $busineesUnitModel->getDeparmentList();
if (sizeof($businessunitData) > 0) {
$employeeform->businessunit_id->addMultiOption('0', 'No Business Unit');
foreach ($businessunitData as $businessunitres) {
$employeeform->businessunit_id->addMultiOption($businessunitres['id'], $businessunitres['unitname']);
}
}
$departmentsData = $deptModel->getDepartmentList($data['businessunit_id']);
if (sizeof($departmentsData) > 0) {
$employeeform->department_id->addMultiOption('', 'Select a Department');
foreach ($departmentsData as $departmentsres) {
$employeeform->department_id->addMultiOption($departmentsres['id'], $departmentsres['deptname']);
}
}
$jobtitleData = $jobtitlesModel->getJobTitleList();
if (sizeof($jobtitleData) > 0) {
$employeeform->jobtitle_id->addMultiOption('', 'Select a Job Title');
foreach ($jobtitleData as $jobtitleres) {
$employeeform->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
}
}
$positionlistArr = $positionsmodel->getPositionList($data['jobtitle_id']);
if (sizeof($positionlistArr) > 0) {
$employeeform->position_id->addMultiOption('', 'Select a Position');
foreach ($positionlistArr as $positionlistres) {
$employeeform->position_id->addMultiOption($positionlistres['id'], $positionlistres['positionname']);
}
}
if (isset($data['prefix_id']) && $data['prefix_id'] != '') {
$singlePrefixArr = $prefixModel->getsinglePrefixData($data['prefix_id']);
if ($singlePrefixArr != 'norows') {
$employeeform->prefix_id->addMultiOption($singlePrefixArr[0]['id'], $singlePrefixArr[0]['prefix']);
}
}
$employeeform->populate($data);
$employeeform->setDefault('user_id', $data['user_id']);
$employeeform->setDefault('emp_status_id', $data['emp_status_id']);
$employeeform->setDefault('businessunit_id', $data['businessunit_id']);
$employeeform->setDefault('jobtitle_id', $data['jobtitle_id']);
//.........這裏部分代碼省略.........
示例3: modeempOnchange
/**
* This function acts as a service for onchange of mode of employment to get candidates or referers.
* @param array $params_arr = array of parameters
* @return array Array of options.
*/
public function modeempOnchange($params_arr)
{
$result = array();
$status = 0;
$message = "Invalid mode of employment.";
if (isset($params_arr['role_id']) && $params_arr['role_id'] != '' && isset($params_arr['group_id']) && $params_arr['group_id'] != '' && isset($params_arr['modeofentry']) && $params_arr['modeofentry'] != '' && isset($params_arr['userid']) && $params_arr['userid'] != '') {
$role_id = $params_arr['role_id'];
$group_id = $params_arr['group_id'];
$userid = $params_arr['userid'];
$modeofentry = $params_arr['modeofentry'];
if ($role_id == SUPERADMINROLE || $group_id == MANAGEMENT_GROUP || $group_id == HR_GROUP) {
$privilege_flag = sapp_Global::_checkprivileges(EMPLOYEE, $group_id, $role_id, 'add');
if ($privilege_flag == 'Yes') {
if ($modeofentry == "Interview" || $modeofentry == 'Other') {
$candidate_model = new Default_Model_Candidatedetails();
$candidate_options = $candidate_model->getCandidatesNamesForUsers();
$candidate_str = sapp_Global::selectOptionBuilder("", "Select Candidate");
//echo "<pre>";print_r($candidate_options);echo "</pre>";
if (!empty($candidate_options)) {
$status = 1;
$message = "success";
foreach ($candidate_options as $id => $name) {
$candidate_str .= sapp_Global::selectOptionBuilder($id, $name);
}
} else {
$status = 0;
$message = "No selected candidates.";
}
$result['candidates'] = $candidate_str;
} else {
if ($modeofentry == "Reference") {
$user_model = new Default_Model_Usermanagement();
$referedby_options = $user_model->getRefferedByForUsers();
$refered_str = sapp_Global::selectOptionBuilder("", "Select Referred By");
//echo "<pre>";print_r($candidate_options);echo "</pre>";
if (!empty($referedby_options)) {
$status = 1;
$message = "success";
foreach ($referedby_options as $id => $name) {
$refered_str .= sapp_Global::selectOptionBuilder($id, $name);
}
} else {
$status = 0;
$message = "Employees are not added yet.";
}
$result['referred_by'] = $refered_str;
}
}
}
}
}
return array('status' => $status, 'message' => $message, 'result' => $result);
}