From a17c35d61bcca213a810ba4abea896075647df66 Mon Sep 17 00:00:00 2001 From: cflem Date: Sat, 21 Jan 2017 16:46:59 -0500 Subject: Created ad responses --- dash/ads.php | 6 +++-- dash/apply.php | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ dash/css/dash.css | 24 ++++++++++++++++---- dash/dash_employee.php | 2 +- dash/settings.php | 2 +- 5 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 dash/apply.php (limited to 'dash') 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(); ?>
@@ -38,6 +38,8 @@ else

No bio included in profile.' : htmlentities($row['bio']));?>

Respond to this Ad

+

Apply Now

+

Contact the Employer

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(); +?> +
+
+

+

Pays $

+

at

+
+
+

+
+
+
+'.PHP_EOL; +else + echo ' Profile Picture'.PHP_EOL; +?> +

+Employer Not Rated

'.PHP_EOL; +else + echo '

'.intval($row['rating']).' Star Employer

'.PHP_EOL; +?> +
+
+
+

Comments (Optional)

+

+

+
+
+
+
+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'])) {

Account Settings

Adjusting for

-
+

Current Password

Your current password is needed to change your account settings.

-- cgit v1.2.3