started auction edit capability
This commit is contained in:
parent
8e497df9b5
commit
05f96aa493
|
|
@ -29,12 +29,13 @@ if (isset($_POST['submit'])) {
|
||||||
$user = $stmt->fetch();
|
$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 = [
|
$values = [
|
||||||
'title' => $_POST['title'],
|
'title' => $_POST['title'],
|
||||||
'description' => $_POST['description'],
|
'description' => $_POST['description'],
|
||||||
'endDate' => $_POST['endDate'],
|
'endDate' => $_POST['endDate'],
|
||||||
'categoryId' => $_POST['category'],
|
'categoryID' => intval($_POST['category']),
|
||||||
'email' => $user['email']
|
'email' => $user['email']
|
||||||
];
|
];
|
||||||
$stmt->execute($values);
|
$stmt->execute($values);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
session_start();
|
||||||
require_once '../functions.php';
|
require_once '../functions.php';
|
||||||
$pageTitle = 'iBuy - Product Listing';
|
$pageTitle = 'iBuy - Product Listing';
|
||||||
$pageContent = '<h1>Product Page</h1>
|
$pageContent = '<h1>Product Page</h1>
|
||||||
|
|
@ -75,6 +76,10 @@ function populateContent() {
|
||||||
</form>
|
</form>
|
||||||
</section>';
|
</section>';
|
||||||
|
|
||||||
|
if($user['user_id'] === $_SESSION['loggedin']) {
|
||||||
|
$output .= '<a href ="account/editAuction.php?listing_id='. $listing['listing_id'] . '">edit</a>';
|
||||||
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue