started auction edit capability

This commit is contained in:
Joshua Perry 2022-11-20 14:20:17 +00:00
parent 8e497df9b5
commit 05f96aa493
2 changed files with 8 additions and 2 deletions

View File

@ -29,12 +29,13 @@ if (isset($_POST['submit'])) {
$user = $stmt->fetch();
$stmt = $pdo->prepare('INSERT INTO auction (title, description, endDate, categoryId, email) VALUES (:title, :description, :endDate, :categoryID, :email)');
$stmt = $pdo->prepare('INSERT INTO auction (title, description, endDate, categoryId, email)
VALUES (:title, :description, :endDate, :categoryID, :email)');
$values = [
'title' => $_POST['title'],
'description' => $_POST['description'],
'endDate' => $_POST['endDate'],
'categoryId' => $_POST['category'],
'categoryID' => intval($_POST['category']),
'email' => $user['email']
];
$stmt->execute($values);

View File

@ -1,4 +1,5 @@
<?php
session_start();
require_once '../functions.php';
$pageTitle = 'iBuy - Product Listing';
$pageContent = '<h1>Product Page</h1>
@ -75,6 +76,10 @@ function populateContent() {
</form>
</section>';
if($user['user_id'] === $_SESSION['loggedin']) {
$output .= '<a href ="account/editAuction.php?listing_id='. $listing['listing_id'] . '">edit</a>';
}
return $output;
}
?>