diff options
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/css/dash.css | 2 | ||||
| -rw-r--r-- | dash/dash_functions.php | 4 | ||||
| -rw-r--r-- | dash/settings.php | 15 | ||||
| -rw-r--r-- | dash/uimg/1.png | bin | 21047 -> 0 bytes |
4 files changed, 16 insertions, 5 deletions
diff --git a/dash/css/dash.css b/dash/css/dash.css index 4bc22a2..02fed66 100644 --- a/dash/css/dash.css +++ b/dash/css/dash.css @@ -238,7 +238,7 @@ h3 a:hover, h4 a:hover { } #fulljob.fjsettings { margin: 2em auto 0 auto; - height: 455px; + height: 520px; border-radius: 5px; } .fjsettings #fjbody { diff --git a/dash/dash_functions.php b/dash/dash_functions.php index 334d253..2d01973 100644 --- a/dash/dash_functions.php +++ b/dash/dash_functions.php @@ -59,10 +59,12 @@ function draw_ad ($row) { function app_trigger ($responseid) { global $db; - $result = $db->query('SELECT responses.id, responses.uid AS seeker, responses.adid, responses.comment, ads.title, users.name, users.email FROM responses INNER JOIN ads ON responses.adid = ads.id INNER JOIN users ON ads.uid = users.id WHERE responses.id = '.$responseid.' LIMIT 1') or dash_fatal($db->error); + $result = $db->query('SELECT responses.id, responses.uid AS seeker, responses.adid, responses.comment, ads.title, users.name, users.email, users.notify FROM responses INNER JOIN ads ON responses.adid = ads.id INNER JOIN users ON ads.uid = users.id WHERE responses.id = '.$responseid.' LIMIT 1') or dash_fatal($db->error); if ($result->num_rows < 1) dash_fatal('The ad you\'ve tried to apply to no longer exists.'); $appinfo = $result->fetch_assoc(); $result->free(); + if (!$appinfo['notify']) return; + $result = $db->query('SELECT users.name, users.email, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM users LEFT JOIN ratings ON ratings.rated = users.id') or dash_fatal($db->error); $uinfo = $result->fetch_assoc(); $result->free(); diff --git a/dash/settings.php b/dash/settings.php index c17a6dd..b27122d 100644 --- a/dash/settings.php +++ b/dash/settings.php @@ -5,7 +5,7 @@ require('dash_common.php'); global $b_config, $b_user; $title = 'Account Settings / Bulletin'; require('header.php'); -if (!empty($_POST['oldpass'])) { +if (!empty($_POST['change'])) { if ($b_user['password'] != hash('sha512', $_POST['oldpass'])) dash_fatal('The password you entered does not match your current password.'); if (!empty($_POST['newpass1'])) { if ($_POST['newpass1'] != $_POST['newpass2']) dash_fatal('Your new passwords do not match.'); @@ -20,12 +20,17 @@ if (!empty($_POST['oldpass'])) { $db->query('UPDATE users SET type = \''.$type.'\' WHERE id = '.$b_user['id']) or dash_fatal($db->error); if ($db->affected_rows < 1) dash_fatal('Your account type could not be changed.'); } - dash_fatal('Account settings successfully updated.'); + + if ($_POST['notif'] != $b_user['notify']) { + $notif = is_null($_POST['notif']) ? '0' : '1'; + $db->query('UPDATE users SET notify = '.$notif.' WHERE id = '.$b_user['id']) or dash_fatal($db->error); + } + dash_fatal('Account settings successfully updated.', $b_config['base_url'].'dash/settings.php'); } ?> <div id="fulljob" class="fjsettings"> <div id="fjheader"> - <h3 id="fjhtitle">Account Settings</h3> + <h3 id="fjhtitle"><a href="settings.php">Account Settings</a></h3> <p id="fjhdesc">Adjusting for <?=htmlentities($b_user['email']);?></p> </div> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post"> @@ -49,6 +54,10 @@ if (!empty($_POST['oldpass'])) { </select> </p> </div> + <div class="pseudoform"> + <h4>Email Notifications</h4> + <p><input id="inpnotif" type="checkbox" name="notif" <?=$b_user['notify'] ? ' checked="checked"' : '';?> /><label for="inpnotif">Send me account-related notifications via email.</label></p> + </div> <p id="setchgbtn"><input id="inpchg" type="submit" name="change" value="Update Settings" /></p> </div> </form> diff --git a/dash/uimg/1.png b/dash/uimg/1.png Binary files differdeleted file mode 100644 index 0bef227..0000000 --- a/dash/uimg/1.png +++ /dev/null |
