[insert_php] if(isset($_POST[‘eventID’])){ $event = getEventByEventID($_POST[‘eventID’]); } $vegetarian = “0”; if(isset($_GET[‘rid’])){ $registration = getRegistrationByID($_GET[‘rid’]); $person = getPersonByPersonID($registration->person_id); $event = getEventByEventID($registration->event_id); }else if(isLoggedIn() && isset($_POST[‘eventID’])){ $person = getPersonByPersonID($_SESSION[‘memberid’]); $registration = getRegistrationByEvent($person->personID, $_POST[‘eventID’]); }else if(isset($_POST[‘personID’]) && isset($_POST[‘eventID’])){ $person = getPersonByPersonID($_POST[‘personID’]); $registration = getRegistrationByEvent($person->personID, $_POST[‘eventID’]); }else if(isset($_POST[’emailField’]) && isset($_POST[‘eventID’])){ $email = $_POST[’emailField’]; $firstName = isset($_POST[‘firstNameField’]) ? $_POST[‘firstNameField’] : “”; $middleName = isset($_POST[‘middleNameField’]) ? $_POST[‘middleNameField’] : “”; $lastName = isset($_POST[‘lastNameField’]) ? $_POST[‘lastNameField’] : “”; $suffix = isset($_POST[‘suffixField’]) ? $_POST[‘suffixField’] : “”; $address = isset($_POST[‘addressField’]) ? $_POST[‘addressField’] : “”; $address2 = isset($_POST[‘address2Field’]) ? $_POST[‘address2Field’] : “”; $city = isset($_POST[‘cityField’]) ? $_POST[‘cityField’] : “”; $state = isset($_POST[‘stateField’]) ? strtoupper($_POST[‘stateField’]) : “”; $zip = isset($_POST[‘zipField’]) ? $_POST[‘zipField’] : “”; $phone = isset($_POST[‘phoneField’]) ? trimPhone($_POST[‘phoneField’]) : “”; $yearsExperience = isset($_POST[‘yearsExperienceField’]) ? $_POST[‘yearsExperienceField’] : “”; $nctmMember = isset($_POST[‘nctmMemberField’]) ? “1” : “0”; $gradeLevel = isset($_POST[‘gradeLevelField’]) ? implode(“,”,$_POST[‘gradeLevelField’]) : “”; $teachingStatus = isset($_POST[‘teachingStatusField’]) ? $_POST[‘teachingStatusField’] : “”; if($state == “NE”){ $status = “6”; $joinedDate = date(“Y-m-d”); $expiresDate = date(“Y-m-d”, strtotime(‘+1 year’)); }else{ $status = “7”; $joinedDate = “”; $expiresDate = “”; } $password = password_hash($_POST[‘newPasswordField’], PASSWORD_DEFAULT); $personID = addPerson($email, $firstName, $middleName, $lastName, $suffix, $address, $address2, $city, $state, $zip, $phone, $yearsExperience, $nctmMember, $status, $password, $joinedDate, $expiresDate, $gradeLevel, $teachingStatus); $person = getPersonByPersonID($personID); } if(!$person || !$event){ echo ‘‘; } $personID = $person->personID; if(!$registration){ if(!isset($_POST[‘attendDatesField’]) || count($_POST[‘attendDatesField’]) == 0){ echo ‘‘; } $vegetarian = isset($_POST[‘vegetarianField’]) ? “1” : “0”; $dateString = implode(“,”,$_POST[‘attendDatesField’]); $registrationType = “”; if(isNMPDS($person->email)){ $registrationType = “7”; }else if(isMathChampion($person->email)){ $registrationType = “8”; }else if(isSpeaker($person->personID, $event->eventID)){ $registrationType = “6”; }else if($person->teachingStatus == “Pre-service Teacher”){ $registrationType = “5”; }else if(isBoardMemberByPersonID($personID)){ $registrationType = “2”; }else if($person->status_id == 1 || $person->status_id == 4){ $registrationType = “1”; }else if($_POST[‘teachingStatusField’] == “Teacher” && $_POST[‘yearsExperienceField’] == “0”){ $registrationType = “4”; }else{ $registrationType = “3”; } registerPersonForEvent($person->personID, $event->eventID, $registrationType, $dateString, 0, 0, $vegetarian); $registration = getRegistrationByEvent($person->personID, $event->eventID); } if(!$event || !$registration){ echo ‘‘; } $totalCost = 0; $dateArray = explode(“,”, $registration->datesAttending); $membershipChair = getMembershipChair(); $membershipChairName = $membershipChair->firstName . ‘ ‘ . $membershipChair->lastName; $webmaster = getWebmaster(); $webmasterName = $webmaster->firstName . ‘ ‘ . $webmaster->lastName; $registrantTypeID = $registration->registrantType_id; foreach($dateArray as $thisDate){ $dayCost = getCostByTypeID($event->eventID, $registrantTypeID, $thisDate); $totalCost += $dayCost; } if($registration->registrationEmailSent == 0){ $to = $person->email; $subject = ‘NATM Registration Confirmation’; $message = getGreeting($person->personID); $newMember = 0; if($registrantTypeID == 2 && $totalCost == 0){ $message .= ‘Thank you for registering for the event: ‘ . $event->title . ‘. As an NATM board member your registration fee is waived, so no further action is required.’; markPaymentSubmitted($registration->registrationID); markPaymentReceived($registration->registrationID); }else{ $message .= ‘Thank you for registering for the event: ‘ . $event->title . ‘. You will receive an additional notification e-mail regarding your registration once you have submitted your payment.’; } $message .= ‘
Your registration information can be found here: ‘; if($registration->registrationEmailSent == 0){ echo ‘Thank you for registering for this event. You should receive a confirmation e-mail shortly.

Registration confirmation for ‘ . getRegistrantTypeByTypeID($registrantTypeID) . ‘:

‘; }else{ echo ‘You have already registered for this event.
If you need to change your registration please contact ‘ . $webmasterName . ‘ at ‘ . $webmaster->email . ‘.

You can download the conference schedule flyer
Address:‘ . $person->address . ($person->address2 != “” ? ‘
‘ : ”) . $person->address2 . ‘
‘ . $person->city . ‘, ‘ . $person->state . ‘ ‘ . $person->zip . ‘‘; echo ‘E-mail:‘ . $person->email . ‘‘; echo ‘Phone:‘ . stylePhone(getPrimaryPhoneByPersonID($person->personID)) . ‘‘; echo ‘NCTM Member:‘ . ($person->nctmMember == 1 ? “YES” : “NO”) . ‘‘; $totalCost = 0; foreach($dateArray as $thisDate){ $dayCost = getCostByTypeID($event->eventID, $registrantTypeID, $thisDate); $date = date(“D, M j”, strtotime($thisDate)); echo ‘‘ . $date . ‘\$’ . $dayCost . ‘‘; $totalCost += $dayCost; } echo ‘
‘; echo ‘Total cost:\$’ . $totalCost . ‘‘; if($totalCost > 0 && $registration && ($registration->paymentSubmitted == 1 || $registration->paymentReceived)){ echo ‘You have already submitted
payment for this event.‘; }elseif($totalCost > 0){ echo ‘‘; /* if($registration && $registration->registrantType_id==3){ echo ‘
registrationID . ‘”>Printable Receipt‘; }else{ echo ‘