blob: 476ff1fdacb5d8f426e550abb6b67696834497f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?php
if (!defined('HEIRARCHY')) die;
$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 ' . 10*($page-1) . ', 10') or fatal($db->error);
while ($row = $result->fetch_assoc()) {
?>
<div class="job">
<a href="#" class="jobxbtn"></a>
<p class="jobtitle"><a href="ads.php?id=<?=$row['id'];?>"><?=htmlentities($row['title']);?></a></p>
<p class="joblocation"><?=htmlentities($row['location']);?></p>
<?php
if (is_null($row['rating']))
echo ' <p class="jobstars">Employer Not Rated</p>'.PHP_EOL;
else
echo ' <p class="jobstars">'.$row['rating'].' Star Employer</p>'.PHP_EOL;
?>
<p class="jobpay">Pays $<?=number_format($row['pay'], 2);?></p>
<p class="jobblurb"><?=htmlentities(substr($row['description'], 0, min(strlen($row['description']), 160)));?> <a href="ads.php?id=<?=$row['id'];?>">[...]</a></p>
</p>
</div>
<?php
}
$result->free();
require('footer.php');
?>
|