[insert_php]
define(“PAYPAL_EMAIL_ADDR”, “info@karate-family.com”);
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/db.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/common.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/service/TcService.php”;
$tcService = new TcService();
$eventTitle = “Seminar with Master Sumarac”;
//$addr = “diana@karate-family.com”;
//$addr = “chrismizelle@cox.net”;
$addr = “shifu.laughingdragon@gmail.com”;
$yourName = $_POST[“yourName”];
$email = $_POST[“email”];
$phone = $_POST[“phone”];
$day1 = $_POST[“day1”];
$day2 = $_POST[“day2”];
$day3 = $_POST[“day3”];
$day4 = $_POST[“day4”];
$day5 = $_POST[“day5”];
$attendingCount = 0;
$day1YesNo = ($day1 == “on”) ? “Yes” : “No”;
$day1Binary = ($day1 == “on”) ? 1 : 0;
if ($day1 == “on”)
{
$attendingCount++;
}
$day2YesNo = ($day2 == “on”) ? “Yes” : “No”;
$day2Binary = ($day2 == “on”) ? 1 : 0;
if ($day2 == “on”)
{
$attendingCount++;
}
$day3YesNo = ($day3 == “on”) ? “Yes” : “No”;
$day3Binary = ($day3 == “on”) ? 1 : 0;
if ($day3 == “on”)
{
$attendingCount++;
}
$day4YesNo = ($day4 == “on”) ? “Yes” : “No”;
$day4Binary = ($day4 == “on”) ? 1 : 0;
if ($day4 == “on”)
{
$attendingCount++;
}
$day5YesNo = ($day5 == “on”) ? “Yes” : “No”;
$day5Binary = ($day5 == “on”) ? 1 : 0;
if ($day5 == “on”)
{
$attendingCount++;
}
$totalCost = 0;
$totalCost = ($attendingCount == 5) ? 500 : $attendingCount * 125;
echo “Thank You for registering for the ” . $eventTitle . “! We look forward to seeing you there.
“;
echo “The information you submitted is as follows:
“;
echo “Name: ” . $yourName . “
“;
echo “Email: ” . $email. “
“;
echo “Phone: ” . $phone. “
“;
echo “
“;
echo “Attending the following days :
“;
echo “Day 1: ” . $day1YesNo . “
“;
echo “Day 2: ” . $day2YesNo . “
“;
echo “Day 3: ” . $day3YesNo . “
“;
echo “Day 4: ” . $day4YesNo . “
“;
echo “Day 5: ” . $day5YesNo . “
“;
//echo “
“;
echo “Based on the days you are attending your cost is $$totalCost.
“;
$paypalButtonLabel = “Pay $$totalCost with PayPal”;
echo “
\n”;
// database begin ———–
$tcService->addRec($yourName, $email, $phone, $day1Binary, $day2Binary, $day3Binary, $day4Binary, $day5Binary);
// database end ———-
$message = “”;
$subj = $eventTitle . ” Signup Information submitted by $yourName “;
$message .= “Submitted by: $yourName\n”;
$message .= “Email: $email\n”;
$message .= “Phone: $phone\n”;
$message .= “\nAttending the following days :\n”;
$message .= “Day 1: ” . $day1YesNo . “\n”;
$message .= “Day 2: ” . $day2YesNo . “\n”;
$message .= “Day 3: ” . $day3YesNo . “\n”;
$message .= “Day 4: ” . $day4YesNo . “\n”;
$message .= “Day 5: ” . $day5YesNo . “\n”;
$message .= “Total cost : \$” . $totalCost . “\n”;
$extra = “From: noreply@karate-family.com\r\nReply-To: $email\r\n”;
if ($addr != “”)
{
//mail ($addr, $subj, $message, $extra);
//mail (“chrismizelle@cox.net”, $subj, $message, $extra);
}
$subj2 = “VMAC has received your registration for the $eventTitle”;
$message2 = “”;
$message2 = “Virginia Martial Arts Center has received your registration for the $eventTitle. “;
$message2 .= “The seminar is September 15-19, 2016 9:00 AM – 5:00 PM each day. Please try to arrive 10-15 minutes early.\n”;
//$message2 .= “\nPlease wear comfortable clothes that enable you to move freely. Warm-up or yoga pants with a t-shirt are sufficient.\n”;
$message2 .= “\nWe have the following information for you:\n\n”;
$message2 .= “Name: $yourName\n”;
$message2 .= “Email: $email\n”;
$message2 .= “Phone: $phone\n”;
$message2 .= “\nAttending the following days :\n”;
$message2 .= “Day 1: ” . $day1YesNo . “\n”;
$message2 .= “Day 2: ” . $day2YesNo . “\n”;
$message2 .= “Day 3: ” . $day3YesNo . “\n”;
$message2 .= “Day 4: ” . $day4YesNo . “\n”;
$message2 .= “Day 5: ” . $day5YesNo . “\n”;
$message2 .= “Total cost : \$” . $totalCost . “\n”;
$message2 .= “\nIf you have any questions, feel free to call us at (757) 483-0195 or email Shifu Price at shifu.laughingdragon@gmail.com .\n\n”;
$message2 .= “Thank you and we will see you at the seminar.”;
$extra2 = “From: noreply@karate-family.com\r\nReply-To: noreply@karate-family.com\r\n”;
//mail ($email, $subj2 , $message2, $extra2);
//mail (“chrismizelle@cox.net”, $subj2 , $message2, $extra2);
[/insert_php]