summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dash/dash_employer.php3
-rw-r--r--dash/dash_functions.php10
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">