<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="css/960_16_col.css"> <link rel="stylesheet" href="css/pageStyle.css"> <link rel="stylesheet" href="css/bootstrap.css"> <title> Saved Job Applications </title> </head> <body> <?php try { ini_set("display_errors", 1); $connection = DB::getConnection(DB::host, DB::database, DB::user, DB::password); // gets the user id and searches for a matching id in the member table and displays the user's details $sTable = new seekerTable($connection); $jsTable = new jobSaveTable($connection); $jTable = new jobsTable($connection); $id = $_SESSION['id']; $jobSaves = $jsTable->showAllUnseen(); $duplicate = false; $saveNum = $_GET['saveNum']; $count = $saveNum; $limit = $count + 10; $loopPass = 0; $previousSaveNum = $saveNum - 10; $jobs = $jTable->showAll(); $seeker = $sTable->findById($id); $theme = $seeker->getTheme(); } catch (PODException $e) { $connection = null;
$password = $_POST['password']; $location = "Update"; $experience = "Update"; $education = "Update"; //theme variable stores the value "-default" - used to display default css div theme $theme = "-default"; //pic variable uses the uploadPicture method to pass the picture file to the correct directory $pic = uploadPicture($picture); //checks if image has been added, if not, default image is chosen if ($pic === NULL) { $pic = "noImage.jpeg"; } try { ini_set("display_errors", 1); //establish a connection $connection = DB::getConnection(DB::host, DB::database, DB::user, DB::password); //instantiate a new seeker table, passing the connection details as a parameter $table = new seekerTable($connection); //instantiate a new seeker object $seeker = new seeker(-1, $fName, $lName, $dob, $email, $password, $location, $experience, $education, $bio, $theme, $pic); //addSeeker will add the newly created seeker object into the database and return the id which will be stored. $id = $table->addSeeker($seeker); //the seeker object's id will be set. $seeker->setId($id); //redirect to the login page header("Location: login.php"); } catch (PDOException $e) { //if a problem occurs, close the connection. $connection = null; exit("Connection failed: " . $e->getMessage()); }
<?php session_start(); require_once 'DB.php'; require_once 'seekerTable.php'; require_once 'employerTable.php'; //Set and sanitize the user inputs $email = filter_var($_POST['email'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $pass = filter_var($_POST['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); //if data has been set if ($email && $pass) { try { ini_set("display_errors", 1); ob_start(); $connection = DB::getConnection(DB::host, DB::database, DB::user, DB::password); $seekerTable = new seekerTable($connection); $employerTable = new employerTable($connection); $seekers = $seekerTable->showAll(); $employers = $employerTable->showAll(); foreach ($seekers as $seeker) { $dbSeekerEmail = $seeker->getEmail(); $dbPassWord = $seeker->getPassword(); $dbSeekerName = $seeker->getFName(); $dbTheme = $seeker->getTheme(); $dbId = $seeker->getId(); // if match has been found, session will be created with the user's username (first name) ELSE return to login page if (strpos(strtoupper($email), strtoupper($dbSeekerEmail)) !== false && $pass == $dbPassWord) { $_SESSION['seeker'] = $dbSeekerName; $_SESSION['id'] = $dbId; $_SESSION['theme'] = $dbTheme; header("Location: sControlPanel.php");
<?php session_start(); if (!$_SESSION['seeker']) { header("location: login.php"); } require_once 'DB.php'; require_once 'seekerTable.php'; require_once 'seeker.php'; try { ini_set("display_errors", 1); $connection = DB::getConnection(DB::host, DB::database, DB::user, DB::password); //gets the user id and searches the member table for matching id $id = $_SESSION["id"]; $table = new seekerTable($connection); $seeker = $table->findById($id); $theme = $seeker->getTheme(); if (isset($_POST['submit'])) { $search = filter_var($_POST['search'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); } } catch (PDOException $e) { $connection = null; exit("Connection failed: " . $e->getMessage()); } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="css/960_16_col.css">