summaryrefslogtreecommitdiff
path: root/dash
diff options
context:
space:
mode:
Diffstat (limited to 'dash')
-rw-r--r--dash/ads.php6
-rw-r--r--dash/apply.php60
-rw-r--r--dash/css/dash.css24
-rw-r--r--dash/dash_employee.php2
-rw-r--r--dash/settings.php2
5 files changed, 86 insertions, 8 deletions
diff --git a/dash/ads.php b/dash/ads.php
index 24693e9..fa7f715 100644
--- a/dash/ads.php
+++ b/dash/ads.php
@@ -6,8 +6,8 @@ $adid = intval($_GET['id']);
if ($adid < 1) fatal('No ad ID has been provided. You must have reached this page in error.');
$title = 'Ad / Bulletin';
require('header.php');
-$result = $db->query('SELECT ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.email, users.phone, users.picture, users.bio, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads INNER JOIN users ON users.id = ads.uid LEFT JOIN ratings ON ratings.rated = ads.uid WHERE ads.id = '.$adid.' LIMIT 1') or fatal($db->error);
-if ($result->num_rows < 1) fatal('No ad with this ID has been found.');
+$result = $db->query('SELECT ads.id, ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, users.email, users.phone, users.picture, users.bio, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads INNER JOIN users ON users.id = ads.uid LEFT JOIN ratings ON ratings.rated = ads.uid WHERE ads.id = '.$adid.' LIMIT 1') or dash_fatal($db->error);
+if ($result->num_rows < 1) dash_fatal('No ad with this ID has been found.');
$row = $result->fetch_assoc();
?>
<div id="fulljob">
@@ -38,6 +38,8 @@ else
<div id="fjfright">
<p id="ebio"><?=(is_null($row['bio']) ? '<em>No bio included in profile.</em>' : htmlentities($row['bio']));?></p>
<h4>Respond to this Ad</h4>
+ <p id="eapply"><a href="apply.php?id=<?=intval($row['id']);?>">Apply Now</a></p>
+ <h4>Contact the Employer</h4>
<p id="eemail"><a href="mailto:<?=htmlentities($row['email']);?>"><?=htmlentities($row['email']);?></a></p>
<?php
$phonelink = '+'.preg_replace('/[^0-9]/', '', $row['phone']);
diff --git a/dash/apply.php b/dash/apply.php
new file mode 100644
index 0000000..be353ad
--- /dev/null
+++ b/dash/apply.php
@@ -0,0 +1,60 @@
+<?php
+define('HEIRARCHY', 1);
+
+require('dash_common.php');
+$adid = intval($_GET['id']);
+if ($adid < 1) fatal('No ad ID has been provided. You must have reached this page in error.');
+$title = 'Apply / Bulletin';
+require('header.php');
+if (!empty($_POST['apply'])) {
+ $result = $db->query('SELECT id FROM responses WHERE adid = '.$adid.' AND uid = '.$b_user['id'].' LIMIT 1') or dash_fatal($db->error);
+ if ($result->num_rows > 0) {
+ $result->free();
+ dash_fatal('You have already applied to this ad!', $b_config['base_url'].'dash/');
+ }
+ $db->query('INSERT INTO responses (adid, uid, comment) VALUES ('.$adid.', '.$b_user['id'].', \''.$db->escape_string($_POST['comments']).'\')') or dash_fatal($db->error);
+ dash_fatal('Your application has been submitted.', $b_config['base_url'].'dash/');
+}
+
+$result = $db->query('SELECT ads.id, ads.title, ads.pay, ads.time, ads.location, ads.description, users.name, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM ads INNER JOIN users ON users.id = ads.uid LEFT JOIN ratings ON ratings.rated = ads.uid WHERE ads.id = '.$adid.' LIMIT 1') or dash_fatal($db->error);
+if ($result->num_rows < 1) dash_fatal('No ad with this ID has been found.');
+$row = $result->fetch_assoc();
+?>
+ <div id="fulljob" class="fjsettings">
+ <div id="fjheader">
+ <h3 id="fjhtitle"><?=htmlentities($row['title']);?></h3>
+ <p id="fjhpay">Pays $<?=number_format($row['pay'], 2);?></p>
+ <p id="fjhdetails"><?=htmlentities($row['location']);?> at <?=date('g:i a', intval($row['time'])).' on '.date('M j, Y', intval($row['time']));?></p>
+ </div>
+ <div id="fjbody">
+ <p><?=htmlentities($row['description']);?></p>
+ </div>
+ <div id="fjfooter">
+ <div id="fjfleft">
+<?php
+if (is_null($row['picture']))
+ echo ' <img id="propic" src="uimg/default.png" alt="Profile Picture" />'.PHP_EOL;
+else
+ echo ' <img id="propic" src="uimg/'.intval($row['picture']).'.png" alt="Profile Picture" />'.PHP_EOL;
+?>
+ <p id="ename"><?=htmlentities($row['name']);?></p>
+<?php
+if (is_null($row['rating']))
+ echo ' <p id="erating">Employer Not Rated</p>'.PHP_EOL;
+else
+ echo ' <p id="erating">'.intval($row['rating']).' Star Employer</p>'.PHP_EOL;
+?>
+ </div>
+ <div id="fjfright">
+ <form id="cform" action="<?=htmlentities($_SERVER['REQUEST_URI']);?>" method="post">
+ <h4>Comments (Optional)</h4>
+ <p><textarea name="comments"></textarea></p>
+ <p><input id="inpapply" type="submit" name="apply" value="Apply to Ad" /></p>
+ </form>
+ </div>
+ </div>
+ </div>
+<?php
+$result->free();
+require('footer.php');
+?>
diff --git a/dash/css/dash.css b/dash/css/dash.css
index f86cef2..dd278a9 100644
--- a/dash/css/dash.css
+++ b/dash/css/dash.css
@@ -6,10 +6,10 @@
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)),
+ background-image: linear-gradient(to bottom right, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0)),
url('../img/0.jpg');
background-size: cover;
- background-repeat: no-repeat;
+ background-repeat: repeat-y;
background-attachment: fixed;
}
#nav {
@@ -189,7 +189,10 @@ body {
#fjfooter {
margin-top: 1em;
}
-#fjfooter p, #fjfooter h4 {
+#fjfooter h4 {
+ margin: 1em 0 0 0;
+}
+#fjfooter p {
margin: 0;
}
#fjfleft {
@@ -212,12 +215,13 @@ body {
#fulljob a, .errbox a {
text-decoration: none;
color: #fb4d00;
+ cursor: pointer;
}
#fulljob a:hover, .errbox a:hover {
color: #fb7700;
}
#fulljob #ebio {
- margin: 1em auto;
+ margin: 1em auto 0em;
padding-top: 1em;
}
#fulljob.fjsettings {
@@ -271,6 +275,18 @@ body {
.fjsettings input[type=submit]:hover {
background-color: #fb7700;
}
+.fjsettings textarea {
+ margin: 0.5em auto;
+ width: 500px;
+ height: 150px;
+ resize: none;
+ border: 1px solid #dddddd;
+ border-radius: 5px;
+ padding: 5px;
+}
+#cform input[type=submit] {
+ margin: 0 auto;
+}
.errbox {
width: 512px;
margin: 2em auto;
diff --git a/dash/dash_employee.php b/dash/dash_employee.php
index d4a3df1..795d400 100644
--- a/dash/dash_employee.php
+++ b/dash/dash_employee.php
@@ -4,7 +4,7 @@ $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.closed = 0 GROUP BY ads.id LIMIT ' . $b_config['ads_per_page']*($page-1) . ', '.$b_config['ads_per_page']) or fatal($db->error);
while ($row = $result->fetch_assoc()) draw_ad($row);
$result->free();
require('footer.php');
diff --git a/dash/settings.php b/dash/settings.php
index 9a7179a..c17a6dd 100644
--- a/dash/settings.php
+++ b/dash/settings.php
@@ -28,7 +28,7 @@ if (!empty($_POST['oldpass'])) {
<h3 id="fjhtitle">Account Settings</h3>
<p id="fjhdesc">Adjusting for <?=htmlentities($b_user['email']);?></p>
</div>
- <form action="/dash/settings.php" method="post">
+ <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post">
<div id="fjbody">
<h4>Current Password</h4>
<p>Your current password is needed to change your account settings.</p>