deleted static pages

This commit is contained in:
Joshua Perry 2023-01-25 14:27:00 +00:00
parent 10466ec99a
commit 0570a65501
7 changed files with 0 additions and 687 deletions

View File

@ -1,112 +0,0 @@
<?php
$pdo = new PDO('mysql:dbname=job;host=mysql', 'student', 'student');
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/styles.css"/>
<title>Jo's Jobs - Add Category</title>
</head>
<body>
<header>
<section>
<aside>
<h3>Office Hours:</h3>
<p>Mon-Fri: 09:00-17:30</p>
<p>Sat: 09:00-17:00</p>
<p>Sun: Closed</p>
</aside>
<h1>Jo's Jobs</h1>
</section>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li>Jobs
<ul>
<li><a href="/it.php">IT</a></li>
<li><a href="/hr.php">Human Resources</a></li>
<li><a href="/sales.php">Sales</a></li>
</ul>
</li>
<li><a href="/about.html">About Us</a></li>
</ul>
</nav>
<img src="/images/randombanner.php"/>
<main class="sidebar">
<section class="left">
<ul>
<li><a href="jobs.php">Jobs</a></li>
<li><a href="categories.php">Categories</a></li>
</ul>
</section>
<section class="right">
<?php
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
if (isset($_POST['submit'])) {
$stmt = $pdo->prepare('INSERT INTO category (name) VALUES (:name)');
$criteria = [
'name' => $_POST['name']
];
$stmt->execute($criteria);
echo 'Category added';
}
else {
?>
<h2>Add Category</h2>
<form action="" method="POST">
<label>Name</label>
<input type="text" name="name" />
<input type="submit" name="submit" value="Add Category" />
</form>
<?php
}
}
else {
?>
<h2>Log in</h2>
<form action="index.php" method="post">
<label>Password</label>
<input type="password" name="password" />
<input type="submit" name="submit" value="Log In" />
</form>
<?php
}
?>
</section>
</main>
<footer>
&copy; Jo's Jobs 2017
</footer>
</body>
</html>

View File

@ -1,149 +0,0 @@
<?php
$pdo = new PDO('mysql:dbname=job;host=mysql', 'student', 'student');
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/styles.css"/>
<title>Jo's Jobs - Add Job</title>
</head>
<body>
<header>
<section>
<aside>
<h3>Office Hours:</h3>
<p>Mon-Fri: 09:00-17:30</p>
<p>Sat: 09:00-17:00</p>
<p>Sun: Closed</p>
</aside>
<h1>Jo's Jobs</h1>
</section>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li>Jobs
<ul>
<li><a href="/it.php">IT</a></li>
<li><a href="/hr.php">Human Resources</a></li>
<li><a href="/sales.php">Sales</a></li>
</ul>
</li>
<li><a href="/about.html">About Us</a></li>
</ul>
</nav>
<img src="/images/randombanner.php"/>
<main class="sidebar">
<section class="left">
<ul>
<li><a href="jobs.php">Jobs</a></li>
<li><a href="categories.php">Categories</a></li>
</ul>
</section>
<section class="right">
<?php
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
if (isset($_POST['submit'])) {
$stmt = $pdo->prepare('INSERT INTO job (title, description, salary, location, closingDate, categoryId)
VALUES (:title, :description, :salary, :location, :closingDate, :categoryId)');
$criteria = [
'title' => $_POST['title'],
'description' => $_POST['description'],
'salary' => $_POST['salary'],
'location' => $_POST['location'],
'categoryId' => $_POST['categoryId'],
'closingDate' => $_POST['closingDate'],
];
$stmt->execute($criteria);
echo 'Job Added';
}
else {
?>
<h2>Add Job</h2>
<form action="addjob.php" method="POST"">
<label>Title</label>
<input type="text" name="title" />
<label>Description</label>
<textarea name="description"></textarea>
<label>Salary</label>
<input type="text" name="salary" />
<label>Location</label>
<input type="text" name="location" />
<label>Category</label>
<select name="categoryId">
<?php
$stmt = $pdo->prepare('SELECT * FROM category');
$stmt->execute();
foreach ($stmt as $row) {
echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
}
?>
</select>
<label>Closing Date</label>
<input type="date" name="closingDate" />
<input type="submit" name="submit" value="Add" />
</form>
<?php
}
}
else {
?>
<h2>Log in</h2>
<form action="index.php" method="post">
<label>Password</label>
<input type="password" name="password" />
<input type="submit" name="submit" value="Log In" />
</form>
<?php
}
?>
</section>
</main>
<footer>
&copy; Jo's Jobs 2017
</footer>
</body>
</html>

