From 136cdc1a8ae4345e7503da64055373a493814e90 Mon Sep 17 00:00:00 2001 From: cflem Date: Thu, 29 Dec 2016 21:19:57 -0700 Subject: Drafted ads.php --- dash/ads.php | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'dash') diff --git a/dash/ads.php b/dash/ads.php index e77f779..e259bbf 100644 --- a/dash/ads.php +++ b/dash/ads.php @@ -6,12 +6,45 @@ $adid = intval($_GET['id']); if ($adid < 1) fatal('No ad ID has been provided. You must have reached this page in error.'); $title = 'Ad / Bulletin'; require('header.php'); -$result = $db->query('SELECT ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.email, users.zipcode, users.phone, users.picture, users.address FROM ads INNER JOIN users ON users.id = ads.uid WHERE ads.id = '.$adid.' LIMIT 1') or fatal($db->error); +$result = $db->query('SELECT ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.email, users.phone, users.picture, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads INNER JOIN users ON users.id = ads.uid LEFT JOIN ratings ON ratings.rated = ads.uid WHERE ads.id = '.$adid.' LIMIT 1') or fatal($db->error); if ($result->num_rows < 1) fatal('No ad with this ID has been found.'); $row = $result->fetch_assoc(); ?>
- +
+

+

Pays

+

at

+
+
+

+
+
+

Respond to this Ad

+
+'.PHP_EOL; +else + echo ' Profile Picture'.PHP_EOL; +?> +

+Employer Not Rated

'.PHP_EOL; +else + echo '

'.intval($row['rating']).' Star Employer

'.PHP_EOL; +?> +
+
+

+ +

+

Open a Chat

+
+
free(); -- cgit v1.2.3