diff options
| author | cflem <carson.fl3ming@gmail.com> | 2017-01-02 17:49:51 -0700 |
|---|---|---|
| committer | cflem <carson.fl3ming@gmail.com> | 2017-01-02 17:49:51 -0700 |
| commit | 1e969333228597382b1229d4e813629f884c698d (patch) | |
| tree | 6e15218faa2941b0099027c6c06c71e5d897a5ef /dash | |
| parent | 37bb3e71ad66763c9a397e1db052f944a5c9ec70 (diff) | |
| download | bulletin-1e969333228597382b1229d4e813629f884c698d.tar.gz | |
Limited employer dashboard to ads they've posted
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/dash_employer.php | 3 | ||||
| -rw-r--r-- | dash/dash_functions.php | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/dash/dash_employer.php b/dash/dash_employer.php index 78debfd..3c08ffd 100644 --- a/dash/dash_employer.php +++ b/dash/dash_employer.php @@ -4,7 +4,8 @@ $title = 'Dashboard / Bulletin'; 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 GROUP BY ads.id LIMIT ' . $b_config['ads_per_page']*($page-1) . ', '.$b_config['ads_per_page']) or fatal($db->error); +$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->free(); require('footer.php'); diff --git a/dash/dash_functions.php b/dash/dash_functions.php index b9fd9db..2cc7f8d 100644 --- a/dash/dash_functions.php +++ b/dash/dash_functions.php @@ -6,6 +6,16 @@ function dash_fatal ($msg = null, $link = null, $label = null) { require('footer.php'); die; } +function draw_noads () { +?> + <div class="job"> + <a href="#" class="jobxbtn"></a> + <p class="jobtitle"><a href="post.php">Post an Ad!</a></p> + <p class="jobpay">Costs $5.00</p> + <p class="jobblurb">You haven't posted any ads yet! It's a quick and easy way to get connected to the workers you need.<br /><a href="post.php">Post an ad!</a></p> + </div> +<?php +} function draw_ad ($row) { ?> <div class="job"> |
