started auction edit capability
This commit is contained in:
parent
8e497df9b5
commit
05f96aa493
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue