public function deleteTestAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $sestionClient = PR_Session::getSession(PR_Session::SESSION_USER);
     $CompanyID = $sestionClient['CompanyID'];
     $request = $this->getRequest();
     $testID = array();
     $testID[] = $request->getParam("testID", "");
     $return = 0;
     $Test_Core = new PR_Api_Core_TestClass();
     $rsl = $Test_Core->delete($testID);
     if ($rsl !== 0) {
         $return = 1;
     } else {
         $return = 0;
     }
     $notiClass = new PR_Api_Core_NotiClass();
     $messageList = $notiClass->getList($CompanyID);
     $result = array();
     $result['list'] = $Test_Core->getTestList(array('CompanyID' => $CompanyID), 10, 0);
     $result['suc'] = $return;
     /* echo "<pre>";
        print_r($result);
        echo "</pre>"; die(); */
     $response = $this->getResponse();
     $response->clearAllHeaders()->clearBody();
     $result = json_encode($result);
     $response->setHeader('Content-type', 'application/json');
     $response->setHeader('Content-Length', strlen($result), true)->setBody($result);
 }
Пример #2
0
 public function removeTestAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $ajaxRes = array('success' => 0, 'info' => null);
     $params = $this->getRequest()->getParams();
     $tid = $params['dataTId'];
     if ($tid > 0) {
         $arrTid = array();
         array_push($arrTid, $tid);
         $core = new PR_Api_Core_TestClass();
         $core->delete($arrTid);
         $ajaxRes['info'] = '';
         $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);
 }