public function deleteNotificationsCheckedAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $sestionClient = PR_Session::getSession(PR_Session::SESSION_USER); $CompanyID = $sestionClient['CompanyID']; $clientID = $sestionClient['UserID']; $request = $this->getRequest(); $listNotiID = $request->getParam("listNotiID", ""); $core = new PR_Api_Core_NotiClass(); $rsl = $core->delete($listNotiID); if (empty($rsl)) { $return = 1; } else { $return = 0; } $notiClass = new PR_Api_Core_NotiClass(); $result = array(); $result['list'] = $notiClass->getList($clientID, $limit = 10, $offset = 0); $result['suc'] = $return; //reload $Career_PR_Api = new PR_Api_Core_CareerClass(); $receivIDs = $Career_PR_Api->getListReceiveIDbySenderID($clientID); $listCandidate1 = $Career_PR_Api->getListCandidateByUserID($receivIDs, 3, 0); $CompanyID = $sestionClient['CompanyID']; $listSkill = $Career_PR_Api->getSkillByCompanyID($CompanyID); $listCandidate = array(); $list = array(); if (!empty($listCandidate1) && count($listCandidate1) > 0) { foreach ($listCandidate1 as $kkk => $listCandidate1Info) { if (!empty($listCandidate1Info['Skills']) && count($listCandidate1Info['Skills']) > 0) { $list = ""; foreach ($listCandidate1Info['Skills'] as $listInfor) { if (!empty($listSkill) && count($listSkill) > 0) { foreach ($listSkill as $keylistskill => $listSkillInfo) { if ($listSkillInfo['SkillID'] == $listInfor['SkillID']) { $list[] = $listSkillInfo['title']; } } } } } if (!empty($list) && count($list) > 0) { $list = array_unique($list); $listCandidate1Info['strTitle'] = $list; $listCandidate[] = $listCandidate1Info; } } } $result['listCandidate'] = $listCandidate; //end $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); }
public function deleteNotificationsAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $request = $this->getRequest(); $listNotiID = $request->getParam("listNotiID", ""); $idCurrentActive = $request->getParam("idCurrentActive", ""); $core = new PR_Api_Core_NotiClass(); $return = $core->delete($listNotiID); if (empty($return)) { $return = array("success" => 1, "error" => ""); } else { $return = array("success" => 0, "error" => ""); } //return $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); }