function CheckMDL($caaejgcfae, $ecijiaihab, $cicafffiid, $deifhbbeg) { global $ListUrl; global $siteslisted; global $totallist; $didedhejch = curl_init(); curl_setopt($didedhejch, CURLOPT_URL, str_replace('!!URL!!', $ecijiaihab, $eaecfaiafc[$caaejgcfae])); curl_setopt($didedhejch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($didedhejch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($didedhejch, CURLOPT_POST, 0); curl_setopt($didedhejch, CURLOPT_TIMEOUT, 30); $cfaefdjje = curl_exec($didedhejch); curl_close($didedhejch); $jeigbeih = 0; if (strstr($cfaefdjje, $cicafffiid)) { $jeigbeih = 1; ++$bhfgcaehfd; $dgicdacbch .= findName($cicafffiid) . ', '; } return $jeigbeih; }
$result = dbSelect(JOB_TABLE, "WHERE job_id = " . $job_id); $row = mysql_fetch_assoc($result); $job_keyword = $row['job_keyword']; $job_keyword_string = explode(",", $job_keyword); $importance = $row['keyword_importance']; $importance_string = explode(",", $importance); $fullMark = 0; foreach ($job_keyword_string as $index => $keyword) { $job_keyword_arr[$keyword] = $importance_string[$index]; $fullMark += $importance_string[$index]; } # Extract the cv information $cv_description = $_SESSION['cv_description'][$CV_id]; $cv_email = findEmail($cv_description); $cv_phone = findPhoneNumber($cv_description); $cv_name = findName($cv_description); $result = matchingJobAndCV($cv_description, $job_keyword_arr); foreach ($result as $key => $value) { $matched_keyword = $key; $grade = $value; } $percentage = round($grade / $fullMark * 100, 2); # Update the cv information in database dbUpdate(CV_TABLE, "cv_keyword = '{$matched_keyword}', cv_name = '{$cv_name}', cv_phone = '{$cv_phone}',\n cv_email = '{$cv_email}', cv_grade = '{$percentage}'", "WHERE cv_id = '{$CV_id}'"); function findEmail($a) { $lastPos = 0; // while (($lastPos = strpos($a, "@", $lastPos))!== false) { $b4 = stristr($a, "@", true); $b4pos = strripos($b4, " ") + 1; $b4 = trim(substr($b4, $b4pos));
} catch (Exception $e) { echo $sql3 . "<br>" . $e->getMessage(); fclose($file2); } //----end page table import------------*/ //start PageInfo table import--(working)-- try { rewind($fp2); $data3 = []; for ($i = 0; $i < 5; $i++) { fgetcsv($fp2); } while (($data3 = fgetcsv($fp2)) !== FALSE) { $lastName = trim($data3[0]); $firstName = trim($data3[1]); $personId = findName($lastName, $firstName, $pdo); $page = trim($data3[6]); $pageId = findPage($publicationId, $page, $pdo); $description = trim($data3[7]); $type = trim($data3[8]); // Insert Data $sql4 = $pdo->prepare("INSERT INTO PageInfo (Description,Type,Person_PersonId,Page_PageId,Publication_PublicationId)\n VALUES (?,?,?,?,?)"); $sql4->execute(array($description, $type, $personId, $pageId, $publicationId)); } // echo "all imports complete"; fclose($file2); } catch (Exception $e) { echo $sql4 . "<br>" . $e->getMessage(); fclose($file2); } //end PageInfo table import--*/
<li><a href="index.php">Home</a></li> <li><a href="ChoosePublicationToView.php">View Publications</a></li> <li><a href="importFile.php">Import Publication</a></li> <li><a href="search.php">New Search</a></li> <li>About</li> <li><a href="SearchResultsViewAll.php"> View All </a></li> <li><i>Viewer courtesy of BookBlock</i></li> </ul> <!--Banner and navigation bar !--> </div> <?php if (!isset($_SESSION['SearchResults'])) { //sanitize form data and find personId number $cleanLastName = cleanName($_POST['lname']); $cleanFirstName = cleanName($_POST['fname']); $_SESSION['personId'] = findName($cleanLastName, $cleanFirstName, $pdo); if ($_POST['PubName'] == 'All') { $sql = $pdo->prepare("SELECT Page_PageId FROM PageInfo WHERE Person_PersonId=?"); $sql->execute(array($_SESSION['personId'])); $resultPageIds = $sql->fetchAll(PDO::FETCH_ASSOC); $_SESSION['row_count'] = $sql->rowCount(); } else { //find publication id $sql = $pdo->prepare("SELECT PublicationId FROM Publication WHERE Name=?"); $sql->execute(array($_POST['PubName'])); $_SESSION['publicationId'] = $sql->fetchColumn(); $sql = $pdo->prepare("SELECT Page_PageId FROM PageInfo WHERE Person_PersonId=? && Publication_PublicationId=?"); $sql->execute(array($_SESSION['personId'], $_SESSION['publicationId'])); $resultPageIds = $sql->fetchAll(PDO::FETCH_ASSOC); $_SESSION['row_count'] = $sql->rowCount(); }