当前位置: 首页>>代码示例>>PHP>>正文


PHP Default_Model_Users类代码示例

本文整理汇总了PHP中Default_Model_Users的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Users类的具体用法?PHP Default_Model_Users怎么用?PHP Default_Model_Users使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Default_Model_Users类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: editPasswordAction

 public function editPasswordAction()
 {
     $account = new Default_Model_Users();
     $account->find(Zend_Registry::get('user')->getId());
     $form = new Default_Form_EditPassword();
     $form->editPassword();
     $form->setDecorators(array('ViewScript', array('ViewScript', array('viewScript' => 'forms/users/edit-password.phtml'))));
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $post = $this->getRequest()->getPost();
             if (md5($post['oldPassword']) == $account->getPassword()) {
                 $account->setPassword(md5($post['password']));
                 if ($account->save()) {
                     $this->_flashMessenger->addMessage("<div class='success  canhide'><p>" . Zend_Registry::get('translate')->_('password_change_success_message') . "</p><a href='javascript:;'></a></div>");
                 } else {
                     $this->_flashMessenger->addMessage("<div class='failure canhide'><p>" . Zend_Registry::get('translate')->_('administrators_edit_password_error_message') . "</p><a href='javascript:;'></a></div>");
                 }
             } else {
                 $this->_flashMessenger->addMessage("<div class='failure canhide'><p>" . Zend_Registry::get('translate')->_('administrators_invalid_old_password') . "</p><a href='javascript:;'></a></div>");
             }
             $this->_redirect(WEBROOT . 'settings/edit-password');
         }
     }
 }
开发者ID:valizr,项目名称:MMA,代码行数:25,代码来源:SettingsController.php

示例2: getCreateProjectsData

 /**
  * 
  * @param type $sort
  * @param type $by
  * @param type $pageNo
  * @param type $perPage
  * @param type $searchQuery
  * @return type
  */
 public function getCreateProjectsData($sort, $by, $pageNo, $perPage, $searchQuery)
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     /*
      * 1. only for - Login User is part of Project creator, Primary Admin or Secondary Admin
      * 2. only for - Login User's Business Unit Projects
      */
     $usersModel = new Default_Model_Users();
     $loginUserSummary = $usersModel->getEmployeeSummaryByID($loginUserId);
     $where = " (b.isactive = 1) AND (b.businessunit=" . $loginUserSummary['businessunit_id'] . ") ";
     if ($loginuserGroup != MANAGEMENT_GROUP && $loginuserGroup != MANAGER_GROUP) {
         $where .= " AND (b.primarylead = " . $loginUserId . " OR b.secondarylead = " . $loginUserId . " or createdby = " . $loginUserId . ") ";
     }
     if ($searchQuery) {
         $where .= " AND (" . $searchQuery . ")";
     } else {
         $where .= " AND (b.status = 5)";
     }
     $db = Zend_Db_Table::getDefaultAdapter();
     $businessunitsdata = $this->select()->setIntegrityCheck(false)->from(array('b' => 'main_timemanagement_projects'), array('id' => 'b.id', 'projectname' => 'b.projectname', 'description' => 'b.description', 'startdate' => 'date_format(b.startdate,"' . DATEFORMAT_MYSQL . '")', 'enddate' => 'date_format(b.enddate,"' . DATEFORMAT_MYSQL . '")', 'effort' => 'b.effort'))->where($where)->order("{$by} {$sort}")->limitPage($pageNo, $perPage);
     return $businessunitsdata;
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:36,代码来源:Createprojects.php

示例3: getProjectTasksData

 /**
  * 
  * @param type $sort
  * @param type $by
  * @param type $pageNo
  * @param type $perPage
  * @param type $searchQuery
  * @return type
  */
 public function getProjectTasksData($sort, $by, $pageNo, $perPage, $searchQuery)
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     /*
      * 1. only for - Login User is part of Project/Task  creator, Primary Admin or Secondary Admin
      * 2. only for - Login User's Business Unit Projects
      */
     $usersModel = new Default_Model_Users();
     $loginUserSummary = $usersModel->getEmployeeSummaryByID($loginUserId);
     $where = " (b.isactive = 1 and a.isactive = 1) AND (a.businessunit=" . $loginUserSummary['businessunit_id'] . ") ";
     if ($loginuserGroup != MANAGEMENT_GROUP && $loginuserGroup != MANAGER_GROUP) {
         $where .= " AND (b.primarylead = " . $loginUserId . " OR b.secondarylead = " . $loginUserId . " or b.createdby = " . $loginUserId . " or a.primarylead = " . $loginUserId . " OR a.secondarylead = " . $loginUserId . " or a.createdby = " . $loginUserId . ") ";
     }
     //        if ($searchData != '' && $searchData != 'undefined') {
     //            $searchValues = json_decode($searchData);
     //            foreach ($searchValues as $searchQuery =>$key)
     //            if ($searchQuery=='startdate') {
     //                $where .= " AND (" . $searchQuery . ")";
     //            }
     //        }
     $where = " b.isactive = 1 ";
     if ($searchQuery) {
         $where .= " AND " . $searchQuery;
     }
     $db = Zend_Db_Table::getDefaultAdapter();
     $businessunitsdata = $this->select()->setIntegrityCheck(false)->from(array('b' => 'main_timemanagement_project_tasks'), array('id' => 'b.id', 'taskname' => 'b.taskname', 'description' => 'b.description', 'effort' => 'b.effort', 'startdate' => 'date_format(b.startdate,"' . DATEFORMAT_MYSQL . '")', 'enddate' => 'date_format(b.enddate,"' . DATEFORMAT_MYSQL . '")'))->joinLeft(array('a' => 'main_timemanagement_projects'), "a.id=b.projectid ", array('projectname' => 'a.projectname'))->where($where)->order("{$by} {$sort}")->limitPage($pageNo, $perPage);
     return $businessunitsdata;
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:42,代码来源:Createtasks.php

