require("functions.php");
require("sendgrid-php/sendgrid-php.php");
$enabled = true;
// Event Fee
$eventFee = array("Registration - $2499.00",
"Registration with Single Room - $2999.00",
);
// Shirts
$shirts = array("S",
"M",
"L",
"XL",
"XXL",
"XXXL");
// Additional Items
$additionalItemsSelect = array(
"lanyard" => "Lanyard - $5.00");
// Settings
$eventName = "Coaster Crew Leaps the Pond";
$eventDate = "October 20th-27th, 2017";
$featuresLeft = '
';
$maxGuests = 0;
$actionPage = "leap-the-pond.php";
if($enabled){
if($_SERVER['REQUEST_METHOD'] != "POST"){
require("header.php");
?>
echo $eventName; ?>
echo $eventDate; ?>
require("footer.php");
?>
}elseif(isset($_POST['totalCostPass'])){
require("header.php");
$totalCost = $_POST['totalCostPass'];
$subid = $_POST['subid'];
?>
Thank your for your registration!
Payment Information
Check
Send check payable to Coastercrew for $ echo number_format($totalCost,2); ?> or $250 down to:
Coaster Crew
C/O Kate Jones
5361 Crescent Drive
Hilliard, OH 43026
Please write " echo $subid; ?>" in the memo.
require("footer.php");
}else{
?>
$reenable = "
";
$errorPre = "$reenable ";
$errorPost = "
";
while(list($k,$v)=each($_POST)){
if(!is_array($v)){
if(get_magic_quotes_gpc()){
$$k = htmlentities(strip_tags(stripslashes($v)));
}else{
$$k = htmlentities(strip_tags($v));
}
}else{
$$k = $v;
}
}
if(empty($fullname)){
die("$errorPre Name for attendee is missing $errorPost");
}elseif(empty($email)){
die("$errorPre Email for attendee is missing $errorPost");
}elseif(empty($phone)){
die("$errorPre Phone number for attendee is missing $errorPost");
}elseif(empty($badge)){
die("$errorPre Badge for attendee is missing $errorPost");
}elseif(empty($shirt)){
die("$errorPre Shirt for attendee is missing $errorPost");
}elseif(empty($address)){
die("$errorPre Address for attendee is missing $errorPost");
}elseif($attendeeEventFee == ""){
die("$errorPre Event fee for attendee is missing $errorPost");
}elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){
die("$errorPre Invalid email address for attendee $errorPost");
}
$totalCost = 0;
$subid = rand_string(5);
$message = "";
$message .= "
Submission ID: ".$subid."
Name: ".$fullname."
Email: ".$email."
Phone: ".$phone."
Badge: ".$badge."
Shirt: ".$shirt."
Address: ".nl2br($address)."
Event Fee: ".$attendeeEventFee."
Comments: ".$comments."
";
$cost = explode("- $", $attendeeEventFee);
$totalCost += $cost[1];
if(!empty($additionalItems)){
$message .= "
Additonal Items: ";
foreach( $additionalItems as $key => $value){
$message .= $value . " ";
$cost = explode("- $", $value);
$totalCost += $cost[1];
}
}
$message .= " ";
$message .= "Total Cost: $".number_format($totalCost,2)."";
$message .= "";
$body = $message;
$emailTo = array($email,'hollorantimothy@yahoo.com','matthew.rydzik@gmail.com');
// $emailTo = array($email,'matthew.rydzik@gmail.com');
$sendgrid = new SendGrid('coastercrew', 'FrAFasT2');
$email = new SendGrid\Email();
$email->setTos($emailTo)->
setFrom('tim@coastercrew.net')->
setFromName('Coaster Crew')->
setSubject($eventName . " Registration")->
setText($body)->
setHtml($body);
$r = $sendgrid->send($email);
?>
}
}else{
require("header.php");
echo "Registration is closed. Event has reached capacity. Join us at our next event!
";
require("footer.php");
}
?>