public function getdetailedratingsbyquesAction()
 {
     $ff_id = $this->_request->getParam('ff_id');
     $mgr_id = $this->_request->getParam('mgr_id');
     $pa_conf_id = $this->_request->getParam('pa_conf_id');
     $ques_id = $this->_request->getParam('ques_id');
     $ffinitModel = new Default_Model_Feedforwardinit();
     $ffEmpRatModel = new Default_Model_Feedforwardemployeeratings();
     $empsData = $ffinitModel->getDetailEmpsDataByMgrId($ff_id, $mgr_id);
     $quesData = $ffEmpRatModel->getFFQuesDataByIDs($empsData[0]['question_ids']);
     // Employee response
     $emp_response = array();
     if ($empsData[0]['employee_response']) {
         $emp_response = json_decode($empsData[0]['employee_response'], true);
     }
     // get rating details using configuration id
     $ratingsData = $ffEmpRatModel->getAppRatingsDataByConfgId($pa_conf_id);
     $ratingType = $ratingsData[0]['rating_type'];
     $ratingText = array();
     $ratingTextDisplay = array();
     $ratingValues = array();
     foreach ($ratingsData as $rd) {
         $ratingText[] = $rd['rating_text'];
         $ratingTextDisplay[$rd['id']] = $rd['rating_text'];
         $ratingValues[$rd['id']] = $rd['rating_value'];
     }
     $this->view->empsData = $empsData;
     $this->view->quesData = $quesData;
     $this->view->ratingType = $ratingType;
     $this->view->ratingTextDisplay = $ratingTextDisplay;
     $this->view->ratingText = json_encode($ratingText);
     $this->view->ratingValues = $ratingValues;
     $this->view->emp_response = $emp_response;
     $this->view->ques_id = $ques_id;
     $this->view->emp_view_flag = $this->_request->getParam('emp_view_flag');
     //Condition is for checking of additional questions click event
     $this->view->additional_Qflag = '';
     if ($ques_id == '') {
         $this->view->additional_Qflag = 'additional_flag';
     }
 }
 public function editAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     try {
         $message = $this->_getParam('msg');
         $flags = $this->_getParam('flags');
         if ($message == 'saved') {
             if ($flags == 'draft') {
                 $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => 'Employee response drafted successfully'));
                 $this->_redirect('feedforwardemployee/edit');
             }
         }
         $ffEmpRatingsModel = new Default_Model_Feedforwardemployeeratings();
         $ffEmpRatingsData = $ffEmpRatingsModel->getFFDataByEmpID($loginUserId);
         if (sizeof($ffEmpRatingsData) > 0 && $ffEmpRatingsData[0]['employee_id'] == $loginUserId && $ffEmpRatingsData[0]['status'] == 1 && $ffEmpRatingsData[0]['ff_status'] == APP_PENDING_EMP) {
             $ques_csv = '';
             if ($ffEmpRatingsData[0]['qs_privileges']) {
                 $ques_csv .= $ffEmpRatingsData[0]['questions'];
             }
             // get all questions data based on above question ids
             $questions_data = $ffEmpRatingsModel->getFFQuesDataByIDs($ques_csv);
             // Employee response
             $emp_response = array();
             if ($ffEmpRatingsData[0]['employee_response']) {
                 $emp_response = json_decode($ffEmpRatingsData[0]['employee_response'], true);
             }
             $question_previs = array();
             if ($ffEmpRatingsData[0]['qs_privileges']) {
                 $question_previs = json_decode($ffEmpRatingsData[0]['qs_privileges'], true);
             }
             // get rating details using configuration id
             $ratingsData = $ffEmpRatingsModel->getAppRatingsDataByConfgId($ffEmpRatingsData[0]['appraisal_id']);
             $ratingType = $ratingsData[0]['rating_type'];
             $ratingText = array();
             $ratingTextDisplay = array();
             $ratingValues = array();
             foreach ($ratingsData as $rd) {
                 $ratingText[] = $rd['rating_text'];
                 $ratingTextDisplay[$rd['id']] = $rd['rating_text'];
                 $ratingValues[$rd['id']] = $rd['rating_value'];
             }
             $this->view->ffEmpRatingsData = $ffEmpRatingsData;
             $this->view->questions_data = $questions_data;
             $this->view->ratingType = $ratingType;
             $this->view->ratingTextDisplay = $ratingTextDisplay;
             $this->view->ratingText = json_encode($ratingText);
             $this->view->ratingValues = $ratingValues;
             $this->view->emp_response = $emp_response;
             $this->view->question_previs = $question_previs;
             $this->view->check_ratings_exists = $ratingsData;
             $this->view->messages = $this->_helper->flashMessenger->getMessages();
         } else {
             $this->view->rowexist = "norows";
         }
     } catch (Exception $e) {
         $this->view->rowexist = "norows";
     }
 }