public function updateCandidateProfile($userID, $updatefiles) { $avaiFields = array("firstname", "lastname", "CandidateProfileID", "tagline", "overview", "minimumsalary", "maximumsalary", "CandidateSkillID", "SkillID", "keywords", "servicedescription"); $api = new PR_Api_Core_CandidateClass(); $listskill = $updatefiles["SkillID"]; //echo("tetst:");print_r($listskill);die(); // update table user $updateFields = array('firstname' => $updatefiles["firstname"], 'lastname' => $updatefiles["lastname"]); $criteria = "UserID = '{$userID}'"; PR_Database::update('user', $updateFields, $criteria); //update table candidate $candidateInfo = $api->getCandidateInfo($userID); if (count($candidateInfo) == 0) { return 0; } $candidateProfileID = $candidateInfo['CandidateProfileID']; $updateFields1 = array('tagline' => $updatefiles["tagline"], 'overview' => $updatefiles["overview"], 'minimumsalary' => $updatefiles["minimumsalary"], 'maximumsalary' => $updatefiles["maximumsalary"], 'keywords' => $updatefiles["keywords"], 'servicedescription' => $updatefiles["servicedescription"]); $criteria1 = "CandidateProfileID = '{$candidateProfileID}'"; PR_Database::update('candidate_profile', $updateFields1, $criteria1); $db = PR_Database::getInstance(); $select = $db->select(); $select->from('candidate_skill', array('*')); $select->where("CandidateProfileID = '{$candidateProfileID}'"); $records = PR_Database::fetchAll($select); if (empty($records) && count($records) > 0) { return -1; } $CandidateSkillID = $records[0]['CandidateProfileID']; $skillIDs = array(); foreach ($listskill as $Skills) { $skillIDs[] = $Skills["SkillID"]; } // echo("tetst:");print_r($skillIDs);die(); $api->saveCandidateSkills($userID, $CandidateSkillID, $skillIDs); }
function doLoginAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $request = $this->getRequest(); $username = $request->getParam("email", ""); $password = $request->getParam("password", ""); $return = array("success" => 0, "error" => "usertype", "" => ""); //echo ("username:"******"active"] == 1) { PR_Session::setSession($client, PR_Session::SESSION_USER); $user = PR_Session::getSession(PR_Session::SESSION_USER); //echo("user:"******"userID:".$userID); $userApi->UpdateLastsigned($userID); $return['success'] = 1; $return['usertype'] = $user["usertype"]; if ($user["usertype"] == USER_TYPE_CANDIDATE) { $coreCandi = new PR_Api_Core_CandidateClass(); $coreCandi->createCandidateProfileID($userID); } } else { // $return['error'] = PR_Api_Error::getInstance()->getFirstError(); $return['error'] = "Account not activated. Please check email and active."; } //echo ("etsttt:<pre>");print_r($client);echo("</pre>");die(); //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); }
public function doUpdateSkillsnewAction() { $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; } } } $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); }
public function careermatchPremiumAccountAction() { $this->_helper->layout->disableLayout(); $client = PR_Session::getSession(PR_Session::SESSION_USER); $CandidateProfileID = $client['CandidateProfileID']; $request = $this->getRequest(); $params = $this->getRequest()->getParams(); if (isset($params['skill_match_premium'])) { $skill_match_premium = $request->getParam("skill_match_premium", ""); } else { $skill_match_premium = array(); } if (isset($params['keyword_match_premium'])) { $keyword_match_premium = $request->getParam("keyword_match_premium", ""); } else { $keyword_match_premium = array(); } $PR_Api = new PR_Api_Core_CareerClass(); $listCandidateID = $PR_Api->getCandidateProfileIDsForCareerMatchPremiumAccount($keyword_match_premium, $skill_match_premium); $result = $PR_Api->getCandidateProfiles_byProfileIDs($listCandidateID); $candidateInfo = array(); if ($result) { $PR_Api_CandidateClass = new PR_Api_Core_CandidateClass(); foreach ($result as $k => $info) { $skID = $PR_Api_CandidateClass->getList_CandidateSkillsOnly($info['UserID']); $sk = array(); if ($skID) { foreach ($skID as $key => $skInfo) { $sk[] = $skInfo['SkillName']; } } else { $sk[] = ""; } $info['skillName'] = $sk; $candidateInfo[] = $info; } } $this->view->CandidateProfileID = $CandidateProfileID; $this->view->result = $candidateInfo; }