View File

@ -1,116 +0,0 @@
<?php
$pdo = new PDO('mysql:dbname=job;host=mysql', 'student', 'student');
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/styles.css"/>
<title>Jo's Jobs - Applicants</title>
</head>
<body>
<header>
<section>
<aside>
<h3>Office Hours:</h3>
<p>Mon-Fri: 09:00-17:30</p>
<p>Sat: 09:00-17:00</p>
<p>Sun: Closed</p>
</aside>
<h1>Jo's Jobs</h1>
</section>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li>Jobs
<ul>
<li><a href="/it.php">IT</a></li>
<li><a href="/hr.php">Human Resources</a></li>
<li><a href="/sales.php">Sales</a></li>
</ul>
</li>
<li><a href="/about.html">About Us</a></li>
</ul>
</nav>
<img src="/images/randombanner.php"/>
<main class="sidebar">
<section class="left">
<ul>
<li><a href="jobs.php">Jobs</a></li>
<li><a href="categories.php">Categories</a></li>
</ul>
</section>
<section class="right">
<?php
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
$stmt = $pdo->prepare('SELECT * FROM job WHERE id = :id');
$stmt->execute(['id' => $_GET['id']]);
$job = $stmt->fetch();
?>
<h2>Applicants for <?=$job['title'];?></h2>
<?php
echo '<table>';
echo '<thead>';
echo '<tr>';
echo '<th style="width: 10%">Name</th>';
echo '<th style="width: 10%">Email</th>';
echo '<th style="width: 65%">Details</th>';
echo '<th style="width: 15%">CV</th>';
echo '</tr>';
$stmt = $pdo->prepare('SELECT * FROM applicants WHERE jobId = :id');
$stmt->execute(['id' => $_GET['id']]);
foreach ($stmt as $applicant) {
echo '<tr>';
echo '<td>' . $applicant['name'] . '</td>';
echo '<td>' . $applicant['email'] . '</td>';
echo '<td>' . $applicant['details'] . '</td>';
echo '<td><a href="/cvs/' . $applicant['cv'] . '">Download CV</a></td>';
echo '</tr>';
}
echo '</thead>';
echo '</table>';
}
else {
?>
<h2>Log in</h2>
<form action="index.php" method="post">
<label>Password</label>
<input type="password" name="password" />
<input type="submit" name="submit" value="Log In" />
</form>
<?php
}
?>
</section>
</main>
<footer>
&copy; Jo's Jobs 2017
</footer>
</body>
</html>

View File

@ -1,14 +0,0 @@
<?php
$pdo = new PDO('mysql:dbname=job;host=mysql', 'student', 'student');
session_start();
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
$stmt = $pdo->prepare('DELETE FROM category WHERE id = :id');
$stmt->execute(['id' => $_POST['id']]);
header('location: categories.php');
}

View File

@ -1,14 +0,0 @@
<?php
$pdo = new PDO('mysql:dbname=job;host=mysql', 'student', 'student');
session_start();
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
$stmt = $pdo->prepare('DELETE FROM job WHERE id = :id');
$stmt->execute(['id' => $_POST['id']]);
header('location: jobs.php');
}

View File

