[insert_php]
define(“PAYPAL_EMAIL_ADDR”, “info@karate-family.com”);
$eventTitle = “HMAF East Coast Gasshuku 2019”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/db.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/common.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/service/GasshukuService.php”;
require_once $_SERVER[‘DOCUMENT_ROOT’] . “/sysadmin/model/GasshukuRegistrant.php”;
$conn = getDbConnection();
// get values from the POST
$id = $_POST[“id”];
$firstName = $_POST[“firstName”];
$lastName = $_POST[“lastName”];
$email = $_POST[“email”];
$phone = $_POST[“phone”];
$addr1 = $_POST[“addr1”];
$addr2 = $_POST[“addr2”];
$city = $_POST[“city”];
$state = $_POST[“state”];
$zip = $_POST[“zip”];
$joinRenew = $_POST[“joinRenew”];
$attendanceOption = $_POST[“attendanceOption”];
$shirtSize = $_POST[“shirtSize”];
$addlShirtSize = $_POST[“addlShirtSize”];
//$discountCode = $_POST[“discountCode”];
//$discountAmt = $_POST[“discountAmt”];
$attendBanquet = $_POST[“attendBanquet”];
$schoolName = $_POST[“schoolName”];
$instructorName = $_POST[“instructorName”];
// put values into object
$obj = new GasshukuRegistrant();
$obj->setId($id);
$obj->setLastName($lastName);
$obj->setFirstName($firstName);
$obj->setEmail($email);
$obj->setPhone($phone);
$obj->setAddr1($addr1);
$obj->setAddr2($addr2);
$obj->setCity($city);
$obj->setState($state);
$obj->setZip($zip);
$obj->setJoinRenew($joinRenew);
$obj->setAttendanceOption($attendanceOption);
$obj->setShirtSize($shirtSize);
$obj->setAddlShirtSize($addlShirtSize);
//$obj->setDiscountCode($discountCode);
//$obj->setDiscountAmt(0.00);
$obj->setAttendBanquet($attendBanquet);
$obj->setSchoolName($schoolName);
$obj->setInstructorName($instructorName);
//$str = $obj->toString();
//echo $str . “
“;
// write rec to the database
$gasshukuService = new GasshukuService();
$newId = $gasshukuService->addRec($conn, $obj);
//echo “new id = ” . $newId . “
“;
$totalCost = 0;
// output to the screen
$regMessage = gassGetRegMessage($obj, “S”);
echo $regMessage;
// registrant email related begin ————-
$to = $obj->getEmail();
$from = ‘noreply@karate-family.com’;
$subject = “Your HMAF East Coast Gasshuku 2019 registration has been received”;
// To send HTML mail, the Content-type header must be set
$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;
$headers .= ‘From: ‘.$from.”\r\n”. ‘Reply-To: ‘.$from.”\r\n” . ‘X-Mailer: PHP/’ . phpversion();
// build the email message
$emailMsg = “”;
$emailMsg .= “\n”;
$emailMsg .= ”
$emailMsg .= gassGetRegMessage($obj, “E”);
$emailMsg .= ” \n”;
$emailMsg .= ” \n”;
// send the email
mail($to, $subject, $emailMsg , $headers);
// registrant email related end————-
// admin email related begin ————-
$to = “info@karate-family.com”;
//$to = “chrismizelle@cox.net”;
$subject = “Gasshuku 2019 Registration – ” . $obj->getFullName();
// build the admin email message
$emailMsg = “”;
$emailMsg .= “\n”;
$emailMsg .= ”
$emailMsg .= gassGetAdminRegMessage($obj);
$emailMsg .= ” \n”;
$emailMsg .= ” \n”;
// send the email
mail($to, $subject, $emailMsg, $headers);
// send message to Dara Masi at hmafinfo@gmail.com
$adminEmail2 = “hmafinfo@gmail.com”;
mail($adminEmail2, $subject, $emailMsg, $headers);
mail(“chrismizelle@cox.net”, $subject, $emailMsg, $headers);
// admin email related end————-
closeDbConnection($conn);
[/insert_php]