*/ // Page requirements define('LOGIN_REQUIRED', true); define('PAGE_ACCESS_LEVEL', 2); define('PAGE_TYPE', 'ADMIN'); // Set for every page require 'engine/common.php'; require_once 'com/tcshl/registration/Registration.php'; if (isset($_GET['id']) && $_GET['id'] > 0) { $registration = new Registration($_GET['id']); $registration->formPreLoad($smarty); $smarty->assign('id', $registration->get_registrationID()); } else { if (isset($_POST['action']) && $_POST['action'] == "Edit Registration") { $registration = new Registration($_POST['id']); $smarty->assign('id', $registration->get_registrationID()); // If form does not validate, we need to return with errors. if ($registration->formValidation()) { handle_errors($registration->get_formErrors()); $registration->formReposts($smarty); } else { // If errors occur while trying to create user, we need to return with errors. if ($registration->formProcessUpdate()) { handle_errors($registration->get_formErrors()); $registration->formReposts($smarty); } else { $registration->formPreLoad($smarty); handle_success($registration->get_formSuccess()); } } } else {
$smarty->assign('OPEN_REGISTRATION', get_site_variable_value("REGISTRATION")); if (isset($_POST['action']) && $_POST['action'] == "Register") { $registration = new Registration(0); // If form does not validate, we need to return with errors. if ($registration->formValidation()) { handle_errors($registration->get_formErrors()); $registration->formReposts($smarty); } else { // If errors occur while trying to create user, we need to return with errors. if ($registration->formProcessInsert()) { handle_errors($registration->get_formErrors()); $registration->formReposts($smarty); } else { $registration->emailRegistrationAdmin(); if ($registration->get_payToday() == "1") { header("Location: payment.php?registrationid=" . $registration->get_registrationID()); } else { header("Location: registrationok.php"); } } } } else { $smarty->assign('fw', 'CHECKED'); // Position = Forward $smarty->assign('jsxl', 'CHECKED'); // Jersey Size XL $smarty->assign('sl3', 'CHECKED'); // Skill Level Intermediate $smarty->assign('dl1', 'CHECKED'); // D.R.I.L. - Only TCSHL }