public function careereditAction()
 {
     $request = $this->getRequest();
     $oppid = $request->getParam("opportunityID", "");
     //$sestionClient = PR_Session::getSession(PR_Session::SESSION_USER);
     //$CompanyID = $sestionClient['CompanyID'];
     $Oppotunity_PR_Api = new PR_Api_Core_CareerClass();
     $getListOpp = $Oppotunity_PR_Api->getOpportunityInfoByID($oppid);
     $careerType = trim($getListOpp['jobtype']);
     $Career = $Oppotunity_PR_Api->getCareerTypeByID($careerType);
     $CareerList = $Oppotunity_PR_Api->getListCareer();
     $CompanyID = trim($getListOpp['CompanyID']);
     $companyInfo = $Oppotunity_PR_Api->getCompanyByID($CompanyID);
     $listCompany = $Oppotunity_PR_Api->getCompany();
     $resultSkillList = $Oppotunity_PR_Api->getListSkill();
     $getTestList_PR_Api_Core = new PR_Api_Core_TestClass();
     $resultTestList = $getTestList_PR_Api_Core->getTestList(array('CompanyID' => $CompanyID));
     $listCountry = $Oppotunity_PR_Api->getListCountry();
     $listExperienced = $Oppotunity_PR_Api->getListExperiencedTime();
     /*echo "<pre>";
       print_r($getListOpp);
         echo "</pre>"; die(); */
     $this->view->getListOpp = $getListOpp;
     $this->view->getListCareerType = $Career;
     $this->view->CareerList = $CareerList;
     $this->view->companyInfo = $companyInfo;
     $this->view->listCompany = $listCompany;
     $this->view->resultSkillList = $resultSkillList;
     $this->view->resultTestList = $resultTestList;
     $this->view->listCountry = $listCountry;
     $this->view->listExperienced = $listExperienced;
 }
 public function doSearchOpportunitiesAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $client = PR_Session::getSession(PR_Session::SESSION_USER);
     $CandidateProfileID = $client['CandidateProfileID'];
     $request = $this->getRequest();
     $params = $this->getRequest()->getParams();
     $industry = $request->getParam("technology_id", "");
     $experienced = $request->getParam("experience_name", "");
     $country = $request->getParam("country_name", "");
     $city = $request->getParam("city_name", "");
     if (isset($params['matchopportunitySear'])) {
         $opportunitiesSearchList = $request->getParam("matchopportunitySear", "");
     } else {
         $opportunitiesSearchList = array();
     }
     $core = new PR_Api_Core_CandidateClass();
     $opportunityListID = $core->getOpportunitiesMatch($industry, $experienced, $country, $city, $opportunitiesSearchList);
     $PR_Api = new PR_Api_Core_CareerClass();
     $oppList = array();
     //$result = array();
     if ($opportunityListID != "") {
         foreach ($opportunityListID as $key => $opportunityID) {
             $result = $PR_Api->getOpportunityInfoByID($opportunityID);
             $hadApplied = $core->opportunityCandidateHadApplied($opportunityID, $CandidateProfileID);
             if ($hadApplied) {
                 $result['hadApplied'] = true;
                 $oppList[] = $result;
             } else {
                 $result['hadApplied'] = false;
                 $oppList[] = $result;
             }
         }
     }
     $response = $this->getResponse();
     $response->clearAllHeaders()->clearBody();
     $oppList = json_encode($oppList);
     $response->setHeader('Content-type', 'application/json');
     $response->setHeader('Content-Length', strlen($oppList), true)->setBody($oppList);
     //$this->_helper->viewRenderer('matchopportunities');
 }