diff options
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/css/dash.css | 160 | ||||
| -rw-r--r-- | dash/dash_common.php | 8 | ||||
| -rw-r--r-- | dash/dash_employee.php | 28 | ||||
| -rw-r--r-- | dash/dash_employer.php | 9 | ||||
| -rw-r--r-- | dash/footer.php | 10 | ||||
| -rw-r--r-- | dash/header.php | 51 | ||||
| -rw-r--r-- | dash/headless.php | 29 | ||||
| -rw-r--r-- | dash/img/location.svg | 38 | ||||
| -rw-r--r-- | dash/img/x_hover.png | bin | 0 -> 2882 bytes | |||
| -rw-r--r-- | dash/img/x_hover2.png | bin | 0 -> 2735 bytes | |||
| -rw-r--r-- | dash/img/x_raw.png | bin | 0 -> 2658 bytes | |||
| -rw-r--r-- | dash/index.php | 18 | ||||
| -rw-r--r-- | dash/js/dash.js | 16 | ||||
| -rw-r--r-- | dash/nav.php | 13 |
14 files changed, 380 insertions, 0 deletions
diff --git a/dash/css/dash.css b/dash/css/dash.css new file mode 100644 index 0000000..d46f352 --- /dev/null +++ b/dash/css/dash.css @@ -0,0 +1,160 @@ +@font-face { + font-family: 'Myriad Pro'; + src: url('../../ttf/myriad.ttf'); +} + +body { + margin: 0; + padding: 0; + background-image: linear-gradient(135deg, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0)), + url('../../img/3.jpg'); + background-size: cover; + background-repeat: no-repeat; + background-attachment: fixed; +} +#nav { + height: 60px; + padding-top: 8px; + width: 100%; + position: absolute; + top: 0px; + left: 0px; + box-shadow: 0px 0px 5px rgba(0,0,0,0.75); + background-color: #ffffff; +} +#navlogo { + background-image: url('../../img/5.png'); + background-size: contain; + background-repeat: no-repeat; + margin-left: 8%; + width: 200px; + height: 48px; + float: left; +} +#navlinks { + margin-right: 8%; + float: right; + margin-left: 2em; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-end; +} +#navlinks #sep { + display: inline-block; + width: 0.5px; + height: 52px; + border-radius: 5px; + margin-right: 1em; + background-color: #eeeeee; +} +#navlinks a { + font-family: 'Myriad Pro'; + font-size: 18px; + font-weight: normal; + text-decoration: none; + color: #000000; + padding: 17px 0px; + margin: 0px 0.5em; +} +#navlinks a:hover { + color: #fb4d00; + cursor: pointer; +} +.navblock { + padding: 15px 0px; + position: relative; + z-index: 1; +} +.subnav { + display: none; + background-color: #ffffff; + margin: 0; + padding: 0 0 0 2em; + list-style: none; +} +.navblock:hover .subnav { + display: block; +} +#content { + position: absolute; + top: 68px; + left: 0px; + right: 0px; + width: 100%; + margin: auto; + height: calc(100% - 88px); + border-radius: 2px; + font-family: 'Myriad Pro'; + overflow-x: hidden; + overflow-y: auto; +} +#footer { + position: absolute; + bottom: 0px; + left: 0px; + width: 100%; + height: 20px; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-around; + font-family: 'Myriad Pro'; +} +#footer p { + text-align: center; + font-size: 10pt; + margin: 0.33em 0; +} +.job p, .job h1 { + margin: 0; + text-align: center; +} +.job { + margin: 2em auto 1em auto; + width: 512px; + padding: 1em; + background-color: #ffffff; + box-shadow: 0px 0px 5px rgba(0,0,0,0.75); + border-radius: 3px; +} +.jobtitle a { + color: #000000; + text-decoration: none; + font-weight: bold; +} +.jobblurb { + padding: 1em; + margin: 1em 1em 0 1em !important; + background-color: #eeeeee; + border-radius: 3px; +} +.jobblurb a { + color: #000000; + text-decoration: none; + font-weight: bold; +} +.joblocation::before { + content: ''; + display: inline-block; + width: 12px; + height: 12px; + background-image: url('../img/location.svg'); + background-size: contain; + background-position: center center; + background-repeat: no-repeat; + margin-right: 3px; +} +.jobxbtn { + display: block; + width: 16px; + height: 16px; + float: right; + background-image: url('../img/x_hover2.png'); + background-size: contain; + background-repeat: no-repeat; +} +.jobxbtn:hover { + background-image: url('../img/x_hover.png'); + cursor: pointer; +} diff --git a/dash/dash_common.php b/dash/dash_common.php new file mode 100644 index 0000000..b87cd6d --- /dev/null +++ b/dash/dash_common.php @@ -0,0 +1,8 @@ +<?php +require('../inc/common.php'); + +define('ACC_TYPE', $b_user['type']); +require('nav.php'); + +if ($b_user['id'] < 1) l_redirect('login.php'); +?> diff --git a/dash/dash_employee.php b/dash/dash_employee.php new file mode 100644 index 0000000..476ff1f --- /dev/null +++ b/dash/dash_employee.php @@ -0,0 +1,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'); +?> diff --git a/dash/dash_employer.php b/dash/dash_employer.php new file mode 100644 index 0000000..28c5ed1 --- /dev/null +++ b/dash/dash_employer.php @@ -0,0 +1,9 @@ +<?php +if (!defined('HEIRARCHY')) die; +$title = 'Dashboard / Bulletin'; +require('header.php'); +?> + <p></p> +<?php +require('footer.php'); +?> diff --git a/dash/footer.php b/dash/footer.php new file mode 100644 index 0000000..963d525 --- /dev/null +++ b/dash/footer.php @@ -0,0 +1,10 @@ +<?php +if (!defined('HEIRARCHY')) die; +$db->close(); +?> + </div> + <div id="footer"> + <p id="copy">Copyright © 2016 Bulletin Team</p> + </div> + </body> +</html> diff --git a/dash/header.php b/dash/header.php new file mode 100644 index 0000000..d854074 --- /dev/null +++ b/dash/header.php @@ -0,0 +1,51 @@ +<?php +if (!defined('HEIRARCHY')) die; +$db = new bdb(); +?> +<!DOCTYPE html> +<html> + <head> + <title><?=htmlentities($title); ?></title> + <meta charset="UTF-8" /> + <meta name="description" content="Community, at your fingertips." /> + <link rel="stylesheet" type="text/css" href="css/dash.css" /> + <link rel="stylesheet" type="text/css" href="../css/chat.css" /> + <script type="text/javascript" src="../js/jquery.min.js"></script> + <script type="text/javascript" src="../js/jquery-ui.min.js"></script> + <script type="text/javascript" src="js/dash.js"></script> + <script type="text/javascript" src="../js/auth.php"></script> + <script type="text/javascript" src="../js/chat.js"></script> + </head> + <body> + <div id="nav"> + <a id="navhome" href="<?=$b_config['base_url'];?>"> + <div id="navlogo"></div> + </a> + <div id="navlinks"> + <div id="sep"></div> +<?php +foreach ($navtitles as $k => $title) { + $link = $navlinks[$k]; +?> + <a href="<?=htmlentities($b_config['base_url'].$link);?>"> + <span class="navspan"><?=htmlentities($title);?></span> + </a> +<?php +} +?> + <div class="navblock"> + <a href="<?=$b_config['base_url'].'dash/profile.php';?>"> + <span class="navspan"><?=htmlentities($b_user['name']);?> ▾</span> + <ul class="subnav"> + <a href="<?=$b_config['base_url'].'dash/settings.php';?>"> + <li><span class="navspan">Settings</span></li> + </a> + <a href="<?=$b_config['base_url'].'logout.php';?>"> + <li><span class="navspan">Log Out</span></li> + </a> + </ul> + </a> + </div> + </div> + </div> + <div id="content"> diff --git a/dash/headless.php b/dash/headless.php new file mode 100644 index 0000000..16693cd --- /dev/null +++ b/dash/headless.php @@ -0,0 +1,29 @@ +<?php +$clicks = 0; +if (!empty($_GET['clicks'])) $clicks = max(0, intval($_GET['clicks'])); +require('dash_common.php'); +$db = new bdb(); +$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 '.($clicks+10).', 1') or die(); +if ($result->num_rows) { + $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(); +$db->close(); +?> diff --git a/dash/img/location.svg b/dash/img/location.svg new file mode 100644 index 0000000..76c8f49 --- /dev/null +++ b/dash/img/location.svg @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 52 52" style="enable-background:new 0 0 52 52;" xml:space="preserve">
+<path style="fill:#1081E0;" d="M38.853,5.324L38.853,5.324c-7.098-7.098-18.607-7.098-25.706,0h0
+ C6.751,11.72,6.031,23.763,11.459,31L26,52l14.541-21C45.969,23.763,45.249,11.72,38.853,5.324z M26.177,24c-3.314,0-6-2.686-6-6
+ s2.686-6,6-6s6,2.686,6,6S29.491,24,26.177,24z"/>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+</svg>
diff --git a/dash/img/x_hover.png b/dash/img/x_hover.png Binary files differnew file mode 100644 index 0000000..6ad1fde --- /dev/null +++ b/dash/img/x_hover.png diff --git a/dash/img/x_hover2.png b/dash/img/x_hover2.png Binary files differnew file mode 100644 index 0000000..79a9121 --- /dev/null +++ b/dash/img/x_hover2.png diff --git a/dash/img/x_raw.png b/dash/img/x_raw.png Binary files differnew file mode 100644 index 0000000..e0dfed7 --- /dev/null +++ b/dash/img/x_raw.png diff --git a/dash/index.php b/dash/index.php new file mode 100644 index 0000000..77e58dc --- /dev/null +++ b/dash/index.php @@ -0,0 +1,18 @@ +<?php +define('HEIRARCHY', 1); + +require('dash_common.php'); +switch ($b_user['type']) { + case 'EMPLOYEE': + require('dash_employee.php'); + break; + case 'EMPLOYER': + require('dash_employer.php'); + break; + case 'ADMIN': + require('dash_admin.php'); + break; + default: + fatal('Your account is misconfigured.', $b_config['base_url'].'logout.php', '← Log Out'); +} +?> diff --git a/dash/js/dash.js b/dash/js/dash.js new file mode 100644 index 0000000..39e9882 --- /dev/null +++ b/dash/js/dash.js @@ -0,0 +1,16 @@ +var xclicks = 0, a; +function xbtn (e) { + e.preventDefault(); + $(this).parents().filter('.job').hide(250); + $.get('headless.php?clicks='+xclicks, function (data) { + var $newjob = $($.parseHTML(data)); + window.a = $newjob; + $newjob.find('.jobxbtn').click(xbtn); + $newjob.appendTo($('#content')); + }); + xclicks++; +} + +$(function() { + $('.jobxbtn').click(xbtn); +}); diff --git a/dash/nav.php b/dash/nav.php new file mode 100644 index 0000000..9baf7ad --- /dev/null +++ b/dash/nav.php @@ -0,0 +1,13 @@ +<?php +if (!defined('ACC_TYPE')) die; +if (ACC_TYPE == 'EMPLOYEE') { + $navtitles = array('Dashboard', 'Help'); + $navlinks = array('dash/', 'dash/help.php'); +} else if (ACC_TYPE == 'EMPLOYER') { + $navtitles = array('Dashboard', 'Post an Ad', 'Help'); + $navlinks = array('dash/', 'dash/post.php', 'dash/help.php'); +} else if (ACC_TYPE == 'ADMIN') { + $navtitles = array(); + $navlinks = array(); +} else die; +?> |
