/** * * @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 indexAction() { $interview_round_model = new Default_Model_Interviewrounddetails(); $call = $this->_getParam('call'); if ($call == 'ajaxcall') { $this->_helper->layout->disableLayout(); } $id = $this->_getParam('unitId'); $unitId = $this->_getParam('unitId'); $view = Zend_Layout::getMvcInstance()->getView(); $objname = $this->_getParam('objname'); $refresh = $this->_getParam('refresh'); $dashboardcall = $this->_getParam('dashboardcall'); $data = array(); $searchQuery = ''; $searchArray = array(); $tablecontent = ''; if ($refresh == 'refresh') { if ($dashboardcall == 'Yes') { $perPage = DASHBOARD_PERPAGE; } else { $perPage = PERPAGE; } $sort = 'ASC'; $by = 'ir.interview_round_number'; $pageNo = 1; $searchData = ''; $searchQuery = ''; $searchArray = array(); } else { $sort = $this->_getParam('sort') != '' ? $this->_getParam('sort') : 'ASC'; $by = $this->_getParam('by') != '' ? $this->_getParam('by') : 'ir.interview_round_number'; if ($dashboardcall == 'Yes') { $perPage = $this->_getParam('per_page', DASHBOARD_PERPAGE); } else { $perPage = $this->_getParam('per_page', PERPAGE); } $pageNo = $this->_getParam('page', 1); /** search from grid - START **/ $searchData = $this->_getParam('searchData'); if ($searchData != '' && $searchData != 'undefined') { $searchValues = json_decode($searchData); if (count($searchValues) > 0) { foreach ($searchValues as $key => $val) { if ($key == 'interview_date') { $searchQuery .= " " . $key . " like '%" . sapp_Global::change_date($val, 'database') . "%' AND "; } else { $searchQuery .= " " . $key . " like '%" . $val . "%' AND "; } $searchArray[$key] = $val; } $searchQuery = rtrim($searchQuery, " AND"); } } /** search from grid - END **/ } $actns = ''; $intrvw_statusData = $interview_round_model->getinterviewstatus($id); $intrvw_status = $intrvw_statusData['interview_status']; if ($intrvw_status == 'Completed') { $actns = 'remove'; $tableFields = array('interview_round_number' => 'Interview Round', '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_round' => 'Interview Name', 'userfullname' => 'Interviewer', 'interview_date' => 'Interview Date', 'round_status' => 'Round Status'); } $objName = 'interviewrounds'; $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'); $tablecontent = $interview_round_model->getInterviewRoundsData($sort, $by, $pageNo, $perPage, $searchQuery, $id); if (isset($unitId) && $unitId != '') { $formgrid = 'true'; } else { $formgrid = ''; } $dataTmp = array('sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'menuName' => 'Interview Rounds', 'actns' => $actns, 'formgrid' => $formgrid, 'unitId' => $id, 'call' => $call, 'dashboardcall' => $dashboardcall, 'search_filters' => array('interview_date' => array('type' => 'datepicker'), 'round_status' => array('type' => 'select', 'filter_data' => $round_arr))); array_push($data, $dataTmp); $this->view->dataArray = $dataTmp; $this->view->call = $call; }