示例4: init

 function init()
 {
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'share-file', 'class' => ''));
     $action = new Zend_Form_Element_Hidden('action');
     $action->setValue('sharefile');
     $this->addElement($action);
     $idFile = new Zend_Form_Element_Hidden('idFile');
     $idFile->setValue(Zend_Controller_Front::getInstance()->getRequest()->getParam('id'));
     $this->addElement($idFile);
     //BEGIN:Users
     $idUserTo = new Zend_Form_Element_Select('idUserTo');
     $idUserTo->setLabel('To: ');
     $options = array('' => 'Select user');
     $shops = new Default_Model_Users();
     $select = $shops->getMapper()->getDbTable()->select()->where('id != ?', Zend_Registry::get('user')->getId())->where('NOT deleted')->order('name DESC');
     $result = $shops->fetchAll($select);
     if (NULL != $result) {
         foreach ($result as $value) {
             $options[$value->getId()] = $value->getName();
         }
     }
     $idUserTo->addMultiOptions($options);
     $idUserTo->addValidator(new Zend_Validate_InArray(array_keys($options)));
     $idUserTo->setAttribs(array('class' => 'validate[required] form_selector_fm', 'id' => 'idUserTo'));
     $idUserTo->setRequired(true);
     $this->addElement($idUserTo);
     //END:Users
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Subject');
     $subject->setAttribs(array('class' => 'form_subject w_424 validate[required]', 'placeholder' => 'Subject'));
     $subject->setRequired(true);
     $this->addElement($subject);
     $message = new Zend_Form_Element_Textarea('message');
     $message->setLabel('Observations');
     $message->setAttribs(array('class' => 'form_textarea w_424 h_97 validate[required]', 'placeholder' => 'Observations', 'style' => 'width:290px'));
     $message->setRequired(true);
     $this->addElement($message);
     $button = new Zend_Form_Element_Submit('rightSubmit');
     $button->setValue('SEND');
     $button->setAttribs(array('class' => 'comments_submit'));
     $button->setIgnore(true);
     $this->addElement($button);
 }
开发者ID:valizr,项目名称:MMA,代码行数:44,代码来源:ShareFile.php

