コード例 #1
0
 public function doUpdateSkillsAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $ajaxRes = array('success' => 0, 'info' => null);
     if ($this->getRequest()->isXmlHttpRequest()) {
         $params = $this->getRequest()->getParams();
         /*
                     if(!empty($params['data']) && sizeof($params['data']) > 0){
                         $core = new PR_Api_Core_CandidateClass();
                         $client = PR_Session::getSession(PR_Session::SESSION_USER);
                         if($core->updateCandidateSkill($client['CandidateProfileID'],$params['data'])){
                             $ajaxRes['success'] = 1;
                         }
                     } */
         if (isset($params['data'])) {
             $attributeIDs = $params['data'];
         } else {
             $attributeIDs = array();
         }
         /* echo "<pre>";
            echo "test = "; print_r($attributeIDs);
            echo "</pre>"; die(); */
         $core = new PR_Api_Core_CandidateClass();
         $client = PR_Session::getSession(PR_Session::SESSION_USER);
         if ($core->updateCandidateAttribute($client['CandidateProfileID'], $attributeIDs)) {
             $ajaxRes['success'] = 1;
         }
     }
     $response = $this->getResponse();
     $response->clearAllHeaders()->clearBody();
     $ajaxRes = json_encode($ajaxRes);
     $response->setHeader('Content-type', 'application/json');
     $response->setHeader('Content-Length', strlen($ajaxRes), true)->setBody($ajaxRes);
 }