From a17c35d61bcca213a810ba4abea896075647df66 Mon Sep 17 00:00:00 2001 From: cflem Date: Sat, 21 Jan 2017 16:46:59 -0500 Subject: Created ad responses --- dash/apply.php | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 dash/apply.php (limited to 'dash/apply.php') diff --git a/dash/apply.php b/dash/apply.php new file mode 100644 index 0000000..be353ad --- /dev/null +++ b/dash/apply.php @@ -0,0 +1,60 @@ +query('SELECT id FROM responses WHERE adid = '.$adid.' AND uid = '.$b_user['id'].' LIMIT 1') or dash_fatal($db->error); + if ($result->num_rows > 0) { + $result->free(); + dash_fatal('You have already applied to this ad!', $b_config['base_url'].'dash/'); + } + $db->query('INSERT INTO responses (adid, uid, comment) VALUES ('.$adid.', '.$b_user['id'].', \''.$db->escape_string($_POST['comments']).'\')') or dash_fatal($db->error); + 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); +if ($result->num_rows < 1) dash_fatal('No ad with this ID has been found.'); +$row = $result->fetch_assoc(); +?> +
+
+

+

Pays $

+

at

+
+
+

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

+Employer Not Rated

'.PHP_EOL; +else + echo '

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

'.PHP_EOL; +?> +
+
+
+

Comments (Optional)

+

+

+
+
+
+
+free(); +require('footer.php'); +?> -- cgit v1.2.3