public function change_to_requisition_closed($id) { $candidate_model = new Default_Model_Candidatedetails(); $interview_model = new Default_Model_Interviewdetails(); $iround_model = new Default_Model_Interviewrounddetails(); $candidate_data = array('cand_status' => 'Requisition Closed/Completed'); $candidate_where = "requisition_id = " . $id . " and isactive =1 and cand_status not in ('Recruited','Rejected','On hold','Disqualified')"; $interview_data = array('interview_status' => 'Requisition Closed/Completed'); $interview_where = "isactive = 1 and req_id = " . $id . " and interview_status != 'Completed'"; $iround_data = array('round_status' => 'Requisition Closed/Completed'); $iround_where = "isactive = 1 and req_id = " . $id . " and (round_status not in ('Schedule for next round','Qualified','Selected') or round_status is null)"; if ($id != '') { $candidate_model->SaveorUpdateCandidateData($candidate_data, $candidate_where); $interview_model->SaveorUpdateInterviewData($interview_data, $interview_where); $iround_model->SaveorUpdateInterviewroundData($iround_data, $iround_where); } }
/** * This action is used to delete candidate and their interview round data. * @parameters * @param objid = id of candidate. * * @return = success/failure message */ public function deleteAction() { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; } $id = $this->_request->getParam('objid'); $messages['message'] = ''; $messages['msgtype'] = ""; $actionflag = 3; if ($id) { $cand_model = new Default_Model_Candidatedetails(); $cand_work_model = new Default_Model_Candidateworkdetails(); $interview_model = new Default_Model_Interviewdetails(); $interview_round_model = new Default_Model_Interviewrounddetails(); $menumodel = new Default_Model_Menu(); $data = array('isactive' => 0, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); $where = array('id=?' => $id); $Id = $cand_model->SaveorUpdateCandidateData($data, $where); if ($Id == 'update') { $cand_work_data = array('isactive' => 0, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); $cand_work_where = "cand_id = " . $id; $cand_work_model->SaveorUpdateCandidateWorkData($cand_work_data, $cand_work_where); $interview_data = array('isactive' => 0, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); $interview_where = "candidate_id = " . $id; $interview_model->SaveorUpdateInterviewData($interview_data, $interview_where); $interview_round_data = array('isactive' => 0, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s")); $interview_round_where = "candidate_id = " . $id; $interview_round_model->SaveorUpdateInterviewroundData($interview_round_data, $interview_round_where); $objidArr = $menumodel->getMenuObjID('/candidatedetails'); $objID = $objidArr[0]['id']; $result = sapp_Global::logManager($objID, $actionflag, $loginUserId, $id); $messages['message'] = 'Candidate deleted successfully.'; $messages['msgtype'] = 'success'; } else { $messages['message'] = 'Candidate cannot be deleted.'; $messages['msgtype'] = 'error'; } } else { $messages['message'] = 'Candidate cannot be deleted.'; $messages['msgtype'] = 'error'; } $this->_helper->json($messages); }
/** * */ public function deleteAction() { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; } $id = $this->_request->getParam('objid'); $messages['message'] = ''; $messages['msgtype'] = ''; $actionflag = 3; $flag = 1; if ($id) { $interview_model = new Default_Model_Interviewdetails(); $round_model = new Default_Model_Interviewrounddetails(); $cand_model = new Default_Model_Candidatedetails(); $menumodel = new Default_Model_Menu(); $candidateId = $interview_model->getCandidateIdById($id); if ($candidateId) { $datacand = array('cand_status' => 'Not Scheduled'); $wherecand = array('id=?' => $candidateId); $Idcand = $cand_model->SaveorUpdateCandidateData($datacand, $wherecand); if ($Idcand == 'update') { $data = array('isactive' => 0); $where = array('id=?' => $id); $Id = $interview_model->SaveorUpdateInterviewData($data, $where); if ($Id == 'update') { $menuidArr = $menumodel->getMenuObjID('/scheduleinterviews'); $menuID = $menuidArr[0]['id']; $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id); $messages['message'] = 'Schedule Interview deleted successfully'; $messages['msgtype'] = 'success'; $messages['flagtype'] = 'process'; } else { $flag = 0; } } else { $flag = 0; } } else { $flag = 0; } } else { $flag = 0; } if ($flag == 0) { $messages['message'] = 'This schedule interview cannot be deleted'; $messages['msgtype'] = 'error'; $messages['flagtype'] = 'process'; } $this->_helper->json($messages); }