public function candidateApplyAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $client = PR_Session::getSession(PR_Session::SESSION_USER);
     $params = $this->getRequest()->getParams();
     $CandidateProfileID = $params['CandidateProfileID'];
     $OpportunityID = $params['OpportunityID'];
     $OppCandidateAppliedStatus = 1;
     $CandidateHideStatus = 1;
     $updateFields = array('OpportunityID' => $OpportunityID, 'CandidateProfileID' => $CandidateProfileID, 'CandidateAppliedStatus' => $OppCandidateAppliedStatus, 'CandidateHideStatus' => $CandidateHideStatus);
     $core = new PR_Api_Core_CandidateClass();
     $result = $core->saveOpportunityCandidateApply($updateFields);
     /*echo "<pre>";
           print_r($OpportunityCandidateApplyID);
       echo "</pre>"; die(); */
     if ($result) {
         $return = array("success" => 1, "error" => "Apply successfully");
     } else {
         $return = array("success" => 0, "error" => "You had applied the job");
     }
     $response = $this->getResponse();
     $response->clearAllHeaders()->clearBody();
     $return = json_encode($return);
     $response->setHeader('Content-type', 'application/json');
     $response->setHeader('Content-Length', strlen($return), true)->setBody($return);
 }