[insert_php]
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/db.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/common.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/service/EventService.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/model/Event.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/model/EventRegistrant.php”;
$con = getDbConnection();
$eventService = new EventService();
$eventRegistrant = new EventRegistrant();
$regEmailAddr = “officemgr@karate-family.com”;
//$regEmailAddr = “chrismizelle@cox.net”;
$eid = $_POST[“eid”];
$yourName = $_POST[“yourName”];
$parentName = $_POST[“parentName”];
$address = $_POST[“address”];
$city = $_POST[“city”];
$state = $_POST[“state”];
$zip = $_POST[“zip”];
$dob = $_POST[“dob”];
$age = $_POST[“age”];
$email = $_POST[“email”];
$phone = $_POST[“phone”];
$eventRegistrant->setEventId($eid);
$eventRegistrant->setName($yourName);
$eventRegistrant->setParentName($parentName);
$eventRegistrant->setAddress($address);
$eventRegistrant->setCity($city);
$eventRegistrant->setState($state);
$eventRegistrant->setZip($zip);
//$eventRegistrant->setDob($dob);
$eventRegistrant->setAge($age);
$eventRegistrant->setEmail($email);
$eventRegistrant->setPhone($phone);
$event = $eventService->getEventById($con, $eid);
$t = $event->getTitle();
echo “
You have successfully registered for :
” . $event->getTitle() . “
” . $event->getDate() . “, ” . $event->getStartTime() . ” – ” . $event->getEndTime() . “
“;
echo “
\n”;
echo “The following information was submitted:
\n”;
echo $eventRegistrant->toString();
echo “
If you have any questions, please call us at (757)483-0195.”;
echo “
\n”;
//echo “INFO—
“;
//echo $eventRegistrant->toString();
$newId = $eventService->addRec($con, $eventRegistrant);
//echo “NEW ID = ” . $newId . “
“;
$message = “”;
$message = “You have scccessfully registered for : \n” . $event->getTitle() . “\n” . $event->getDate() . “, ” . $event->getStartTime() . ” – ” . $event->getEndTime() . “.\n\n”;
$message .= $eventRegistrant->toString(“\n”);
$adminMessage = “”;
$adminMessage = “Registration information submitted for : \n” . $event->getTitle() . “\n” . $event->getDate() . “, ” . $event->getStartTime() . ” – ” . $event->getEndTime() . “.\n\n”;
$adminMessage .= $eventRegistrant->toString(“\n”);
$subj = $event->getTitle() . ” registration submitted for ” . $eventRegistrant->getName();
$extra = “From: noreply@karate-family.com\r\nReply-To: $email\r\n”;
// admin message
mail (“chrismizelle@cox.net”, $subj, $adminMessage, $extra);
mail ($regEmailAddr, $subj, $adminMessage, $extra);
// registrant message
mail ($eventRegistrant->getEmail(), $subj, $message , $extra);
closeDbConnection($con);
[/insert_php]