<?php

session_start();
//if the session is not the specified seeker session created at login - the user
//will be redirected to the login page.
if (!$_SESSION['seeker']) {
    header("location: login.php");
}
//require the necessary classes
require_once 'DB.php';
require_once 'jobSaveTable.php';
//store the saveId value passed through the GET method.
$saveId = $_GET['saveId'];
try {
    ini_set("display_errors", 1);
    $connection = DB::getConnection(DB::host, DB::database, DB::user, DB::password);
    //instantiate a new jobSaveTable - passing in the connection as the parameters.
    $table = new jobSaveTable($connection);
    //execute the deleteSaveApplication method passing the stored save id as a parameter.
    $table->deleteSaveApplication($saveId);
    //redirect the seeker back to the viewSavedApplications page.
    header("Location: viewSavedApplications.php?saveNum=0");
} catch (PDOException $e) {
    //if a problem occurs - close the connection.
    $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">
        <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;
    exit("Connection Failed: " . $e->getMessage());
<?php

mysql_connect("daneel", "N00090048", "N00090048");
mysql_select_db("n00090048");
require_once 'DB.php';
require_once 'seekerTable.php';
require_once 'jobSaveTable.php';
$sId = $_POST['sId'];
$sId = (int) $sId;
$jId = $_POST['jId'];
$jId = (int) $jId;
$seen = 1;
$status = $seen;
$saveDate = getdate();
//if data has been set
try {
    ini_set("display_errors", 1);
    ob_start();
    $connection = DB::getConnection(DB::host, DB::database, DB::user, DB::password);
    $seekerTable = new seekerTable($connection);
    $jobSaveTable = new jobSaveTable($connection);
    $jobSave = new jobSave(-1, $sId, $jId, $status, $saveDate);
    $id = $jobSaveTable->addJobSave($jobSave);
    $jobSave->setId($id);
} catch (PDOException $e) {
    $connection = null;
    exit("Connection failed: " . $e->getMessage());
}