示例5: addAction

 public function addAction()
 {
     if (defined('EMPTABCONFIGS')) {
         $empOrganizationTabs = explode(",", EMPTABCONFIGS);
         if (in_array('visadetails', $empOrganizationTabs)) {
             $auth = Zend_Auth::getInstance();
             $data = array();
             if ($auth->hasIdentity()) {
                 $loginUserId = $auth->getStorage()->read()->id;
             }
             $id = $this->getRequest()->getParam('userid');
             $employeeModal = new Default_Model_Employee();
             $isrowexist = $employeeModal->getsingleEmployeeData($id);
             if ($isrowexist == 'norows') {
                 $this->view->rowexist = "norows";
             } else {
                 $this->view->rowexist = "rows";
             }
             $empdata = $employeeModal->getActiveEmployeeData($id);
             if (!empty($empdata)) {
                 $visaandimmigrationDetailsform = new Default_Form_Visaandimmigrationdetails();
                 $visaandimmigrationdetailsModel = new Default_Model_Visaandimmigrationdetails();
                 if ($id) {
                     $usersModel = new Default_Model_Users();
                     $employeeData = $usersModel->getUserDetailsByIDandFlag($id);
                     $this->view->id = $id;
                     $visaandimmigrationDetailsform->setAttrib('action', BASE_URL . 'visaandimmigrationdetails/add/userid/' . $id);
                 }
                 $this->view->form = $visaandimmigrationDetailsform;
                 $this->view->employeedata = $employeeData[0];
                 $this->view->data = $data;
                 if ($this->getRequest()->getPost()) {
                     $result = $this->save($visaandimmigrationDetailsform);
                     $this->view->msgarray = $result;
                 }
             }
             $this->view->empdata = $empdata;
         } else {
             $this->_redirect('error');
         }
     } else {
         $this->_redirect('error');
     }
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:44,代码来源:VisaandimmigrationdetailsController.php

示例6: _checkstatus

 public static function _checkstatus()
 {
     $auth = Zend_Auth::getInstance();
     $usersmodel = new Default_Model_Users();
     $flag = 'all';
     $isactivestatus = 1;
     $temporarylock = 0;
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         if ($loginUserId) {
             $loggedinEmpId = $usersmodel->getUserDetailsByID($loginUserId, $flag);
         }
     }
     if (!empty($loggedinEmpId)) {
         $isactivestatus = $loggedinEmpId[0]['isactive'];
         $temporarylock = $loggedinEmpId[0]['emptemplock'];
     }
     if ($isactivestatus == 1 && $temporarylock == 0) {
         return 'true';
     } else {
         return 'false';
     }
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:23,代码来源:Global.php

示例7: edit

 function edit(Default_Model_Users $model)
 {
     $this->name->setValue($model->getName());
     $this->name->setLabel(Zend_Registry::get('translate')->_('admin_name'));
     $this->accountName->setValue($model->getAccountName());
     $this->accountName->setLabel(Zend_Registry::get('translate')->_('admin_account_name'));
     $this->email->setValue($model->getEmail());
     $this->email->setLabel(Zend_Registry::get('translate')->_('admin_email'));
     $emailValidateDbNotExists = $this->email->getValidator('Zend_Validate_Db_NoRecordExists');
     $emailValidateDbNotExists->setExclude(array('field' => 'email', 'value' => $model->getEmail()));
     $this->idRole->setValue($model->getIdRole());
     $this->idRole->setLabel(Zend_Registry::get('translate')->_('admin_level'));
     $this->add->setValue(Zend_Registry::get('translate')->_('admin_edit_user'));
 }
开发者ID:valizr,项目名称:MMA,代码行数:14,代码来源:Users.php

示例8: editAction

 public function editAction()
 {
     $auth = Zend_Auth::getInstance();
     $role_datap = array();
     $empGroup = "";
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserRole = $auth->getStorage()->read()->emprole;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
         $loginuserUnitID = $auth->getStorage()->read()->businessunit_id;
         $loginuserDeptID = $auth->getStorage()->read()->department_id;
     }
     $id = (int) $this->getRequest()->getParam('id');
     $id = abs($id);
     if ($id == '') {
         $id = $loginUserId;
     }
     $callval = $this->getRequest()->getParam('call');
     if ($callval == 'ajaxcall') {
         $this->_helper->layout->disableLayout();
     }
     $employeeform = new Default_Form_Myteamemployee();
     try {
         if ($id != '' && is_numeric($id) && $id > 0 && $id != $loginUserId) {
             $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 = array();
             $empDeptId = "";
             $empRoleId = "";
             $data = $employeeModal->getsingleEmployeeData($id);
             if ($data == 'norows') {
                 $this->view->rowexist = "norows";
             } else {
                 if (!empty($data)) {
                     $this->view->rowexist = "rows";
                     $employeeform->submit->setLabel('Update');
                     $data = $data[0];
                     /* Earlier code to fetch employee details */
                     $employeeData = $employeeModal->getsingleEmployeeData($id);
                     $roles_arr = $role_model->getRolesListByGroupID(EMPLOYEE_GROUP);
                     if (sizeof($roles_arr) > 0) {
                         $employeeform->emprole->addMultiOptions(array('' => 'Select Role') + $roles_arr);
                     }
                     $employmentStatusData = $employmentstatusModel->getempstatuslist();
                     if (sizeof($employmentStatusData) > 0) {
                         $employeeform->emp_status_id->addMultiOption('', 'Select Employment Status');
                         foreach ($employmentStatusData as $employmentStatusres) {
                             $employeeform->emp_status_id->addMultiOption($employmentStatusres['workcodename'], $employmentStatusres['statusname']);
                         }
                     }
                     $businessunitData = $busineesUnitModel->getDeparmentList();
                     if (sizeof($businessunitData) > 0) {
                         foreach ($businessunitData as $businessunitres) {
                             if ($businessunitres['id'] == $loginuserUnitID) {
                                 $employeeform->businessunit_id->addMultiOption($businessunitres['id'], $businessunitres['unitname']);
                             }
                         }
                     }
                     $departmentsData = $deptModel->getDepartmentList($data['businessunit_id']);
                     if (sizeof($departmentsData) > 0) {
                         foreach ($departmentsData as $departmentsres) {
                             if ($departmentsres['id'] == $loginuserDeptID) {
                                 $employeeform->department_id->addMultiOption($departmentsres['id'], $departmentsres['deptname']);
                             }
                         }
                     }
                     $jobtitleData = $jobtitlesModel->getJobTitleList();
                     if (sizeof($jobtitleData) > 0) {
                         $employeeform->jobtitle_id->addMultiOption('', 'Select 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 Position');
                         foreach ($positionlistArr as $positionlistres) {
                             $employeeform->position_id->addMultiOption($positionlistres['id'], $positionlistres['positionname']);
                         }
                     }
                     $prefixData = $prefixModel->getPrefixList();
                     if (!empty($prefixData)) {
                         foreach ($prefixData as $prefixres) {
                             $employeeform->prefix_id->addMultiOption($prefixres['id'], $prefixres['prefix']);
                         }
                     }
                     $userData = $usersModel->getUserDetails($loginUserId);
                     if (count($userData) > 0) {
                         $employeeform->reporting_manager->addMultiOption($userData[0]['id'], $userData[0]['userfullname']);
                     }
                     $employeeform->populate($data);
//.........这里部分代码省略.........
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:101,代码来源:MyemployeesController.php

示例9: viewAction

 public function viewAction()
 {
     if (defined('EMPTABCONFIGS')) {
         $empOrganizationTabs = explode(",", EMPTABCONFIGS);
         if (in_array('workeligibilitydetails', $empOrganizationTabs)) {
             $auth = Zend_Auth::getInstance();
             if ($auth->hasIdentity()) {
                 $loginUserId = $auth->getStorage()->read()->id;
             }
             $employeeData = array();
             $id = $this->getRequest()->getParam('userid');
             $callval = $this->getRequest()->getParam('call');
             if ($callval == 'ajaxcall') {
                 $this->_helper->layout->disableLayout();
             }
             $objName = 'workeligibilitydetails';
             $issuingauthority = '';
             $employeeModal = new Default_Model_Employee();
             $workeligibilityform = new Default_Form_Workeligibilitydetails();
             $workeligibilityform->removeElement("submit");
             $elements = $workeligibilityform->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 && is_numeric($id) && $id > 0 && $id != $loginUserId) {
                     $usersModel = new Default_Model_Users();
                     $empdata = $employeeModal->getActiveEmployeeData($id);
                     $employeeData = $usersModel->getUserDetailsByIDandFlag($id);
                     if ($empdata == 'norows') {
                         $this->view->rowexist = "norows";
                         $this->view->empdata = "";
                     } else {
                         $this->view->rowexist = "rows";
                         if (!empty($empdata)) {
                             $workeligibilityModel = new Default_Model_Workeligibilitydetails();
                             if ($id) {
                                 $usersModel = new Default_Model_Users();
                                 $workeligibilityDoctypesModal = new Default_Model_Workeligibilitydoctypes();
                                 $countriesModel = new Default_Model_Countries();
                                 $statesmodel = new Default_Model_States();
                                 $citiesmodel = new Default_Model_Cities();
                                 $countrieslistArr = $countriesModel->getTotalCountriesList();
                                 if (sizeof($countrieslistArr) > 0) {
                                     $workeligibilityform->issuingauth_country->addMultiOption('', 'Select Country');
                                     foreach ($countrieslistArr as $countrieslistres) {
                                         $workeligibilityform->issuingauth_country->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
                                     }
                                 } else {
                                     $msgarray['issuingauth_country'] = 'Countries are not configured yet.';
                                 }
                                 $data = $workeligibilityModel->getWorkEligibilityRecord($id);
                                 if (!empty($data) && isset($data)) {
                                     $countryId = $data[0]['issuingauth_country'];
                                     $stateId = $data[0]['issuingauth_state'];
                                     $cityId = $data[0]['issuingauth_city'];
                                     $documenttype_id = $data[0]['documenttype_id'];
                                     if ($countryId != '') {
                                         $statelistArr = $statesmodel->getStatesList($countryId);
                                         if (sizeof($statelistArr) > 0) {
                                             $workeligibilityform->issuingauth_state->addMultiOption('', 'Select State');
                                             foreach ($statelistArr as $statelistres) {
                                                 $workeligibilityform->issuingauth_state->addMultiOption($statelistres['id'] . '!@#' . $statelistres['state_name'], $statelistres['state_name']);
                                             }
                                         }
                                     }
                                     if ($stateId != '') {
                                         $citylistArr = $citiesmodel->getCitiesList($stateId);
                                         if (sizeof($citylistArr) > 0) {
                                             $workeligibilityform->issuingauth_city->addMultiOption('', 'Select City');
                                             foreach ($citylistArr as $cityPermlistres) {
                                                 $workeligibilityform->issuingauth_city->addMultiOption($cityPermlistres['id'] . '!@#' . $cityPermlistres['city_name'], $cityPermlistres['city_name']);
                                             }
                                         }
                                         $stateNameArr = $statesmodel->getStateName($stateId);
                                     }
                                     if ($cityId != '') {
                                         $cityNameArr = $citiesmodel->getCityName($cityId);
                                     }
                                     if ($documenttype_id != '') {
                                         $issuingauthorityArr = $workeligibilityDoctypesModal->getIssuingAuthority($documenttype_id);
                                     }
                                     if (!empty($issuingauthorityArr)) {
                                         $issuingauthority = $issuingauthorityArr[0]['issuingauthority'];
                                         $workeligibilityform->issuingauthflag->setValue($issuingauthority);
                                         $workeligibilityform->documenttype_id->addMultiOption($issuingauthorityArr[0]['id'], $issuingauthorityArr[0]['documenttype']);
                                     }
                                     $workeligibilityform->setDefault("id", $data[0]["id"]);
                                     $workeligibilityform->setDefault("user_id", $data[0]["user_id"]);
                                     $workeligibilityform->setDefault('issuingauth_country', $data[0]['issuingauth_country']);
                                     if (!empty($stateNameArr)) {
                                         $workeligibilityform->setDefault('issuingauth_state', $stateNameArr[0]['id'] . '!@#' . $stateNameArr[0]['statename']);
                                     }
                                     if (!empty($cityNameArr)) {
                                         $workeligibilityform->setDefault('issuingauth_city', $cityNameArr[0]['id'] . '!@#' . $cityNameArr[0]['cityname']);
                                     }
//.........这里部分代码省略.........
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:101,代码来源:WorkeligibilitydetailsController.php

示例10: viewAction

 public function viewAction()
 {
     if (defined('EMPTABCONFIGS')) {
         $empOrganizationTabs = explode(",", EMPTABCONFIGS);
         if (in_array('emp_additional', $empOrganizationTabs)) {
             $userID = "";
             $auth = Zend_Auth::getInstance();
             if ($auth->hasIdentity()) {
                 $loginUserId = $auth->getStorage()->read()->id;
                 $loginUserRole = $auth->getStorage()->read()->emprole;
                 $loginUserGroup = $auth->getStorage()->read()->group_id;
             }
             $id = $this->getRequest()->getParam('userid');
             $conText = '';
             $call = $this->_getParam('call');
             if ($call == 'ajaxcall') {
                 $this->_helper->layout->disableLayout();
                 $userID = $this->_getParam('unitId') != '' ? $this->_getParam('unitId') : $this->_getParam('userid');
                 $conText = $this->_getParam('context') != '' ? $this->_getParam('context') : $this->getRequest()->getParam('context');
             }
             if ($id == '') {
                 $id = $userID;
             }
             $Uid = $id ? $id : $userID;
             $employeeModal = new Default_Model_Employee();
             try {
                 if ($Uid && is_numeric($Uid) && $Uid > 0) {
                     $usersModel = new Default_Model_Users();
                     $empdata = $employeeModal->getActiveEmployeeData($Uid);
                     $employeeData = $usersModel->getUserDetailsByIDandFlag($Uid);
                     if ($empdata == 'norows') {
                         $this->view->rowexist = "norows";
                         $this->view->empdata = "";
                     } else {
                         $this->view->rowexist = "rows";
                         if (!empty($empdata)) {
                             $empadditionaldetailsModal = new Default_Model_Empadditionaldetails();
                             $view = Zend_Layout::getMvcInstance()->getView();
                             $objname = $this->_getParam('objname');
                             $refresh = $this->_getParam('refresh');
                             $dashboardcall = $this->_getParam('dashboardcall', null);
                             $data = array();
                             $searchQuery = '';
                             $searchArray = array();
                             $tablecontent = '';
                             if ($refresh == 'refresh') {
                                 if ($dashboardcall == 'Yes') {
                                     $perPage = DASHBOARD_PERPAGE;
                                 } else {
                                     $perPage = PERPAGE;
                                 }
                                 $sort = 'DESC';
                                 $by = 'e.modifieddate';
                                 $pageNo = 1;
                                 $searchData = '';
                                 $searchQuery = '';
                                 $searchArray = '';
                             } else {
                                 $sort = $this->_getParam('sort') != '' ? $this->_getParam('sort') : 'DESC';
                                 $by = $this->_getParam('by') != '' ? $this->_getParam('by') : 'e.modifieddate';
                                 if ($dashboardcall == 'Yes') {
                                     $perPage = $this->_getParam('per_page', DASHBOARD_PERPAGE);
                                 } else {
                                     $perPage = $this->_getParam('per_page', PERPAGE);
                                 }
                                 $pageNo = $this->_getParam('page', 1);
                                 $searchData = $this->_getParam('searchData');
                                 $searchData = rtrim($searchData, ',');
                             }
                             $dataTmp = $empadditionaldetailsModal->getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $Uid, $conText);
                             array_push($data, $dataTmp);
                             $this->view->dataArray = $data;
                             $this->view->call = $call;
                             $this->view->employeedata = $employeeData[0];
                             $this->view->id = $id;
                             $this->view->messages = $this->_helper->flashMessenger->getMessages();
                         }
                         $this->view->empdata = $empdata;
                     }
                 } else {
                     $this->view->rowexist = "norows";
                 }
             } catch (Exception $e) {
                 $this->view->rowexist = "norows";
             }
         } else {
             $this->_redirect('error');
         }
     } else {
         $this->_redirect('error');
     }
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:92,代码来源:EmpadditionaldetailsController.php

示例11: viewAction

 public function viewAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $leaverequestmodel = new Default_Model_Leaverequest();
     $id = $this->getRequest()->getParam('id');
     try {
         $useridArr = $leaverequestmodel->getUserID($id);
         if (!empty($useridArr)) {
             $user_id = $useridArr[0]['user_id'];
             if ($user_id == $loginUserId) {
                 $callval = $this->getRequest()->getParam('call');
                 if ($callval == 'ajaxcall') {
                     $this->_helper->layout->disableLayout();
                 }
                 $objName = 'pendingleaves';
                 $leaverequestform = new Default_Form_leaverequest();
                 $leaverequestform->removeElement("submit");
                 $elements = $leaverequestform->getElements();
                 if (count($elements) > 0) {
                     foreach ($elements as $key => $element) {
                         if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
                             $element->setAttrib("disabled", "disabled");
                         }
                     }
                 }
                 $data = $leaverequestmodel->getsinglePendingLeavesData($id);
                 $data = $data[0];
                 $getavailbaleleaves = $leaverequestmodel->getAvailableLeaves($loginUserId);
                 if (!empty($data) && $data['leavestatus'] == 'Approved') {
                     $employeeleavetypemodel = new Default_Model_Employeeleavetypes();
                     $usersmodel = new Default_Model_Users();
                     $employeeleavetypeArr = $employeeleavetypemodel->getsingleEmployeeLeavetypeData($data['leavetypeid']);
                     if ($employeeleavetypeArr != 'norows') {
                         $leaverequestform->leavetypeid->addMultiOption($employeeleavetypeArr[0]['id'], utf8_encode($employeeleavetypeArr[0]['leavetype']));
                     }
                     if ($data['leaveday'] == 1) {
                         $leaverequestform->leaveday->addMultiOption($data['leaveday'], 'Full Day');
                     } else {
                         $leaverequestform->leaveday->addMultiOption($data['leaveday'], 'Half Day');
                     }
                     $repmngrnameArr = $usersmodel->getUserDetailsByID($data['rep_mang_id'], 'all');
                     $leaverequestform->populate($data);
                     $from_date = sapp_Global::change_date($data["from_date"], 'view');
                     $to_date = sapp_Global::change_date($data["to_date"], 'view');
                     $appliedon = sapp_Global::change_date($data["createddate"], 'view');
                     $leaverequestform->from_date->setValue($from_date);
                     $leaverequestform->to_date->setValue($to_date);
                     $leaverequestform->createddate->setValue($appliedon);
                     $leaverequestform->appliedleavesdaycount->setValue($data['appliedleavescount']);
                     $leaverequestform->comments->setValue($data['approver_comments']);
                     if (!empty($repmngrnameArr)) {
                         $leaverequestform->rep_mang_id->setValue($repmngrnameArr[0]['userfullname']);
                     } else {
                         $leaverequestform->rep_mang_id->setValue('');
                     }
                     /*	if(!empty($getavailbaleleaves))
                     		 {
                     			$leaverequestform->no_of_days->setValue($getavailbaleleaves[0]['remainingleaves']);
                     		 }  */
                     $this->view->controllername = $objName;
                     $this->view->id = $id;
                     $this->view->form = $leaverequestform;
                     $this->view->data = $data;
                     $leaverequestform->setDefault('leavetypeid', $data['leavetypeid']);
                     $leaverequestform->setDefault('leaveday', $data['leaveday']);
                     $this->view->reportingmanagerStatus = !empty($repmngrnameArr) ? $repmngrnameArr[0]['isactive'] : '';
                 } else {
                     $this->view->rowexist = "rows";
                 }
             } else {
                 $this->view->rowexist = "rows";
             }
         } else {
             $this->view->rowexist = "norows";
         }
     } catch (Exception $e) {
         $this->view->rowexist = "norows";
     }
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:82,代码来源:ApprovedleavesController.php

示例12: viewAction

 public function viewAction()
 {
     if (defined('EMPTABCONFIGS')) {
         $empOrganizationTabs = explode(",", EMPTABCONFIGS);
         if (in_array('emp_performanceappraisal', $empOrganizationTabs)) {
             $auth = Zend_Auth::getInstance();
             if ($auth->hasIdentity()) {
                 $loginUserId = $auth->getStorage()->read()->id;
             }
             $userid = $this->getRequest()->getParam('userid');
             $employeeModal = new Default_Model_Employee();
             $isrowexist = $employeeModal->getsingleEmployeeData($userid);
             if ($isrowexist == 'norows') {
                 $this->view->rowexist = "norows";
             } else {
                 $this->view->rowexist = "rows";
             }
             $empdata = $employeeModal->getActiveEmployeeData($userid);
             if (!empty($empdata)) {
                 $empperformanceApprModel = new Default_Model_Empperformanceappraisal();
                 if ($userid) {
                     //To display Employee Profile information......
                     $usersModel = new Default_Model_Users();
                     $employeeData = $usersModel->getUserDetailsByIDandFlag($userid);
                 }
                 $this->view->id = $userid;
                 $this->view->employeedata = $employeeData[0];
                 if ($this->getRequest()->getPost()) {
                 }
             }
             $this->view->empdata = $empdata;
         } else {
             $this->_redirect('error');
         }
     } else {
         $this->_redirect('error');
     }
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:38,代码来源:EmpperformanceappraisalController.php

示例13: setIdUserTo

 public function setIdUserTo($value)
 {
     $model = new Default_Model_Users();
     $model->find($value);
     if ($model->getId() != NULL) {
         $this->setUserTo($model);
     }
     $this->_idUserTo = !empty($value) ? (int) $value : '0';
     return $this;
 }
开发者ID:valizr,项目名称:MMA,代码行数:10,代码来源:Messages.php

示例14: updatethemeAction

 public function updatethemeAction()
 {
     $this->_helper->layout->disableLayout();
     if ($this->getRequest()->isPost()) {
         $theme_name = $this->getRequest()->getParam('theme_name');
         $usersModel = new Default_Model_Users();
         $user_id = sapp_Global::_readSession('id');
         $where = array('id = ?' => $user_id);
         $data = array('themes' => $theme_name, 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s"));
         $usersModel->addOrUpdateUserModel($data, $where);
         sapp_Global::_writeSession('themes', $theme_name);
         $this->_helper->json(array('result' => 'success'));
     }
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:14,代码来源:IndexController.php

示例15: employeedetails

    public function employeedetails($emparr, $conText, $userId)
    {
        $session = new Zend_Auth_Storage_Session();
        $data = $session->read();
        $loggedinuser = $data['id'];
        $group_id = $data['group_id'];
        $empdata = '';
        $employeetabsStr = '';
        $empdata = '<div class="ml-alert-1-success" id="empdetailsmsgdiv" style="display:none;">';
        $empdata .= '<div class="style-1-icon success" style="display:block;"></div>';
        $empdata .= '<div id="successtext"></div>';
        $empdata .= '</div>';
        $empdata .= '<div class="all-bg-ctrl">';
        $employeeModal = new Default_Model_Employee();
        $employessunderEmpId = $employeeModal->getEmployeesUnderRM($userId);
        if (!empty($employessunderEmpId)) {
            $empdata .= '<input type="hidden" value="true" id="hasteam" name="hasteam" />';
        } else {
            $empdata .= '<input type="hidden" value="false" id="hasteam" name="hasteam" />';
        }
        if ($conText == 'edit' || $conText == 'view') {
            //If the user has BG status as "Yet to start" then we should enable the link....
            $usersModel = new Default_Model_Users();
            $bgstatusArr = $usersModel->getBGstatus($userId);
            if (!empty($bgstatusArr) && isset($bgstatusArr) && $bgstatusArr[0]['group_id'] != MANAGEMENT_GROUP) {
                if ($bgstatusArr[0]['isactive'] == 1) {
                    $empdata .= '<div id="hrbgchecklink" style="display:none;" class="action-to-page"><a href="' . BASE_URL . '/empscreening/checkscreeningstatus/empid/' . $userId . '">Send for background checks</a></div>';
                }
            }
        }
        if ($conText != 'mydetails') {
            $empdata .= '<div class="back-to-page"><input type="button" value="Back" name="Back" onclick="gobacktocontroller(\'' . $conText . '\');"></div>';
        }
        $empdata .= '<div class="emp-screen-view">';
        $empdata .= '<div class="display-img-div" id="displayimg" >';
        $empdata .= '<div class="employee-pic-emp">';
        if ($emparr['profileimg'] != '') {
            $empdata .= '<img id="userImage" src="' . BASE_URL . "/public/uploads/profile/" . $emparr['profileimg'] . '" onerror="this.src=\'' . BASE_URL . '/public/media/images/default-profile-pic.jpg\'"/>';
        } else {
            $empdata .= '<img id="userImage" src="' . BASE_URL . '/public/media/images/employee-deafult-pic.jpg" />';
        }
        if ($conText != 'mydetails') {
            if ($group_id == HR_GROUP || $loggedinuser == SUPERADMIN || $group_id == MANAGEMENT_GROUP) {
                $sel_act = $sel_dact = "";
                if ($emparr['isactive'] < 2 && $emparr['emptemplock'] == 0) {
                    if ($emparr['isactive'] == 1) {
                        $sel_act = "selected";
                    } else {
                        if ($emparr['isactive'] == 0) {
                            $sel_dact = "selected";
                        }
                    }
                    $empdata .= '<p class="field switch"><label class="cb-enable  ' . $sel_act . '"><span>Active</span></label><label class="cb-disable ' . $sel_dact . '"><span>Inactive</span></label> </p>';
                    if ($sel_act == "selected") {
                        $empdata .= "\n\t\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\t\$('.cb-disable').click(function(){              \n\t\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('inactive','" . $emparr['id'] . "');\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t</script> ";
                    } else {
                        if ($sel_dact == "selected") {
                            $empdata .= "\n\t\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\t\$('.cb-enable').click(function(){                \n\t\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('active','" . $emparr['id'] . "');\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t</script> ";
                        }
                    }
                } else {
                    if ($emparr['isactive'] < 2 && $emparr['emptemplock'] == 1) {
                        $sel_dact = "selected";
                        $sel_act = "";
                        $empdata .= '<p class="field switch"><label class="cb-enable  ' . $sel_act . '"><span>Active</span></label><label class="cb-disable ' . $sel_dact . '"><span>Inactive</span></label> </p>';
                        $empdata .= "\n\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\$('.cb-enable').click(function(){                \n\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('active','" . $emparr['id'] . "');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</script>   \n\t\t\t\t\t\t\t\t";
                    } else {
                        $sel_dact = "selected";
                        $sel_act = "";
                        $empdata .= '<p class="field switch"><label class="cb-enable  ' . $sel_act . '"><span>Active</span></label><label class="cb-disable ' . $sel_dact . '"><span>Inactive</span></label> </p>';
                        $empdata .= "\n\t\t\t\t\t\t\t\t<script type='text/javascript' language='javascript'>\n\t\t\t\t\t\t\t\t\t\$('.cb-enable,.cb-disable').click(function(){                \n\t\t\t\t\t\t\t\t\t\tmakeActiveInactive('other','" . $emparr['isactive'] . "');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</script>   \n\t\t\t\t\t\t\t\t";
                    }
                }
            }
        }
        $empdata .= '</div>';
        $empdata .= '<div id="loaderimg" style="display:none; clear:both; margin:0 auto; text-align: center; width:100%;"><img src="' . BASE_URL . "/public/media/images/loaderwhite_21X21.gif" . '" style="width:21px; height: 21px; float: none; "/>';
        $empdata .= '</div>';
        $empdata .= '</div>';
        $empdata .= '<div id="personalDetailsDiv">';
        if ($emparr['is_orghead'] == '1') {
            $headicon = '<img src="' . BASE_URL . "/public/media/images/org-head.png" . '" class="org-head-icon" />';
        } else {
            $headicon = '';
        }
        if (isset($emparr['active_prefix']) && isset($emparr['prefix']) && $emparr['active_prefix'] == 1 && $emparr['prefix'] != '') {
            $empdata .= '<p><b>Employee Name <i>:</i></b><span class="emp-name-span bold-text">' . $emparr['prefix'] . '.&nbsp;' . $emparr['userfullname'] . '</span>' . $headicon . '</p>';
        } else {
            $empdata .= '<p><b>Employee Name <i>:</i></b><span class="emp-name-span bold-text">' . $emparr['userfullname'] . '</span>' . $headicon . '</p>';
        }
        $empdata .= '<p><b>Employee Id <i>:</i></b><span class="emp-name-span" id ="spanempid">' . $emparr['employeeId'] . '</span></p>';
        $empdata .= '<p><b>Email Id <i>:</i></b><span><a href="javascript:void(0)">' . $emparr['emailaddress'] . '</a></span></p>';
        if ($emparr['contactnumber'] != '') {
            $empdata .= '<p><b>Contact Number <i>:</i></b>';
            $empdata .= '<span id="contactnospan" >' . $emparr['contactnumber'] . '</span>';
            if ($group_id == HR_GROUP || $loggedinuser == SUPERADMIN || $loggedinuser == $userId || $group_id == MANAGER_GROUP) {
                $empdata .= '<span class="number-edit"><input type="button" value="Update" id="editcontactnumber" name="Edit Number" onclick="opencontactnumberpopup(\'' . $emparr['id'] . '\',\'edit\',\'' . $emparr['contactnumber'] . '\');">';
                $empdata .= '</span>';
            }
            $empdata .= '</p>';
//.........这里部分代码省略.........
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:101,代码来源:Employeedetails.php


注:本文中的Default_Model_Users类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。