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


PHP sapp_Global::selectOptionBuilder方法代码示例

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


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

示例1: getdatafromajaxcallAction

 public function getdatafromajaxcallAction()
 {
     $meetingroomModel = new Default_Model_Meetingroom();
     $methodKey = $this->_getParam('methodKey', null);
     if ($methodKey == "1") {
         //Get Departments by ProjectID
         $projectid = $this->_getParam('projectid', null);
         $options_data = "";
         $options_data .= sapp_Global::selectOptionBuilder('0', 'Select Department');
         if ($projectid != '') {
             $rows = $meetingroomModel->getDepartmentsByProject($projectid);
             foreach ($rows as $row) {
                 $options_data .= sapp_Global::selectOptionBuilder($row['id'], $row['name']);
             }
         }
         $this->_helper->json(array('options' => $options_data));
     } else {
         if ($methodKey == "2") {
             $projectid = $this->_getParam('projectid', null);
             $prjIDS = $projectid;
             $options_data = "";
             if (is_array($projectid)) {
                 $prjIDS = implode(",", $projectid);
             }
             $options_data .= sapp_Global::selectOptionBuilder('0', 'Select Resource');
             if ($projectid != '') {
                 $rows = $meetingroomModel->getEmployeesByBU($prjIDS);
                 foreach ($rows as $row) {
                     $options_data .= sapp_Global::selectOptionBuilder($row['id'], $row['name']);
                 }
             }
             $this->_helper->json(array('options' => $options_data));
         } else {
             if ($methodKey == "3") {
                 try {
                     $meetingroomModel = new Default_Model_Meetingroom();
                     $roomid = $this->_getParam('roomid', null);
                     $bookeddate = $this->_getParam('bookeddate', null);
                     $rows = $meetingroomModel->getMeetingsByRoomAndDate($roomid, $bookeddate);
                     $datatable = "";
                     $datatable .= sapp_Global::_convertArrayToHTMLTable("leavecardtablegrid", "Booked Meetings", $rows);
                     $this->_helper->json(array('meetingtable' => $datatable));
                 } catch (Exception $e) {
                     echo $e->getMessage();
                 }
             }
         }
     }
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:49,代码来源:MeetingroomblockController.php

示例2: getdatafromajaxcallAction

 public function getdatafromajaxcallAction()
 {
     $taskallocation_model = new Default_Model_Tasksallocation();
     $methodKey = $this->_getParam('methodKey', null);
     if ($methodKey == "1") {
         //Get Project Tasks
         $projectid = $this->_getParam('projectid', null);
         $options_data = "";
         $options_data .= sapp_Global::selectOptionBuilder('0', 'Select Task');
         if ($projectid != '') {
             $dept_data = $taskallocation_model->getProjectTasks($projectid);
             foreach ($dept_data as $dept) {
                 $options_data .= sapp_Global::selectOptionBuilder($dept['id'], $dept['name']);
             }
         }
         $this->_helper->json(array('options' => $options_data));
     } else {
         if ($methodKey == "2") {
             //Get Tasks Planned Activities
             $taskid = $this->_getParam('taskid', null);
             $this->_helper->json(array('options' => sapp_Global::_convertArrayToHTMLTable("leavecardtablegrid", "Task Details", $taskallocation_model->getTaskDetails($taskid))));
         } else {
             if ($methodKey == "3") {
                 //Get Tasks Planned Activities
                 $taskid = $this->_getParam('taskid', null);
                 $taskActivityDetails = $taskallocation_model->getTaskActivityDetails($taskid);
                 $this->_helper->json(array('options' => $this->getActivitesEditableGrid($taskActivityDetails)));
                 //$this->_helper->json(array('options' => sapp_Global::_convertArrayToHTMLTable("leavecardtablegrid", "Task Activity Details", $taskActivityDetails)));
             } else {
                 if ($methodKey == "4") {
                     //Get Project resources
                     $projectid = $this->_getParam('projectid', null);
                     $options_data = "";
                     //$options_data .= sapp_Global::selectOptionBuilder('0', 'Select Task');
                     if ($projectid != '') {
                         $dept_data = $taskallocation_model->getEmployeesByProject($projectid);
                         foreach ($dept_data as $dept) {
                             $options_data .= sapp_Global::selectOptionBuilder($dept['id'], $dept['name']);
                         }
                     }
                     $this->_helper->json(array('options' => $options_data));
                 }
             }
         }
     }
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:46,代码来源:FillintimesheetController.php

示例3: addnewcategoryAction

 public function addnewcategoryAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     /**
      ** Instantiate category form
      **/
     $addCategoryForm = new Default_Form_Categories();
     $this->view->form = $addCategoryForm;
     /** set form action parameter **/
     $addCategoryForm->setAttrib('action', BASE_URL . 'categories/addnewcategory');
     /**
      ** To populate existing categories in auto-search
      **/
     $categoriesObj = $this->categoriesModel->getCategories('add');
     $categoriesStr = '';
     if (!empty($categoriesObj)) {
         for ($i = 0; $i < sizeof($categoriesObj); $i++) {
             $categoriesStr .= "'" . $categoriesObj[$i]['category'] . "',";
         }
         $categoriesStr = trim($categoriesStr, ",");
     }
     $this->view->categoriesStr = $categoriesStr;
     /**
      ** Check if form post is initiated
      ** if yes,	check if form is valid
      **			if yes, 
      **				1.	capture form values
      **				2.	prepare data object
      **				3.	insert into database
      **			if no,
      **				1.	build error message object		 
      **/
     if ($this->getRequest()->getPost()) {
         if ($addCategoryForm->isValid($this->_request->getPost())) {
             /** capture form values **/
             $categoryName = $this->_request->getParam('category');
             $categoryDesc = $this->_request->getParam('description');
             /** prepare data to insert into database **/
             $data = array('category' => $categoryName, 'description' => $categoryDesc, 'isused' => 0, 'isactive' => 1, 'modifiedby' => $this->loggedInUser, 'createdby' => $this->loggedInUser, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'createddate' => gmdate("Y-m-d H:i:s"));
             $res = $this->categoriesModel->addCategory($data);
             if ($res) {
                 /** insert into log manager table **/
                 sapp_Global::logManager(POLICY_DOCS_CATEGORIES, 1, $this->loggedInUser, $res);
                 $this->view->newCat = $res;
             }
             $categoriesData = $this->categoriesModel->getCategories('add');
             $opt = '';
             foreach ($categoriesData as $category) {
                 $opt .= sapp_Global::selectOptionBuilder($category['id'], $category['category']);
             }
             $this->view->categoriesData = $opt;
             $this->view->eventact = 'added';
             $this->view->popup = 'close';
         } else {
             $validationMsgs = $addCategoryForm->getMessages();
             foreach ($validationMsgs as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
             $this->view->msgarray = $msgarray;
         }
     }
     $this->view->controllername = 'categories';
     $this->view->ermsg = '';
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:67,代码来源:CategoriesController.php

示例4: addpopupAction

 /**
  * This action is used to add/edit identity codes in popup
  */
 public function addpopupAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $prev_cntrl = $this->_getParam('prev_cntrl', null);
     $user_id = $this->_getParam('user_id', null);
     $IdentityCodesform = new Default_Form_identitycodes();
     $IdentityCodesform->setAction(BASE_URL . 'identitycodes/addpopup/prev_cntrl/' . $prev_cntrl);
     $IdentityCodesModel = new Default_Model_Identitycodes();
     $identity_data = '';
     $IdentityCodesform->removeElement('vendor_code');
     $IdentityCodesform->removeElement('staffing_code');
     try {
         $identityCodesArr = $IdentityCodesModel->getIdentitycodesRecord();
         if (count($identityCodesArr) > 0) {
             $id = $identityCodesArr[0]['id'];
         } else {
             $id = '';
         }
         if ($id != '') {
             $id = abs($id);
             $data = $identityCodesArr;
             //print_r($data);exit;
             if (!empty($data)) {
                 $IdentityCodesform->setDefault("employee_code", $data[0]["employee_code"]);
                 $IdentityCodesform->setDefault("bg_code", $data[0]["backgroundagency_code"]);
                 $IdentityCodesform->setDefault("users_code", $data[0]["users_code"]);
                 $IdentityCodesform->setDefault("requisition_code", $data[0]["requisition_code"]);
                 $IdentityCodesform->setDefault("id", $data[0]["id"]);
                 $IdentityCodesform->submit->setLabel('Update');
                 $this->view->id = $id;
                 $this->view->nodata = '';
             } else {
                 $this->view->nodata = 'norecord';
             }
         } else {
             $IdentityCodesform->submit->setAttrib('value', 'Save');
         }
     } catch (Exception $e) {
         $this->view->nodata = 'nodata';
     }
     if (!sapp_Global::_isactivemodule(BGCHECKS)) {
         $IdentityCodesform->removeElement('bg_code');
     }
     if (!sapp_Global::_isactivemodule(RESOURCEREQUISITION)) {
         $IdentityCodesform->removeElement('requisition_code');
     }
     $this->view->form = $IdentityCodesform;
     if ($this->getRequest()->getPost()) {
         $result = $this->save($IdentityCodesform, 'from popup');
         $this->view->msgarray = $result;
         if (isset($result['msg']) && $result['msg'] != '') {
             if ($prev_cntrl == 'usermanagement') {
                 $identityCodesArr = $IdentityCodesModel->getIdentitycodesRecord();
                 $identityCodesArr = $identityCodesArr[0];
                 $identity_data .= sapp_Global::selectOptionBuilder($identityCodesArr['users_code'], "Users (" . $identityCodesArr['users_code'] . ")");
                 /* Removing the codes which are not included for first phase*/
                 //$identity_data = sapp_Global::selectOptionBuilder($identityCodesArr['staffing_code'], "Staffing (".$identityCodesArr['staffing_code'].")");
                 //$identity_data .= sapp_Global::selectOptionBuilder($identityCodesArr['vendors_code'], "Vendors (".$identityCodesArr['vendors_code'].")");
             } else {
                 if ($prev_cntrl == 'organisationinfo' || $prev_cntrl == 'employee') {
                     $user_model = new Default_Model_Usermanagement();
                     if (isset($_POST['user_id']) && $_POST['user_id'] != '') {
                         $user_id = $_POST['user_id'];
                     }
                     if ($user_id != 'new') {
                         $user_data = $user_model->getUserDataById($user_id);
                         $identity_data = $user_data['employeeId'];
                     } else {
                         $identity_codes = $IdentityCodesModel->getIdentitycodesRecord();
                         $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);
                         }
                         $identity_data = $emp_id;
                     }
                 }
             }
         }
     }
     $this->view->identity_data = $identity_data;
     $this->view->prev_cntrl = $prev_cntrl;
     $this->view->user_id = $user_id;
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:90,代码来源:IdentitycodesController.php

示例5: addpopupAction

 public function addpopupAction()
 {
     $emptyFlag = NULL;
     $msgarray = array();
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $jobtitleid = $this->_request->getParam('jobtitleid');
     $visible = true;
     $controllername = 'positions';
     $positionsform = new Default_Form_positions();
     $positionsmodel = new Default_Model_Positions();
     $jobtitlesmodel = new Default_Model_Jobtitles();
     if ($jobtitleid == null) {
         $jobtitleidmodeldata = $jobtitlesmodel->getJobTitleList();
         if (!empty($jobtitleidmodeldata)) {
             foreach ($jobtitleidmodeldata as $jobtitleidres) {
                 $positionsform->jobtitleid->addMultiOption($jobtitleidres['id'], utf8_encode($jobtitleidres['jobtitlename']));
                 $this->view->notdisplayposition = 0;
             }
         } else {
             $msgarray['jobtitleid'] = 'Job titles are not configured yet.';
             $emptyFlag++;
         }
         $this->view->emptyFlag = $emptyFlag;
     } else {
         $jobtitleidres = $jobtitlesmodel->getsingleJobTitleData($jobtitleid);
         $positionsform->jobtitleid->addMultiOption($jobtitleidres[0]['id'], utf8_encode($jobtitleidres[0]['jobtitlename']));
         $positionsform->setDefault('jobtitleid', $jobtitleid);
         $this->view->notdisplayposition = $jobtitleid;
     }
     $positionsform->setAction(BASE_URL . 'positions/addpopup');
     if ($this->getRequest()->getPost()) {
         if ($positionsform->isValid($this->_request->getPost())) {
             $id = $this->_request->getParam('id');
             $positionname = $this->_request->getParam('positionname');
             $jobtitleidpop = $this->_request->getParam('jobtitleid');
             $description = $this->_request->getParam('description');
             $displayposition = $this->_request->getParam('display');
             $date = new Zend_Date();
             $menumodel = new Default_Model_Menu();
             $actionflag = '';
             $tableid = '';
             $data = array('positionname' => trim($positionname), 'jobtitleid' => $jobtitleidpop, 'description' => trim($description), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
             if ($id != '') {
                 $where = array('id=?' => $id);
                 $actionflag = 2;
             } else {
                 $data['createdby'] = $loginUserId;
                 $data['createddate'] = gmdate("Y-m-d H:i:s");
                 $data['isactive'] = 1;
                 $where = '';
                 $actionflag = 1;
             }
             $Id = $positionsmodel->SaveorUpdatePositionData($data, $where);
             $tableid = $Id;
             $menuidArr = $menumodel->getMenuObjID('/positions');
             $menuID = $menuidArr[0]['id'];
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
             $opt = '';
             if ($displayposition == '0') {
                 $this->view->positionlistArr = $opt;
             } else {
                 $positionlistArr = $positionsmodel->getPositionList($displayposition);
                 foreach ($positionlistArr as $record) {
                     $opt .= sapp_Global::selectOptionBuilder($record['id'], $record['positionname']);
                 }
                 $this->view->positionlistArr = $opt;
             }
             $this->view->eventact = 'added';
             $close = 'close';
             $this->view->popup = $close;
         } else {
             $messages = $positionsform->getMessages();
             foreach ($messages as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
             $this->view->msgarray = $msgarray;
         }
     }
     $this->view->controllername = $controllername;
     $this->view->form = $positionsform;
     $this->view->ermsg = '';
     $this->view->disableselect = $visible;
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:90,代码来源:PositionsController.php

示例6: addpopupAction

 public function addpopupAction()
 {
     $msgarray = array();
     $emptyFlag = '';
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $id = $this->getRequest()->getParam('id');
     $controllername = 'expensecategory';
     $expenseCategoryForm = new Timemanagement_Form_Expensecategory();
     $expenseCategoryModel = new Timemanagement_Model_Expensecategories();
     $clientsForm->setAction(BASE_URL . 'timemanagement/expensecategory/addpopup');
     if ($this->getRequest()->getPost()) {
         if ($expenseCategoryForm->isValid($this->_request->getPost())) {
             $category = $this->_request->getParam('category');
             $date = gmdate("Y-m-d H:i:s");
             $data = array('category' => $category, 'created_by' => $loginUserId, 'created' => gmdate("Y-m-d H:i:s"), 'is_active' => 1);
             $where = '';
             $Id = $expenseCategoryModel->SaveorUpdateExpenseCategoryData($data, $where);
             $expenseCategoryData = $expenseCategoryModel->fetchAll('is_active = 1', 'category')->toArray();
             $opt = '';
             foreach ($expenseCategoryData as $record) {
                 $opt .= sapp_Global::selectOptionBuilder($record['id'], $record['category']);
             }
             $this->view->expenseCategoryData = $opt;
             $this->view->eventact = 'added';
             $close = 'close';
             $this->view->popup = $close;
         } else {
             $messages = $expenseCategoryForm->getMessages();
             foreach ($messages as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
             $this->view->msgarray = $msgarray;
         }
     }
     $this->view->controllername = $controllername;
     $this->view->form = $expenseCategoryForm;
     $this->view->ermsg = '';
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:45,代码来源:ExpensesController.php

示例7: addnewstateAction

 public function addnewstateAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $msgarray = array();
     $controllername = 'states';
     $statestring = '';
     $id = $this->getRequest()->getParam('id');
     $selectedcountryid = $this->_request->getParam('selectcountryid', null);
     $statesform = new Default_Form_states();
     $statesmodel = new Default_Model_States();
     $countriesModel = new Default_Model_Countries();
     /* Changing the form */
     $statesform->setAction(BASE_URL . 'states/addnewstate/selectcountryid/' . $selectedcountryid);
     $statesform->removeElement('state');
     $statesform->addElement('text', 'state', array('label' => 'State', 'maxlength' => '20', 'required' => true, 'validators' => array(array('validator' => 'NotEmpty', 'options' => array('messages' => 'Please enter state name.')))));
     /* END */
     $countrieslistArr = $countriesModel->getTotalCountriesList('');
     if (sizeof($countrieslistArr) > 0) {
         $statesform->countryid->addMultiOption('', 'Select Country');
         foreach ($countrieslistArr as $countrieslistres) {
             if (isset($selectedcountryid)) {
                 if ($countrieslistres['id'] == $selectedcountryid) {
                     $statesform->countryid->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
                     $statesform->setDefault('countryid', $selectedcountryid);
                 }
             } else {
                 $statesform->countryid->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
             }
         }
     } else {
         $msgarray['countryid'] = 'Countries are not configured yet';
     }
     if ($this->getRequest()->getPost()) {
         $errorflag = "true";
         $msgarray = array();
         $id = $this->_request->getParam('id');
         $dbstate = '';
         $dbcountryid = '';
         $state = trim($this->_request->getParam('state'));
         $countryid = $this->_request->getParam('countryid');
         if (isset($countryid) && $countryid != '') {
             $isDuplicateStateNameArr = $statesmodel->getDuplicateStateName($state, $countryid);
             if ($isDuplicateStateNameArr[0]['count'] > 0) {
                 $errorflag = "false";
                 $msgarray['state'] = "State already exists.";
             }
         } else {
             $errorflag = "false";
             $msgarray['countryid'] = "Please select country.";
         }
         if ($statesform->isValid($this->_request->getPost()) && $errorflag == "true") {
             $menumodel = new Default_Model_Menu();
             $actionflag = '';
             $tableid = '';
             $NewStateId = $statesmodel->SaveMainStateData($countryid, $state);
             $tableid = $NewStateId;
             $actionflag = 1;
             $menuidArr = $menumodel->getMenuObjID('/states');
             $menuID = $menuidArr[0]['id'];
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
             if (isset($selectedcountryid)) {
                 $stateData = $statesmodel->getStatesList($selectedcountryid, '');
             } else {
                 $stateData = array();
             }
             $opt = '';
             foreach ($stateData as $record) {
                 $opt .= sapp_Global::selectOptionBuilder($record['id'], $record['state_name']);
             }
             $this->view->stateData = $opt;
             $this->view->eventact = 'added';
             $close = 'close';
             $this->view->popup = $close;
         } else {
             $messages = $statesform->getMessages();
             foreach ($messages as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
         }
     }
     $this->view->ermsg = '';
     $this->view->form = $statesform;
     $this->view->msgarray = $msgarray;
     $this->view->controllername = $controllername;
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:92,代码来源:StatesController.php

示例8: getcandidates_forinterview

 /**
  * This function returns candidates and interviewers based on a particular requisition code.
  * @param integer $req_id          = id of requisition
  * @param integer $loginUserGroup  = id of group
  * @param integer $loginUserId     = id of logged user
  * @return array  Array of candidate options and interviewers options.
  */
 public function getcandidates_forinterview($req_id, $loginUserGroup, $loginUserId)
 {
     $jobtitleModel = new Default_Model_Jobtitles();
     $candsmodel = new Default_Model_Candidatedetails();
     $reqData = $this->getRequisitionDataById($req_id);
     $candsData = $candsmodel->getnotscheduledcandidateData($req_id);
     $candStr = '';
     $jobttlArr = array();
     $jobtitle = '';
     $managerStr = "";
     if (!empty($candsData)) {
         foreach ($candsData as $cand) {
             $candStr .= sapp_Global::selectOptionBuilder($cand['id'], $cand['candidate_name']);
         }
     } else {
         $candStr = "nocandidates";
     }
     if (!empty($reqData)) {
         $reqData['jobtitlename'] = '';
         $jobttlArr = $jobtitleModel->getsingleJobTitleData($reqData['jobtitle']);
         if (!empty($jobttlArr) && $jobttlArr != 'norows') {
             $jobtitle = $jobttlArr[0]['jobtitlename'];
             $reqData['jobtitlename'] = $jobttlArr[0]['jobtitlename'];
         }
         $repmanData = $this->getReportingmanagers($loginUserGroup, $loginUserId, '', $reqData['department_id'], 'interviewer');
         if (!empty($repmanData)) {
             foreach ($repmanData as $rep) {
                 $managerStr .= sapp_Global::selectOptionBuilder($rep['id'], $rep['name'], $rep['profileimg']);
             }
         } else {
             $managerStr = "nomanagers";
         }
     }
     return array('candidates' => $candStr, 'managers' => $managerStr, 'jobtitle' => $jobtitle);
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:42,代码来源:Requisition.php

示例9: addemppopupAction


//.........这里部分代码省略.........
             $emp_form->emp_status_id->addMultiOption($employmentStatusres['workcodename'], $employmentStatusres['statusname']);
         }
     } else {
         $msgarray['emp_status_id'] = 'Employment status is not configured yet.';
         $emptyFlag++;
     }
     $reportingManagerData = $usersModel2->getReportingManagerList_employees('', '', MANAGEMENT_GROUP);
     if (!empty($reportingManagerData)) {
         $report_opt = $reportingManagerData;
         if (isset($_POST['reporting_manager']) && $_POST['reporting_manager'] != '') {
             $emp_form->setDefault('reporting_manager', $_POST['reporting_manager']);
         }
     } else {
         $msgarray['reporting_manager'] = 'Reporting managers are not added yet.';
         $flag = 'false';
     }
     if ($this->getRequest()->getPost()) {
         if ($emp_form->isValid($this->_request->getPost()) && $flag == 'true') {
             $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', null), 'database');
             $date_of_leaving = $this->_request->getParam('date_of_leaving', null);
             $date_of_leaving = sapp_Global::change_date($date_of_leaving, 'database');
             $employeeId = $this->_getParam('employeeId', null);
             $emprole = $this->_getParam('emprole', null);
             $reporting_manager = $this->_getParam('reporting_manager', null);
             $emailaddress = $this->_getParam('emailaddress', null);
             $emppassword = sapp_Global::generatePassword();
             $firstname = trim($this->_getParam('firstname', null));
             $lastname = trim($this->_getParam('lastname', null));
             $userfullname = $firstname . ' ' . $lastname;
             //$userfullname = trim($this->_request->getParam('userfullname',null));
             $prefix_id = $this->_getParam('prefix_id', null);
             $user_id = $this->_getParam('user_id', null);
             $emp_status_id = $this->_getParam('emp_status_id', null);
             $user_data = array('emprole' => $emprole, 'firstname' => $firstname != '' ? $firstname : NULL, 'lastname' => $lastname != '' ? $lastname : NULL, 'userfullname' => $userfullname, 'emailaddress' => $emailaddress, 'jobtitle_id' => $jobtitle_id, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'emppassword' => md5($emppassword), 'employeeId' => $employeeId, 'modeofentry' => 'Direct', 'selecteddate' => $date_of_joining, 'userstatus' => 'old');
             $emp_data = array('user_id' => $user_id, 'jobtitle_id' => $jobtitle_id, 'position_id' => $position_id, 'prefix_id' => $prefix_id, 'department_id' => $deptidforhead, 'reporting_manager' => $reporting_manager, 'date_of_joining' => $date_of_joining, 'date_of_leaving' => $date_of_leaving != '' ? $date_of_leaving : NULL, 'emp_status_id' => $emp_status_id, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
             $user_data['createdby'] = $loginUserId;
             $user_data['createddate'] = gmdate("Y-m-d H:i:s");
             $user_data['isactive'] = 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;
             $user_id = $user_model->SaveorUpdateUserData($user_data, '');
             $emp_data['user_id'] = $user_id;
             $emp_data['createdby'] = $loginUserId;
             $emp_data['createddate'] = gmdate("Y-m-d H:i:s");
             $emp_data['isactive'] = 1;
             $employeeModal->SaveorUpdateEmployeeData($emp_data, '');
             //end of saving into employee table.
             $tableid = $user_id;
             $actionflag = 1;
             $menuID = ORGANISATIONINFO;
             try {
                 $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
             } catch (Exception $e) {
             }
             $managementUsersData = $deptModel->getDeptHeads();
             $opt = '';
             foreach ($managementUsersData as $record) {
                 $opt .= sapp_Global::selectOptionBuilder($record['id'], $record['userfullname']);
             }
             $this->view->managementUsersData = $opt;
             /* Send Mail to the user */
             $base_url = 'http://' . $this->getRequest()->getHttpHost() . $this->getRequest()->getBaseUrl();
             $view = $this->getHelper('ViewRenderer')->view;
             $this->view->emp_name = $userfullname;
             $this->view->password = $emppassword;
             $this->view->emp_id = $employeeId;
             $this->view->base_url = $base_url;
             $text = $view->render('mailtemplates/newpassword.phtml');
             $options['subject'] = APPLICATION_NAME . ' login Credentials';
             $options['header'] = 'Greetings from Sentrifugo';
             $options['toEmail'] = $emailaddress;
             $options['toName'] = $this->view->emp_name;
             $options['message'] = $text;
             $result = sapp_Global::_sendEmail($options);
             /* END */
             $this->view->eventact = 'added';
             $close = 'close';
             $this->view->popup = $close;
         } else {
             $messages = $emp_form->getMessages();
             foreach ($messages as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
             $this->view->msgarray = $msgarray;
         }
     }
     $this->view->msgarray = $msgarray;
     $this->view->report_opt = $report_opt;
     $this->view->controllername = $controllername;
     $this->view->emp_form = $emp_form;
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:101,代码来源:EmployeeController.php

示例10: checkappraisalimplementationAction

 public function checkappraisalimplementationAction()
 {
     $ajaxContext = $this->_helper->getHelper('AjaxContext');
     $ajaxContext->addActionContext('savegroupedemployeesajax', 'json')->initContext();
     $this->_helper->layout->disableLayout();
     $result = array();
     $model = new Default_Model_Appraisalinit();
     $departmentsmodel = new Default_Model_Departments();
     $businessunit_id = $this->_request->getParam('buid');
     $enable_step = $this->_request->getParam("enable_step");
     $output = $model->check_performance_implmentation($businessunit_id);
     if (!empty($output)) {
         $departmentlistArr = $model->getdeparmentsadmin($businessunit_id, $enable_step);
         $options_data = "";
         $options_data .= sapp_Global::selectOptionBuilder('', 'Select Department');
         if (!empty($departmentlistArr)) {
             foreach ($departmentlistArr as $dept) {
                 $options_data .= sapp_Global::selectOptionBuilder($dept['id'], utf8_encode($dept['deptname']));
             }
             $result['msg'] = 'true';
         } else {
             $result['msg'] = 'false';
         }
         if ($output['performance_app_flag'] == 1) {
             $result['flag'] = 'buwise';
         } else {
             $result['flag'] = 'deptwise';
         }
         $result['result'] = $options_data;
     } else {
         $result['flag'] = 'notinitialized';
         $result['msg'] = 'false';
         $result['result'] = '';
     }
     $this->_helper->_json($result);
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:36,代码来源:AppraisalstatusController.php

示例11: getgroupoptionsAction

 public function getgroupoptionsAction()
 {
     $bunit = $this->_getParam('bunit', null);
     $options = sapp_Global::selectOptionBuilder('', 'Select Group');
     if ($bunit != '') {
         $emailcontacts_model = new Default_Model_Emailcontacts();
         $group_data = $emailcontacts_model->getgroupoptions($bunit);
         if (count($group_data) > 0) {
             foreach ($group_data as $group) {
                 $options .= sapp_Global::selectOptionBuilder($group['id'], $group['group_name']);
             }
         }
     }
     $this->_helper->json(array('options' => $options));
 }
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:15,代码来源:EmailcontactsController.php

示例12: addpopupAction


//.........这里部分代码省略.........
         if ($screenFlag == 'add') {
             array_push($newarr1, 8, 9, 10);
         }
         $empstatusstr = implode(",", $newarr1);
     }
     if ($empstatusstr != '') {
         $statusArr = $employmentstatusmodel->getStatuslist($empstatusstr);
     } else {
         $statusArr = $employmentstatusmodel->getCompleteStatuslist();
     }
     if (!empty($statusArr)) {
         $employmentstatusform->workcodename->addMultiOption('', 'Select Work Code');
         for ($i = 0; $i < sizeof($statusArr); $i++) {
             if ($fromcontroller == 'requisition') {
                 if (!in_array($statusArr[$i]['id'], array(5, 7, 8, 9, 10))) {
                     $employmentstatusform->workcodename->addMultiOption($statusArr[$i]['id'], utf8_encode($statusArr[$i]['employemnt_status']));
                 }
             } else {
                 $employmentstatusform->workcodename->addMultiOption($statusArr[$i]['id'], utf8_encode($statusArr[$i]['employemnt_status']));
             }
         }
     }
     $this->view->statusArr = $statusArr;
     $this->view->ermsg = '';
     if ($this->getRequest()->getPost()) {
         if ($employmentstatusform->isValid($this->_request->getPost())) {
             $id = $this->_request->getParam('id');
             $workcode = $this->_request->getParam('workcode');
             $workcodename = $this->_request->getParam('workcodename');
             $default_leaves = $this->_request->getParam('default_leaves');
             $description = $this->_request->getParam('description');
             $screenFlag = $this->getRequest()->getParam('screenflag');
             $date = new Zend_Date();
             $actionflag = '';
             $tableid = '';
             $data = array('workcode' => trim($workcode), 'workcodename' => trim($workcodename), 'description' => trim($description), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
             if ($id != '') {
                 $where = array('id=?' => $id);
                 $actionflag = 2;
             } else {
                 $data['createdby'] = $loginUserId;
                 $data['createddate'] = gmdate("Y-m-d H:i:s");
                 $data['isactive'] = 1;
                 $where = '';
                 $actionflag = 1;
             }
             $Id = $employmentstatusmodel->SaveorUpdateEmploymentStatusData($data, $where);
             $tableid = $Id;
             $menuID = EMPLOYMENTSTATUS;
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
             $this->view->eventact = 'added';
             $close = 'close';
             $this->view->popup = $close;
             if (isset($_POST['fromcontroller']) && $_POST['fromcontroller'] != '') {
                 $fromcontroller = $_POST['fromcontroller'];
             }
             if (isset($_POST['boxid']) && $_POST['boxid'] != '') {
                 $boxid = $_POST['boxid'];
             }
         } else {
             $messages = $employmentstatusform->getMessages();
             foreach ($messages as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
             $this->view->msgarray = $msgarray;
         }
     }
     $opt = '';
     if ($fromcontroller == '') {
         if ($screenFlag == 'edit') {
             $empstatusData = $employmentstatusmodel->getempstatuslist();
         }
         if ($screenFlag == 'add') {
             $empstatusData = $employmentstatusmodel->getempstatusActivelist();
         }
         if (!empty($empstatusData)) {
             foreach ($empstatusData as $record) {
                 $opt .= sapp_Global::selectOptionBuilder($record['workcodename'], $record['statusname']);
             }
         }
     } else {
         if ($fromcontroller == 'requisition') {
             $requi_model = new Default_Model_Requisition();
             $empstatusData = $requi_model->getStatusOptionsForRequi();
             foreach ($empstatusData as $stat_id => $stat_name) {
                 $opt .= sapp_Global::selectOptionBuilder($stat_id, $stat_name);
             }
         }
     }
     $this->view->empstatusData = $opt;
     $this->view->screenFlag = $screenFlag;
     $this->view->controllername = $controllername;
     $this->view->form = $employmentstatusform;
     $this->view->ermsg = '';
     $this->view->boxid = $boxid;
     $this->view->fromcontroller = $fromcontroller;
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:101,代码来源:EmploymentstatusController.php

示例13: getcompleteorgdataAction

 public function getcompleteorgdataAction()
 {
     $ajaxContext = $this->_helper->getHelper('AjaxContext');
     $ajaxContext->addActionContext('getcompleteorgdata', 'json')->initContext();
     $this->_helper->layout->disableLayout();
     $userid = $this->_request->getParam('userid');
     $employeeModal = new Default_Model_Employee();
     $positionsmodel = new Default_Model_Positions();
     $orgheadsData = $employeeModal->getEmployeesForOrgHead($userid);
     $result['result'] = array();
     $options_data = '';
     $emp_data = $employeeModal->getsingleEmployeeData($userid);
     if (!empty($emp_data)) {
         $result['result'] = $emp_data[0];
         $result['result']['date_of_joining'] = sapp_Global::change_date($emp_data[0]['date_of_joining'], '');
         $positionlistArr = $positionsmodel->getPositionList($emp_data[0]['jobtitle_id']);
         foreach ($positionlistArr as $opt) {
             $options_data .= sapp_Global::selectOptionBuilder($opt['id'], ucwords(utf8_encode($opt['positionname'])));
         }
         $result['positionsdata'] = $options_data;
     }
     $this->_helper->_json($result);
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:23,代码来源:OrganisationinfoController.php

示例14: addpopupAction

 /**
  * This action is used to add compentency level in popups.
  */
 public function addpopupAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $id = $this->getRequest()->getParam('id');
     $callval = $this->getRequest()->getParam('call');
     $previname = $this->_getParam('previname', null);
     if ($callval == 'ajaxcall') {
         $this->_helper->layout->disableLayout();
     }
     $objName = 'competencylevel';
     $competencylevelform = new Default_Form_competencylevel();
     $competencylevelform->setAction(BASE_URL . 'competencylevel/addpopup');
     $competencylevelmodel = new Default_Model_Competencylevel();
     try {
         $this->view->form = $competencylevelform;
         $this->view->controllername = $objName;
     } catch (Exception $e) {
         $this->view->ermsg = 'nodata';
     }
     if ($this->getRequest()->getPost()) {
         if ($competencylevelform->isValid($this->_request->getPost())) {
             $id = $this->_request->getParam('id');
             $competencylevel = $this->_request->getParam('competencylevel');
             $description = $this->_request->getParam('description');
             $date = new Zend_Date();
             $menumodel = new Default_Model_Menu();
             $actionflag = '';
             $tableid = '';
             $data = array('competencylevel' => trim($competencylevel), 'description' => trim($description), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
             if ($id != '') {
                 $where = array('id=?' => $id);
                 $actionflag = 2;
             } else {
                 $data['createdby'] = $loginUserId;
                 $data['createddate'] = gmdate("Y-m-d H:i:s");
                 $data['isactive'] = 1;
                 $where = '';
                 $actionflag = 1;
             }
             $Id = $competencylevelmodel->SaveorUpdateCompetencyLevelData($data, $where);
             $menuidArr = $menumodel->getMenuObjID('/competencylevel');
             $menuID = $menuidArr[0]['id'];
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
             $this->view->eventact = 'added';
             $close = 'close';
             $this->view->popup = $close;
             $competencylevelArr = $competencylevelmodel->getCompetencylevelList();
             $opt = "";
             if (!empty($competencylevelArr)) {
                 foreach ($competencylevelArr as $competencylevelres) {
                     $opt .= sapp_Global::selectOptionBuilder($competencylevelres['id'], $competencylevelres['competencylevel']);
                 }
             }
             $this->view->compdata = $opt;
             if (isset($_POST['previname']) && $_POST['previname'] != '') {
                 $previname = $_POST['previname'];
             }
         } else {
             $messages = $competencylevelform->getMessages();
             foreach ($messages as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
             $this->view->msgarray = $msgarray;
         }
     }
     $this->view->previname = $previname;
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:77,代码来源:CompetencylevelController.php

示例15: addnewcountryAction

 public function addnewcountryAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $id = $this->getRequest()->getParam('id');
     $callval = $this->getRequest()->getParam('call');
     $controllername = 'countries';
     $countriesform = new Default_Form_countries();
     $countriesmodel = new Default_Model_Countries();
     $countriesform->setAction(BASE_URL . 'countries/addnewcountry');
     /* Changing the form */
     $countriesform->removeElement('country');
     $countriesform->removeElement('countrycode');
     $countriesform->addElement('text', 'country', array('label' => 'Country', 'required' => true, 'validators' => array(array('validator' => 'NotEmpty', 'options' => array('messages' => 'Please enter country name.')))));
     $countriesform->country->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'tbl_countries', 'field' => 'country_name')));
     $countriesform->country->getValidator('Db_NoRecordExists')->setMessage('Country name already exists.');
     $countriesform->addElement('text', 'countrycode', array('label' => 'Country code', 'required' => true, 'validators' => array(array('validator' => 'NotEmpty', 'options' => array('messages' => 'Please enter country code.')))));
     $countriesform->countrycode->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'tbl_countries', 'field' => 'country_code')));
     $countriesform->countrycode->getValidator('Db_NoRecordExists')->setMessage('Country code already exists.');
     /* END */
     if ($this->getRequest()->getPost()) {
         $id = $this->_request->getParam('id');
         $errorflag = "true";
         $msgarray = array();
         $dbcountry = '';
         $dbcountryid = '';
         $country = $this->_request->getParam('country');
         $countrycode = $this->_request->getParam('countrycode');
         $citizenship = $this->_request->getParam('citizenship');
         $dbcountry = $country;
         if ($countriesform->isValid($this->_request->getPost()) && $errorflag == "true") {
             $date = new Zend_Date();
             $actionflag = 1;
             $tableid = '';
             $countryID = $countriesmodel->SaveMainCountryData($country, $countrycode);
             $tableid = $countryID;
             $menuID = COUNTRIES;
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
             $countryData = $countriesmodel->getTotalCountriesList('isactive=1', 'country_name');
             $opt = '';
             foreach ($countryData as $record) {
                 $opt .= sapp_Global::selectOptionBuilder($record['id'], $record['country_name']);
             }
             $this->view->countryData = $opt;
             $this->view->eventact = 'added';
             $close = 'close';
             $this->view->popup = $close;
         } else {
             $messages = $countriesform->getMessages();
             foreach ($messages as $key => $val) {
                 foreach ($val as $key2 => $val2) {
                     $msgarray[$key] = $val2;
                     break;
                 }
             }
             $this->view->msgarray = $msgarray;
         }
     }
     $this->view->ermsg = '';
     $this->view->form = $countriesform;
     $this->view->controllername = $controllername;
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:65,代码来源:CountriesController.php


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