public function editJobFunctionNewAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $ajaxRes = array('success' => 0, 'info' => null); if ($this->getRequest()->isXmlHttpRequest()) { $params = $this->getRequest()->getParams(); $id = isset($params['id']) ? $params['id'] : null; $core = new PR_Api_Core_CandidateClass(); $ajaxRes['info'] = $core->getjobfunctionsid($id); // echo "tetst:<pre>";print_r($ajaxRes['info']);echo("</pre>"); // $Percentage=$ajaxRes['info']['Percentage']; // $ajaxRes['info']['Percentage']=round($Percentage*100,2); if (sizeof($ajaxRes['info']) > 0) { $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); }