diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-03-09 00:28:02 -0500 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-03-09 00:28:02 -0500 |
| commit | a44a0e047a7582fe7e31743e1b03a17cf2987f73 (patch) | |
| tree | 1bb28593eb493cac175f2ed42ab108a4248e1ec1 /dash/apply.php | |
| parent | f75fc7b47735ed73535478e4d70e62694247a586 (diff) | |
| download | bulletin-a44a0e047a7582fe7e31743e1b03a17cf2987f73.tar.gz | |
Created the ability to post ads, rating framework
Diffstat (limited to 'dash/apply.php')
| -rw-r--r-- | dash/apply.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dash/apply.php b/dash/apply.php index d60700e..82eb5f4 100644 --- a/dash/apply.php +++ b/dash/apply.php @@ -2,6 +2,8 @@ define('HEIRARCHY', 1); require('dash_common.php'); +if ($b_user['type'] != 'EMPLOYEE') fatal('Only job seeker accounts are allowed to apply to ads. Sorry for the inconvenience.'); + $adid = intval($_GET['id']); if ($adid < 1) fatal('No ad ID has been provided. You must have reached this page in error.'); $title = 'Apply / Bulletin'; @@ -18,7 +20,7 @@ if (!empty($_POST['apply'])) { dash_fatal('Your application has been submitted.', $b_config['base_url'].'dash/'); } -$result = $db->query('SELECT ads.id, ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, 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 dash_fatal($db->error); +$result = $db->query('SELECT ads.id, ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, 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.' GROUP BY ads.id LIMIT 1') or dash_fatal($db->error); if ($result->num_rows < 1) dash_fatal('No ad with this ID has been found.'); $row = $result->fetch_assoc(); $result->free(); |
