diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-02-16 23:59:34 -0500 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-02-16 23:59:34 -0500 |
| commit | 4f12fecebcd3f2a5bc6a0e7cdf9c420af4ed435a (patch) | |
| tree | edd91e33b95d48022bca9ce8c0626a7a7879af93 /dash/dash_functions.php | |
| parent | 5564b3a9cb432f1f7eb76bd325251312904bb893 (diff) | |
| download | bulletin-4f12fecebcd3f2a5bc6a0e7cdf9c420af4ed435a.tar.gz | |
Did the profile
Diffstat (limited to 'dash/dash_functions.php')
| -rw-r--r-- | dash/dash_functions.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/dash/dash_functions.php b/dash/dash_functions.php index 2cc7f8d..c5644ca 100644 --- a/dash/dash_functions.php +++ b/dash/dash_functions.php @@ -6,6 +6,20 @@ function dash_fatal ($msg = null, $link = null, $label = null) { 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"> @@ -32,7 +46,7 @@ function draw_ad ($row) { if (is_null($row['rating'])) echo ' <p class="jobstars">Employer Not Rated</p>'.PHP_EOL; else - echo ' <p class="jobstars">'.intval($row['rating']).' Star Employer</p>'.PHP_EOL; + 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> |
