summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2017-04-12 17:03:36 -0400
committerCarson Fleming <cflems@cflems.net>2017-04-12 17:03:36 -0400
commite079a930d2797d9e94cc2e1848e4634c43adb6ba (patch)
treea49ebbe0a3e6937ca894f3dc1dd9b1f9a4cbc9dd
parent1e35e053f12f4c4d26ec435f2b314e45cd3f05ea (diff)
downloadbulletin-e079a930d2797d9e94cc2e1848e4634c43adb6ba.tar.gz
Finished up Reed\'s suggestions
-rw-r--r--dash/ads.php40
-rw-r--r--dash/apply.php6
-rw-r--r--dash/css/dash.css53
-rw-r--r--dash/css/post.css2
-rw-r--r--dash/css/profile.css37
-rw-r--r--dash/dash_functions.php2
-rw-r--r--dash/img/0.jpgbin1541956 -> 836481 bytes
-rw-r--r--dash/profile.php24
8 files changed, 133 insertions, 31 deletions
diff --git a/dash/ads.php b/dash/ads.php
index 6878456..7c365ff 100644
--- a/dash/ads.php
+++ b/dash/ads.php
@@ -6,7 +6,7 @@ $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.id, ads.uid, 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.' GROUP BY ads.id LIMIT 1') or dash_fatal($db->error);
+$result = $db->query('SELECT ads.id, ads.uid, ads.title, ads.pay, ads.time, ads.location, ads.description, ads.closed, categories.cat_name, 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 LEFT JOIN categories ON categories.id = ads.cat WHERE ads.id = '.$adid.' GROUP BY ads.id 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();
$result->free();
@@ -17,12 +17,7 @@ if ($b_user['type'] == 'EMPLOYER' && $b_user['id'] == $row['uid']) echo '
?>
<div id="fjheader">
<h3 id="fjhtitle"><a href="ads.php?id=<?=$row['id'];?>"><?=htmlentities($row['title']);?></a></h3>
- <p id="fjhpay">Pays $<?=number_format($row['pay'], 2);?></p>
- <p id="fjhdetails"><?=htmlentities($row['location']);?></p>
- <p id="fjhtime"><?=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>
+ <p id="fjhcat"><?=is_null($row['cat_name']) ? 'Uncategorized' : htmlentities($row['cat_name']);?></p>
</div>
<div id="fjfooter">
<div id="fjfleft">
@@ -34,18 +29,7 @@ else
?>
<p id="ename"><a href="profile.php?id=<?=$row['uid'];?>"><?=htmlentities($row['name']);?></a></p>
<p id="erating"><?=rating_format($row['rating']);?></p>
- </div>
- <div id="fjfright">
- <p id="ebio"><?=(is_null($row['bio']) ? '<em>No bio included in profile.</em>' : htmlentities($row['bio']));?></p>
-<?php
-if ($b_user['type'] == 'EMPLOYEE') {
-?>
- <h4>Respond to this Ad</h4>
- <p id="eapply"><a href="apply.php?id=<?=intval($row['id']);?>">Apply Now</a></p>
-<?php
-}
-?>
- <h4>Contact the Employer</h4>
+ <h4>Contact Information</h4>
<p id="eemail"><a href="mailto:<?=htmlentities($row['email']);?>"><?=htmlentities($row['email']);?></a></p>
<?php
$phonelink = '+'.preg_replace('/[^0-9]/', '', $row['phone']);
@@ -53,7 +37,25 @@ $phonelink = '+'.preg_replace('/[^0-9]/', '', $row['phone']);
<p id="ephone"><a href="tel:<?=$phonelink;?>"><?=htmlentities($row['phone']);?></a></p>
<p id="echat"><a href="#" onclick="bullechat.gui.create('<?=htmlentities($row['email'], ENT_HTML401 | ENT_QUOTES);?>'); return false;">Open a Chat</a></p>
</div>
+ <div id="fjfright">
+ <h4>Job Details</h4>
+ <p id="fjhpay">Pays $<?=number_format($row['pay'], 2);?></p>
+ <p id="fjhdetails"><?=htmlentities($row['location']);?></p>
+ <p id="fjhtime"><?=date('g:i a', intval($row['time'])).' on '.date('M j, Y', intval($row['time']));?></p>
+ </div>
+ </div>
+ <div id="fjdesc">
+ <h4>Job Description</h4>
+ <p><?=htmlentities($row['description']);?></p>
</div>
+<?php
+if ($b_user['type'] == 'EMPLOYEE' && !$row['closed']) {
+?>
+ <p id="eapply"><a href="apply.php?id=<?=intval($row['id']);?>">Apply Now</a></p>
+<?php
+}
+?>
+
</div>
<?php
require('footer.php');
diff --git a/dash/apply.php b/dash/apply.php
index 82eb5f4..3236d49 100644
--- a/dash/apply.php
+++ b/dash/apply.php
@@ -9,10 +9,10 @@ if ($adid < 1) fatal('No ad ID has been provided. You must have reached this pag
$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);
+ $result = $db->query('SELECT id FROM responses WHERE adid = '.$adid.' AND (uid = '.$b_user['id'].' OR matched = 1) 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/');
+ dash_fatal('You have already applied to this ad or the provider has already selected someone for the task!', $b_config['base_url'].'dash/');
}
$result->free();
$db->query('INSERT INTO responses (adid, uid, comment) VALUES ('.$adid.', '.$b_user['id'].', \''.$db->escape_string($_POST['comments']).'\')') or dash_fatal($db->error);
@@ -48,7 +48,7 @@ else
<div id="fjfright">
<form id="cform" action="<?=htmlentities($_SERVER['REQUEST_URI']);?>" method="post">
<h4>Comments (Optional)</h4>
- <p><textarea name="comments"></textarea></p>
+ <p><textarea name="comments" placeholder="This could relate to your specific qualifications, convenience, etc."></textarea></p>
<p><input id="inpapply" type="submit" name="apply" value="Apply to Ad" /></p>
</form>
</div>
diff --git a/dash/css/dash.css b/dash/css/dash.css
index 5af19f1..9d854d1 100644
--- a/dash/css/dash.css
+++ b/dash/css/dash.css
@@ -105,6 +105,7 @@ body {
text-align: center;
font-size: 10pt;
margin: 0.33em 0;
+ color: #eeeeee;
}
.job p, .job h1 {
margin: 0;
@@ -183,11 +184,16 @@ body {
}
#fjheader {
text-align: center;
+ padding-bottom: 1em;
+ border-bottom: 1px solid #eeeeee;
margin-bottom: 1em;
}
#fjheader p, #fjheader h3 {
margin: 0;
}
+#fjhtitle {
+ font-size: 18pt;
+}
h3 a, h4 a {
color: #000000 !important;
text-decoration: none;
@@ -197,7 +203,6 @@ h3 a:hover, h4 a:hover {
text-decoration: none;
}
#fjbody {
- border-top: 1px solid #eeeeee;
border-bottom: 1px solid #eeeeee;
text-align: center;
}
@@ -207,12 +212,15 @@ h3 a:hover, h4 a:hover {
#fjfooter h4 {
margin: 1em 0 0 0;
}
+#fjfleft h4 {
+ text-align: center;
+}
#fjfooter p {
margin: 0;
}
#fjfleft {
float: left;
- margin-right: 0.5em;
+ margin-right: 3em;
}
#fjfleft img {
margin-bottom: 0.5em;
@@ -221,15 +229,20 @@ h3 a:hover, h4 a:hover {
}
#fjfleft p {
margin: 0;
- font-size: 14pt;
text-align: center;
}
+#fjfleft #ename {
+ font-size: 14pt;
+}
#ename a, #ename a:hover {
color: #000000 !important;
font-weight: bold;
}
#fjfright {
- text-align: center;
+ text-align: left;
+}
+#fjfright h4 {
+ font-size: 14pt;
}
#fulljob a, .errbox a {
text-decoration: none;
@@ -249,7 +262,7 @@ h3 a:hover, h4 a:hover {
border-radius: 5px;
}
.fjsettings #fjbody {
- padding: 1em 0 0.75em 0;
+ padding: 0 0 0.75em 0;
}
.fjsettings #fjbody h4 {
margin: 0 auto 0.25em auto;
@@ -292,7 +305,7 @@ h3 a:hover, h4 a:hover {
cursor: pointer;
}
.fjsettings input[type=submit]:hover {
- background-color: #fb7700;
+ box-shadow: 0px 0px 5px rgba(0,0,0,0.75);
}
.fjsettings textarea {
margin: 0.5em auto;
@@ -372,6 +385,9 @@ h3 a:hover, h4 a:hover {
color: #000000;
margin-left: 10px;
}
+#viewform p {
+ color: #eeeeee;
+}
.adtrash {
display: block;
width: 32px;
@@ -407,3 +423,28 @@ h3 a:hover, h4 a:hover {
background-image: url('../img/star_given.png');
background-size: contain;
}
+#eapply {
+ margin: 1.5em 0 0 0;
+}
+#eapply a {
+ background-color: #fb4d00;
+ color: #ffffff;
+ padding: 10px 10px 8px;
+ border-style: none;
+ border-radius: 10px;
+ cursor: pointer;
+ font-size: 12pt;
+}
+#eapply a:hover {
+ color: #ffffff;
+ box-shadow: 0px 0px 5px rgba(0,0,0,0.75);
+}
+#fjdesc {
+ border-top: 1px solid #eeeeee;
+ border-bottom: 1px solid #eeeeee;
+ margin: 1em 0;
+ padding: 1em 0;
+}
+#fjdesc p, #fjdesc h4 {
+ margin: 0;
+}
diff --git a/dash/css/post.css b/dash/css/post.css
index 378c439..fb2a2ce 100644
--- a/dash/css/post.css
+++ b/dash/css/post.css
@@ -25,7 +25,7 @@
cursor: pointer;
}
#postform input[type=submit]:hover, #postform input[type=button]:hover, #postform button:hover {
- background-color: #fb7700;
+ box-shadow: 0px 0px 5px rgba(0,0,0,0.75);
}
#postform textarea {
margin: 0.25em auto;
diff --git a/dash/css/profile.css b/dash/css/profile.css
index 1e55991..36abcbd 100644
--- a/dash/css/profile.css
+++ b/dash/css/profile.css
@@ -33,7 +33,7 @@
cursor: pointer;
}
#profile input[type=submit]:hover, #profile input[type=button]:hover, #profile button:hover {
- background-color: #fb7700;
+ box-shadow: 0px 0px 5px rgba(0,0,0,0.75);
}
#profile textarea {
margin: 0.25em auto;
@@ -94,3 +94,38 @@
#profile a:hover {
color: #fb7700;
}
+#proreviews {
+ text-align: center;
+ border-top: 1px solid #eeeeee;
+ padding-top: 1em;
+}
+.review {
+ text-align: left;
+ margin: 1em;
+}
+#profile .revname a, #profile .revname a:hover {
+ color: #000000;
+ font-weight: bold;
+}
+.revpic img {
+ width: 64px;
+ height: 64px;
+}
+#profile .revjob a, #profile .revjob a:hover {
+ color: #000000;
+ font-style: italic;
+}
+.reviewleft {
+ float: left;
+ clear: both;
+ width: 156px;
+ word-break: break-word;
+ overflow-x: hidden;
+ margin-right: 1em;
+}
+.reviewright {
+ min-height: 108px;
+}
+#proreviews .revstars {
+ margin-bottom: 0.5em;
+}
diff --git a/dash/dash_functions.php b/dash/dash_functions.php
index 7fa9c3e..5497ce9 100644
--- a/dash/dash_functions.php
+++ b/dash/dash_functions.php
@@ -67,7 +67,7 @@ function draw_rate ($row, $review) {
?>
<div class="jobblurb">
<?=rating_format($review['stars'], typestr($row['type']));?>
- <div class="ratecomment"><?=is_null($review['comment'])?'<em>No comment.</em>':htmlentities($review['comment']);?></div>
+ <div class="ratecomment"><strong>You said:</strong><br /><?=is_null($review['comment'])?'<em>No comment.</em>':htmlentities($review['comment']);?></div>
</div>
<?php
} else {
diff --git a/dash/img/0.jpg b/dash/img/0.jpg
index 2d3c917..55dd98d 100644
--- a/dash/img/0.jpg
+++ b/dash/img/0.jpg
Binary files differ
diff --git a/dash/profile.php b/dash/profile.php
index 8a448b5..3c63ad4 100644
--- a/dash/profile.php
+++ b/dash/profile.php
@@ -51,6 +51,30 @@ $phonelink = '+'.preg_replace('/[^0-9]/', '', $user['phone']);
<p><a href="#" onclick="bullechat.gui.create('<?=htmlentities($user['email'], ENT_HTML401 | ENT_QUOTES);?>'); return false;">Open a Chat</a></p>
</div>
</div>
+ <div id="proreviews">
+ <h3>Past Reviews</h3>
+<?php
+$result = $db->query('SELECT ratings.stars, ratings.comment, users.id AS uid, users.name, users.picture, ads.id AS adid, ads.title FROM ratings INNER JOIN users ON users.id = ratings.rater INNER JOIN ads ON ads.id = ratings.job WHERE ratings.rated = '.$user['id']) or dash_fatal($db->error);
+echo ' <p>Based on <strong>'.$result->num_rows.'</strong> jobs completed.';
+if ($result->num_rows < 1) echo ' <p><em>This user has never been reviewed.</em></p>';
+while ($row = $result->fetch_assoc()) {
+?>
+ <div class="review">
+ <div class="reviewleft">
+ <p class="revname"><a href="profile.php?id=<?=$row['uid'];?>"><?=htmlentities($row['name']);?></a></p>
+ <p class="revpic"><img src="uimg/<?=is_null($row['picture']) ? 'default.png' : intval($row['picture']).'.png';?>" alt="Profile Picture" /></p>
+ <p class="revjob">Based on <a href="ads.php?id=<?=$row['adid'];?>"><?=htmlentities($row['title']);?></a></p>
+ </div>
+ <div class="reviewright">
+ <p class="revstars"><?=rating_format($row['stars'], ' Review');?></p>
+ <p class="comment"><?=is_null($row['comment']) ? '<em>No comment provided.</em>' : htmlentities($row['comment']);?></p>
+ </div>
+ </div>
+<?php
+}
+$result->free();
+?>
+ </div>
</div>
<?php
} else if (!empty($_POST['chprofile'])) {