diff options
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/app_eml.tpl | 4 | ||||
| -rw-r--r-- | inc/functions.php | 18 | ||||
| -rw-r--r-- | inc/hire_eml.tpl | 23 | ||||
| -rw-r--r-- | inc/user.php | 2 |
4 files changed, 37 insertions, 10 deletions
diff --git a/inc/app_eml.tpl b/inc/app_eml.tpl index b788f93..779e242 100644 --- a/inc/app_eml.tpl +++ b/inc/app_eml.tpl @@ -2,7 +2,7 @@ <html> <head> <meta charset="UTF-8" /> - <title>Active Your Bulletin Account</title> + <title>Job Application Received</title> </head> <body> <div id="head" style="text-align: center; width: 100%; height: 110px; border-bottom: 1px solid #dddddd;"> @@ -12,7 +12,7 @@ </div> <div style="width: 450px; display: table; margin: 1em auto;"> <div style="font-family: sans-serif; font-size: 12pt; text-align: center; margin: 15px -15px; width: 100%; display: block;"> - <p style="width: 100%;">Your Ad, <a style="color: #fb4d00;" href="[config:base_url]dash/review.php?id=[tpl:rid]">[tpl:adname]</a>, has just received a response. The applicant is named [tpl:seekername] and [tpl:seekerrating]. To get in touch, you can check out more of their profile, you can email them at <a style="color: #fb4d00;" href="mailto:[tpl:seekereml]">[tpl:seekereml]</a>, or check out more of their profile <a style="color: #fb4d00;" href="[config:base_url]dash/profile.php?id=[tpl:seekerid]">here</a>.</p> + <p style="width: 100%;">Your Ad, <a style="color: #fb4d00;" href="[config:base_url]dash/?view=[tpl:adid]">[tpl:adname]</a>, has just received a response. The applicant is named [tpl:seekername] and [tpl:seekerrating]. To get in touch, you can email them at <a style="color: #fb4d00;" href="mailto:[tpl:seekereml]">[tpl:seekereml]</a> or check out more of their profile <a style="color: #fb4d00;" href="[config:base_url]dash/profile.php?id=[tpl:seekerid]">here</a>.</p> </div> </div> <div style="width: 450px; height: 1px; margin: auto; background: #dddddd;"></div> diff --git a/inc/functions.php b/inc/functions.php index ca43d85..12bf2fc 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -72,12 +72,16 @@ function bulletin_hash ($str, $salt = '') { function bulletin_mail ($to, $subject, $body) { global $b_config; - $mg = new Mailgun\Mailgun($b_config['mg_key']); - return $mg->sendMessage($b_config['mg_dom'], array( - 'from' => $b_config['mail_from'], - 'to' => $to, - 'subject' => $subject, - 'html' => $body, - )); + try { + $mg = new Mailgun\Mailgun($b_config['mg_key']); + return $mg->sendMessage($b_config['mg_dom'], array( + 'from' => $b_config['mail_from'], + 'to' => $to, + 'subject' => $subject, + 'html' => $body, + )); + } catch (Exception $e) { + return 0; + } } ?> diff --git a/inc/hire_eml.tpl b/inc/hire_eml.tpl new file mode 100644 index 0000000..86fbb33 --- /dev/null +++ b/inc/hire_eml.tpl @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8" /> + <title>Job Application Selected</title> + </head> + <body> + <div id="head" style="text-align: center; width: 100%; height: 110px; border-bottom: 1px solid #dddddd;"> + <a class="logolink" href="[config:base_url]"> + <img style="width: 334px; height: 80px; margin: 15px auto;" src="[config:base_url]img/5.png" alt="Bulletin" /> + </a> + </div> + <div style="width: 450px; display: table; margin: 1em auto;"> + <div style="font-family: sans-serif; font-size: 12pt; text-align: center; margin: 15px -15px; width: 100%; display: block;"> + <p style="width: 100%;">[tpl:providername] has selected you for their ad, <a style="color: #fb4d00;" href="[config:base_url]dash/ads.php?id=[tpl:adid]">[tpl:adtitle]</a>. If you have any questions, please review the job description, contact the job provider at <a style="color: #fb4d00;" href="mailto:[tpl:provideremail]">[tpl:provideremail]</a>, or pay a visit to their <a style="color: #fb4d00;" href="[config:base_url]dash/profile.php?id=[tpl:providerid]">profile</a>.</p> + <p style="width: 100%;">Once the job is complete, please rate your experience with this provider under the <a style="color: #fb4d00;" href="[config:base_url]dash/rate.php">rate</a> tab.</p> + </div> + </div> + <div style="width: 450px; height: 1px; margin: auto; background: #dddddd;"></div> +[config:eml_footer] + <p style="color: #dddddd; margin: 4em auto auto auto; text-align: center; font-size: x-small; font-family: sans-serif;">Copyright © 2016 Bulletin Team</p> + </body> +</html> diff --git a/inc/user.php b/inc/user.php index 878a086..70bc646 100644 --- a/inc/user.php +++ b/inc/user.php @@ -9,7 +9,7 @@ if (empty($_COOKIE[$b_config['c_name']]) || !preg_match('/^(\d+);([0-9a-zA-Z\.]+ } else { $db = new bdb(); - $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM users LEFT JOIN ratings ON ratings.rated = users.id WHERE users.id = '.intval($matches[1]).' AND users.session = \''.bulletin_hash($matches[2]).'\' AND users.active = 1 LIMIT 1') or fatal($db->error); + $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating, COUNT(notif.id) AS notif FROM users LEFT JOIN ratings ON ratings.rated = users.id LEFT JOIN notif ON notif.uid = users.id AND notif.seen = 0 WHERE users.id = '.intval($matches[1]).' AND users.session = \''.bulletin_hash($matches[2]).'\' AND users.active = 1 GROUP BY users.id LIMIT 1') or fatal($db->error); if ($result->num_rows < 1) $b_user = $guest_user; else $b_user = $result->fetch_assoc(); $result->free(); |