@ -1,117 +0,0 @@
<?php
$pdo = new PDO('mysql:dbname=job;host=mysql', 'student', 'student');
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/styles.css"/>
<title>Jo's Jobs - Edit Category</title>
</head>
<body>
<header>
<section>
<aside>
<h3>Office Hours:</h3>
<p>Mon-Fri: 09:00-17:30</p>
<p>Sat: 09:00-17:00</p>
<p>Sun: Closed</p>
</aside>
<h1>Jo's Jobs</h1>
</section>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li>Jobs
<ul>
<li><a href="/it.php">IT</a></li>
<li><a href="/hr.php">Human Resources</a></li>
<li><a href="/sales.php">Sales</a></li>
</ul>
</li>
<li><a href="/about.html">About Us</a></li>
</ul>
</nav>
<img src="/images/randombanner.php"/>
<main class="sidebar">
<section class="left">
<ul>
<li><a href="jobs.php">Jobs</a></li>
<li><a href="categories.php">Categories</a></li>
</ul>
</section>
<section class="right">
<?php
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
if (isset($_POST['submit'])) {
$stmt = $pdo->prepare('UPDATE category SET name = :name WHERE id = :id ');
$criteria = [
'name' => $_POST['name'],
'id' => $_POST['id']
];
$stmt->execute($criteria);
echo 'Category Saved';
}
else {
$currentCategory = $pdo->query('SELECT * FROM category WHERE id = ' . $_GET['id'])->fetch();
?>
<h2>Edit Category</h2>
<form action="" method="POST">
<input type="hidden" name="id" value="<?php echo $currentCategory['id']; ?>" />
<label>Name</label>
<input type="text" name="name" value="<?php echo $currentCategory['name']; ?>" />
<input type="submit" name="submit" value="Save Category" />
</form>
<?php
}
}
else {
?>
<h2>Log in</h2>
<form action="index.php" method="post">
<label>Password</label>
<input type="password" name="password" />
<input type="submit" name="submit" value="Log In" />
</form>
<?php
}
?>
</section>
</main>
<footer>
&copy; Jo's Jobs 2017
</footer>
</body>
</html>

View File

@ -1,165 +0,0 @@
<?php
$pdo = new PDO('mysql:dbname=job;host=mysql', 'student', 'student');
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/styles.css"/>
<title>Jo's Jobs - Edit Job</title>
</head>
<body>
<header>
<section>
<aside>
<h3>Office Hours:</h3>
<p>Mon-Fri: 09:00-17:30</p>
<p>Sat: 09:00-17:00</p>
<p>Sun: Closed</p>
</aside>
<h1>Jo's Jobs</h1>
</section>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li>Jobs
<ul>
<li><a href="/it.php">IT</a></li>
<li><a href="/hr.php">Human Resources</a></li>
<li><a href="/sales.php">Sales</a></li>
</ul>
</li>
<li><a href="/about.html">About Us</a></li>
</ul>
</nav>
<img src="/images/randombanner.php"/>
<main class="sidebar">
<section class="left">
<ul>
<li><a href="jobs.php">Jobs</a></li>
<li><a href="categories.php">Categories</a></li>
</ul>
</section>
<section class="right">
<?php
if (isset($_POST['submit'])) {
$stmt = $pdo->prepare('UPDATE job
SET title = :title,
description = :description,
salary = :salary,
location = :location,
categoryId = :categoryId,
closingDate = :closingDate
WHERE id = :id
');
$criteria = [
'title' => $_POST['title'],
'description' => $_POST['description'],
'salary' => $_POST['salary'],
'location' => $_POST['location'],
'categoryId' => $_POST['categoryId'],
'closingDate' => $_POST['closingDate'],
'id' => $_POST['id']
];
$stmt->execute($criteria);
echo 'Job saved';
}
else {
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
$stmt = $pdo->prepare('SELECT * FROM job WHERE id = :id');
$stmt->execute($_GET);
$job = $stmt->fetch();
?>
<h2>Edit Job</h2>
<form action="editjob.php" method="POST">
<input type="hidden" name="id" value="<?php echo $job['id']; ?>" />
<label>Title</label>
<input type="text" name="title" value="<?php echo $job['title']; ?>" />
<label>Description</label>
<textarea name="description"><?php echo $job['description']; ?></textarea>
<label>Location</label>
<input type="text" name="location" value="<?php echo $job['location']; ?>" />
<label>Salary</label>
<input type="text" name="salary" value="<?php echo $job['salary']; ?>" />
<label>Category</label>
<select name="categoryId">
<?php
$stmt = $pdo->prepare('SELECT * FROM category');
$stmt->execute();
foreach ($stmt as $row) {
if ($job['categoryId'] == $row['id']) {
echo '<option selected="selected" value="' . $row['id'] . '">' . $row['name'] . '</option>';
}
else {
echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
}
}
?>
</select>
<label>Closing Date</label>
<input type="date" name="closingDate" value="<?php echo $job['closingDate']; ?>" />
<input type="submit" name="submit" value="Save" />
</form>
<?php
}
else {
?>
<h2>Log in</h2>
<form action="index.php" method="post">
<label>Password</label>
<input type="password" name="password" />
<input type="submit" name="submit" value="Log In" />
</form>
<?php
}
}
?>
</section>
</main>
<footer>
&copy; Jo's Jobs 2017
</footer>
</body>
</html>