blob: c5644caa1d27f1c3ce5dd3418bc177d4f33ff301 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
<?php
function dash_fatal ($msg = null, $link = null, $label = null) {
if ($link === null) $link = 'javascript:history.go(-1);';
if ($label == null) $label = '← Got It';
echo tpl(array('message' => $msg, 'link' => $link, 'label' => $label), 'dash_fatal.tpl').PHP_EOL;
require('footer.php');
die;
}
function typestr ($type) {
switch ($type) {
case 'EMPLOYER':
return 'Employer';
case 'EMPLOYEE':
return 'Employee';
default:
return 'Team Member';
}
}
function rating_format ($rating = null, $typestr = 'Employer') {
if (is_null($rating)) return $typestr.' Not Rated';
return number_format($rating, 1).' Star '.$typestr;
}
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">
<a href="#" class="jobxbtn"></a>
<p class="jobtitle"><a href="ads.php?id=<?=$row['id'];?>"><?=htmlentities($row['title']);?></a></p>
<?php
if (is_null($row['cat_name']))
echo ' <p class="jobcat">Uncategorized</p>'.PHP_EOL;
else
echo ' <p class="jobcat">'.htmlentities($row['cat_name']).'</p>'.PHP_EOL;
?>
<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
}
?>
|