diff --git a/public/account/login.php b/public/account/login.php index 66b2853..031a3b4 100644 --- a/public/account/login.php +++ b/public/account/login.php @@ -23,7 +23,7 @@ if (isset($_POST['submit'])) { $user = $stmt->fetch(); if (password_verify($_POST['password'], $user['password'])) { $_SESSION['loggedin'] = $user['user_id']; - echo'

Successful login

'; + echo''; if ($user['admin'] === 'y') { $_SESSION['loggedin'] = 'y'; } diff --git a/public/account/register.php b/public/account/register.php index 0eead8b..8efff36 100644 --- a/public/account/register.php +++ b/public/account/register.php @@ -1,5 +1,4 @@ Already have an account?Click here to L '; require '../../layout.php'; - if (isset($_POST['submit'])) { addUser(); echo '

Successful account creation

'; diff --git a/public/index.php b/public/index.php index 689895d..4383b37 100644 --- a/public/index.php +++ b/public/index.php @@ -1,7 +1,6 @@ '.$pageHeading.' '; require '../layout.php'; + function populateList($category) { //TODO: This will need to be updated to populate from the database $output = ''; $server = 'mysql'; @@ -24,7 +24,7 @@ function populateList($category) { //TODO: This will need to be updated to popul $pdo = new PDO('mysql:dbname=' . $schema . ';host=' . $server, $username, $password); if ($category === 'Latest Listings') { - $stmt = $pdo->prepare('SELECT * FROM listings WHERE listing_deadline > "'. date("Y-m-d h:i:s"). '" ORDER BY listing_deadline DESC'); + $stmt = $pdo->prepare('SELECT * FROM listings WHERE listing_deadline > "'. date("Y-m-d H:i:s"). '" ORDER BY listing_deadline DESC'); $stmt->execute(); $listings = $stmt->fetchAll(); } diff --git a/public/listing.php b/public/listing.php index 3d1c473..86b510a 100644 --- a/public/listing.php +++ b/public/listing.php @@ -2,42 +2,60 @@ $pageTitle = 'iBuy - Product Listing'; //TODO: have page populate information based on listing in the database $pageContent = '

Product Page

-
+
'. populateContent() .'
'; - product name -
-

Product name

-

Product category

-

Auction created by User.Name

-

Current bid: £123.45

- -
- - -
-
-
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sodales ornare purus, non laoreet dolor sagittis id. Vestibulum lobortis laoreet nibh, eu luctus purus volutpat sit amet. Proin nec iaculis nulla. Vivamus nec tempus quam, sed dapibus massa. Etiam metus nunc, cursus vitae ex nec, scelerisque dapibus eros. Donec ac diam a ipsum accumsan aliquet non quis orci. Etiam in sapien non erat dapibus rhoncus porta at lorem. Suspendisse est urna, egestas ut purus quis, facilisis porta tellus. Pellentesque luctus dolor ut quam luctus, nec porttitor risus dictum. Aliquam sed arcu vehicula, tempor velit consectetur, feugiat mauris. Sed non pellentesque quam. Integer in tempus enim.

+require '../layout.php'; -
-
-

Reviews of User.Name

- + $stmt->execute($values); + $listing = $stmt->fetch(); -
- + $output = ' product name +
+

'. $listing['listing_name'] .'

+

'. $listing['listing_category'] .'

+

Auction created by User.Name

+

Current bid: £123.45

+ + + + + +
+
+

'. $listing['listing_description'] .'

- - -
-
'; -require '../layout.php' + + + +
+

Reviews of User.Name

+ + +
+ + + +
+
'; + + return $output; +} ?> \ No newline at end of file