From f75fc7b47735ed73535478e4d70e62694247a586 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Tue, 7 Mar 2017 21:10:01 -0500 Subject: Started work on employer dashboard --- dash/ads.php | 6 ++++++ dash/css/dash.css | 4 ++-- dash/css/employer.css | 17 +++++++++++++++++ dash/dash_employer.php | 34 +++++++++++++++++++++++++++++----- dash/dash_functions.php | 31 +++++++++++++++++++++++-------- dash/js/dash.js | 11 ++++++++--- 6 files changed, 85 insertions(+), 18 deletions(-) create mode 100644 dash/css/employer.css diff --git a/dash/ads.php b/dash/ads.php index 96f05cb..7187f86 100644 --- a/dash/ads.php +++ b/dash/ads.php @@ -33,8 +33,14 @@ else

No bio included in profile.' : htmlentities($row['bio']));?>

+

Respond to this Ad

Apply Now

+

Contact the Employer

'; require('header.php'); -$page = 1; -if (!empty($_GET['p'])) $page = max(1, intval($_GET['p'])); -$result = $db->query('SELECT ads.*, categories.cat_name, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads LEFT JOIN categories ON ads.cat = categories.id LEFT JOIN ratings ON ads.uid = ratings.rated WHERE ads.uid = '.$b_user['id'].' GROUP BY ads.id LIMIT ' . $b_config['ads_per_page']*($page-1) . ', '.$b_config['ads_per_page']) or fatal($db->error); -if ($result->num_rows < 1) draw_noads(); -while ($row = $result->fetch_assoc()) draw_ad($row); +$result = $db->query('SELECT ads.id, ads.title FROM ads WHERE ads.uid = '.$b_user['id'].' AND ads.closed = 0') or dash_fatal('A problem was encountered loading your posted ads.'); +$view = intval(@$_GET['view']); +?> +
+

Show Me:

+
+query('SELECT ads.*, categories.cat_name, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads LEFT JOIN categories ON ads.cat = categories.id LEFT JOIN ratings ON ads.uid = ratings.rated WHERE ads.uid = '.$b_user['id'].' AND ads.closed = 0 GROUP BY ads.id LIMIT 0, '.$b_config['ads_per_page']) or fatal($db->error); + if ($result->num_rows < 1) draw_noads(); + while ($row = $result->fetch_assoc()) draw_ad($row); + $result->free(); +} else { + $result = $db->query('SELECT responses.id, responses.comment, users.name, users.address, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM responses INNER JOIN users ON responses.uid = users.id LEFT JOIN ratings ON ratings.rated = responses.uid WHERE responses.adid = '.$view) or dash_fatal($db->error); + if ($result->num_rows < 1) draw_noapps(); + while ($row = $result->fetch_assoc()) draw_app($row); + $result->free(); +} require('footer.php'); ?> diff --git a/dash/dash_functions.php b/dash/dash_functions.php index 9160426..cb22cd5 100644 --- a/dash/dash_functions.php +++ b/dash/dash_functions.php @@ -23,13 +23,21 @@ function rating_format ($rating = null, $typestr = 'Employer') { function draw_noads () { ?>
-

Post an Ad!

-

Costs $5.00

+

It's FREE!

You haven't posted any ads yet! It's a quick and easy way to get connected to the workers you need.
Post an ad!

+
+

No Applications Yet!

+

Post another ad. It's FREE!

+

This ad hasn't received any responses yet. In the meantime, be sure to post more to maximize your exposure.
Post an ad!

+
+
@@ -42,18 +50,25 @@ function draw_ad ($row) { echo '

'.htmlentities($row['cat_name']).'

'.PHP_EOL; ?>

-Employer Not Rated

'.PHP_EOL; - else - echo '

'.$row['rating'].' Star Employer

'.PHP_EOL; -?> +

Pays $

[...]

+
+ +

+

+

+

[...]

+

+
+