/**
  * 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);
 }
Example #2
0
 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);
     }
 }
 public function viewpopupAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $id = $this->_getParam('id', null);
     $candidate_model = new Default_Model_Candidatedetails();
     $interview_model = new Default_Model_Interviewdetails();
     $interview_round_model = new Default_Model_Interviewrounddetails();
     $candidate_data = $candidate_model->getCandidateById($id);
     $interview_data = $interview_model->getInterviewDataByCandidateId($id);
     $interview_round_data = $interview_round_model->getRoundDetailsByCandidateId($id);
     $this->view->candidate_data = $candidate_data;
     $this->view->interview_data = $interview_data;
     $this->view->interview_round_data = $interview_round_data;
 }
 /**
  * 
  * @param type $id
  * @param type $int_status
  * @return array
  */
 public function interviewRoundsGrid($id, $int_status = '')
 {
     $interview_round_model = new Default_Model_Interviewrounddetails();
     $dashboardcall = $this->_getParam('dashboardcall');
     if ($dashboardcall == 'Yes') {
         $perPage = DASHBOARD_PERPAGE;
     } else {
         $perPage = PERPAGE;
     }
     $sort = 'ASC';
     $by = 'ir.interview_round_number';
     $pageNo = 1;
     $searchData = '';
     $searchArray = array();
     $objName = 'interviewrounds';
     $actns = '';
     if ($int_status == 'Completed') {
         $actns = 'remove';
         $tableFields = array('interview_round_number' => 'Interview Round', 'interview_mode' => 'Interview Mode', 'interview_mode_details' => 'Interview Mode Details', 'interview_round' => 'Interview Name', 'userfullname' => 'Interviewer', 'interview_date' => 'Interview Date', 'round_status' => 'Round Status');
     } else {
         $tableFields = array('action' => 'Action', 'interview_round_number' => 'Interview Round', 'interview_mode' => 'Interview Mode', 'interview_mode_details' => 'Interview Mode Details', 'interview_round' => 'Interview Name', 'userfullname' => 'Interviewer', 'interview_date' => 'Interview Date', 'round_status' => 'Round Status');
     }
     $tablecontent = $interview_round_model->getInterviewRoundsData($sort, $by, $pageNo, $perPage, '', $id);
     $data = array();
     $round_arr = array('' => 'All', 'Schedule for next round' => 'Schedule for next round', 'Qualified' => 'Qualified', 'Selected' => 'Selected', 'Disqualified' => 'Disqualified', 'Decision pending' => 'Decision pending', 'On hold' => 'On hold', 'Incompetent' => 'Incompetent', 'Ineligible' => 'Ineligible', 'Candidate no show' => 'Candidate no show', 'Requisition Closed/Completed' => 'Requisition Closed/Completed');
     $dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'formgrid' => 'true', 'menuName' => 'Interview Rounds', 'add' => 'add', 'actns' => $actns, 'call' => '', 'dashboardcall' => $dashboardcall, 'search_filters' => array('interview_date' => array('type' => 'datepicker'), 'round_status' => array('type' => 'select', 'filter_data' => $round_arr)));
     array_push($data, $dataTmp);
     return $data;
 }
 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) {
         $round_model = new Default_Model_Interviewrounddetails();
         $menumodel = new Default_Model_Menu();
         $data = array('isactive' => 0);
         $where = array('id=?' => $id);
         $Id = $round_model->SaveorUpdateInterviewroundData($data, $where);
         if ($Id == 'update') {
             $menuidArr = $menumodel->getMenuObjID('/scheduleinterviews');
             $menuID = $menuidArr[0]['id'];
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id);
             $messages['message'] = 'Round details deleted successfully';
             $messages['msgtype'] = 'success';
             $messages['flagtype'] = 'process';
         } else {
             $messages['message'] = 'Round details cannot be deleted';
             $messages['msgtype'] = 'error';
             $messages['flagtype'] = 'process';
         }
     } else {
         $messages['message'] = 'Round details cannot be deleted';
         $messages['msgtype'] = 'error';
         $messages['flagtype'] = 'process';
     }
     $this->_helper->json($messages);
 }