-
Notifications
You must be signed in to change notification settings - Fork 0
/
emailAjaxHandler.php
39 lines (34 loc) · 1.08 KB
/
emailAjaxHandler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
//Load wordpress database to use wpdb
require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');
securityCheck();
require_once 'requires/email.php';
global $wpdb;
$info = $wpdb->get_results($wpdb->prepare("SELECT *
FROM ((srbc_registration
INNER JOIN srbc_camps ON srbc_registration.camp_id=srbc_camps.camp_id)
INNER JOIN srbc_campers ON srbc_registration.camper_id=srbc_campers.camper_id) WHERE srbc_registration.registration_id=%d",
$_GET['r_id']));
//For resending confirmation emails
if($_GET["type"] == "resend")
{
//We only need the first object
if($info[0]->area == "Workcrew" || $info[0]->area == "WIT")
{
$isWit = ($info[0]->area == "WIT");
Email::sendWorkcrewEmail($info[0]->camper_id,null,$isWit);
}
else
{
if($info[0]->day_camp == 0)
Email::sendConfirmationEmail($_GET['r_id']);
else
Email::sendDayCampConfirmationEmail($_GET['r_id']);
}
}
//For sending balance due emails
else if($_GET['type'] == "balance_due")
{
Email::emailParentRemainingBalance($_GET['r_id']);
}
?>