function show_form() { // Get the code for reCAPTCHA $recaptcha_code = recaptcha_get_html_f(); global $school_name, $email; // Assemble the page, and send. echo <<<HEREDOC <h1>Coach Registration</h1> <div class="instruction"> In order to register <b>teams</b> for the Lexington Math Tournament, create an account by filling out this form. \t Individuals who do not have teams should go to <a href="Individual">Individual Registration</a>. Only one account per school or organization is required; each account may register multiple teams. Note that \t each <i>team</i> <b>must</b> have one adult volunteer (coach, teacher, parent, or otherwise) for supervision.<br /> <br /> \t Competitors are strongly advised to organize into teams of 4 to 6 students. \t Additionally, remember that to prevent cherry-picking to create elite teams, registering teams across different \t schools is <i>not</i> allowed unless specifically granted exception (such as for homeschool). If you don't have a \t team, ask your math coach or register as an individual! \t <br /> If you have already registered, use the link in the confirmation email to access your school's information. For assistance, please <a href="../Contact">contact us</a>. </div> <br /> <form id="lmtRegCoach" method="post" action="{$_SERVER['REQUEST_URI']}"> <table> <tr> <td>School/Organization: </td> <td> <input type="text" name="school_name" size="25" maxlength="35" value="{$school_name}" /> <br /><br /> </td> </tr><tr> <td>Coach's Email Address:</td> <td><input id="email" type="text" name="email" size="25" maxlength="320" value="{$email}" /></td> </tr><tr> <td>Security Check:</td> <td>{$recaptcha_code}</td> </tr><tr> <td></td> <td> <input type="submit" name="lmt_do_reg_coach" value="Create Account" /> <a href="Home">Cancel</a> </td> </tr> </table> </form> HEREDOC; die; }
function show_request_page($err, $selected_field) { restrict_access('X'); // If an error message is given, put it inside this div if ($err != '') { $err = "\n <div class=\"error\">{$err}</div><br />\n"; } // Get the code for reCAPTCHA $recaptcha_code = recaptcha_get_html_f(); // A little javascript to put the cursor in the first field when the form loads; // page_header() looks at the $body_onload variable and inserts it into the code. global $body_onload; $body_onload = 'document.forms[\'initiatePasswordReset\'].' . $selected_field . '.focus()'; $email = ""; if (@isset($_POST['email'])) { $email = $_POST['email']; } // make page page_header('Password Reset'); echo <<<HEREDOC <h1>Password Reset</h1> If you forgot your password, use this form to reset it.<br /> <br /> {$err} <form id="initiatePasswordReset" method="post" action="{$_SERVER['REQUEST_URI']}"> <table> <tr> <td>Email Address:</td> <td><input type="text" name="email" value="{$email}" size="25"/></td> </tr><tr> <td>Are you human?</td> <td>{$recaptcha_code}</td> </tr><tr> <td></td> <td> <input type="submit" name="do_initiate_reset" value="Continue"/> <a href="Signin">Cancel</a> </td> </tr> </table> </form> HEREDOC; }
function show_form() { // Figure out what year people will be graduating. $year4 = (int) date('Y'); if ((int) date('n') > 6) { // after June... $year4 += 1; } $year3 = $year4 + 1; $year2 = $year4 + 2; $year1 = $year4 + 3; // If the form was submitted before but had errors, fill in the previous values; // these were parsed when process_form was called global $name, $email, $cell, $yog, $mailings; $year1_sel = $yog == $year1 ? ' selected' : ''; // add the attribute 'selected' to the YOG that they selected $year2_sel = $yog == $year2 ? ' selected' : ''; $year3_sel = $yog == $year3 ? ' selected' : ''; $year4_sel = $yog == $year4 ? ' selected' : ''; if ($mailings == '0') { $mailings = ''; } else { $mailings = ' checked="checked"'; } // Auto-fill pre-approved email address if (!isset($email) && isset($_SESSION['PREAPPROVED'])) { $email = htmlentities($_SESSION['PREAPPROVED']); } // Get the code for reCAPTCHA $recaptcha_code = recaptcha_get_html_f(); // Assemble the page, and send. page_header('Register'); echo <<<HEREDOC <h1>Register</h1> <p>Create an account to access scores, handouts and other information.</p> <p><span class="b">These accounts are intended for members of the LHS Math Club only.</span> \t\tIf you're trying to register for LMT, visit <a href="http://www.lhsmath.org/LMT/Registration/">http://www.lhsmath.org/LMT/Registration/</a> once registration is open.</p> \t <small>Please contact <a href="mailto:webmaster@lhsmath.org">webmaster@lhsmath.org</a> if this page doesn't work!</small> <br> \t <form id="register" method="post" action="{$_SERVER['REQUEST_URI']}" autocomplete="off"> <table> <tr> <td>Name:</td> <td> <input type="text" name="name" size="25" maxlength="25" value="{$name}" class="focus"/><br /> <span class="small">First name or nickname AND last name</span><br /><br /> </td> </tr><tr> <td>Email Address:</td> <td><input id="username" type="text" name="email" size="25" maxlength="320" value="{$email}"/></td> </tr><tr> <td>Cell Phone Number: </td> <td> <input type="text" name="cell" size="25" value="{$cell}"/><br /> <span class="small">Optional</span><br /><br /> </td> </tr><tr> <td>Year of Graduation:</td> <td> <select name="yog"> <option value="{$year1}"{$year1_sel}>{$year1}</option> <option value="{$year2}"{$year2_sel}>{$year2}</option> <option value="{$year3}"{$year3_sel}>{$year3}</option> <option value="{$year4}"{$year4_sel}>{$year4}</option> </select><br /><br /> </td> </tr><tr> <td>Password:</td> <td><input id="password" type="password" name="pass1" size="25"/></td> </tr><tr> <td>Re-type Password:</td> <td> <input type="password" name="pass2" size="25"/><br /> <span class="small">Must be at least 6 characters</span><br /><br /> </td> </tr><tr> <td>Mailing List:</td> <td> <input id="mailings" type="checkbox" name="mailings" value="Yes"{$mailings}/> <label for="mailings">Receive Math Club announcements</label><br /><br /> </td> </tr><tr> \t <!-- <td>Are you human?</td> <td>{$recaptcha_code}</td> \t --> </tr><tr> <td></td> <td><input type="submit" name="do_register" value="Create Account"/></td> </tr> </table> </form> HEREDOC; }
function show_form($err, $selected_field) { // A little javascript to put the cursor in the first field when the form loads; // page_header() looks at the $body_onload variable and inserts it into the code. global $body_onload; $body_onload = 'document.forms[\'lmtRegIndividual\'].' . $selected_field . '.focus();'; // If an error message is given, put it inside this div if ($err != '') { $err = "\n <div class=\"error\">{$err}</div><br />\n"; } // If the form was submitted before but had errors, fill in the previous values; // these were parsed when process_form was called global $name, $email, $grade; $grade6_sel = $grade == '6' ? ' selected' : ''; // add the attribute 'selected' to the grade that they selected $grade7_sel = $grade == '7' ? ' selected' : ''; $grade8_sel = $grade == '8' ? ' selected' : ''; // Get the code for reCAPTCHA $recaptcha_code = recaptcha_get_html_f(); // Dates $lmt_year = htmlentities(map_value('year')); $lmt_date = htmlentities(map_value('date')); $lmt_cost = htmlentities(map_value('indiv_cost')); // Assemble the page, and send. lmt_page_header('Individual Registration'); echo <<<HEREDOC <h1>Individual Registration</h1> <div class="instruction"> To register as an individual <span class="b">not affiliated with a school</span>, please fill out this form with your parents.<br /> <br /> The Lexington Mathematics Tournament {$lmt_year} will be held on <span class="b">{$lmt_date}</span> at Lexington High School. Please read the rules before registering.<br /> <br /> An individual registration costs <span class="b">{$lmt_cost}</span>, paid at the competition. </div> <br /> \t {$err} <form id="lmtRegIndividual" method="post" action="{$_SERVER['REQUEST_URI']}"> <table> <tr> <td>Full Name:</td> <td><input type="text" name="name" size="25" maxlength="25" value="{$name}" /></td> </tr><tr> <td>Parent's Email Address: </td> <td><input id="email" type="text" name="email" size="25" maxlength="320" value="{$email}" /></td> </tr><tr> <td>Grade:</td> <td> <select name="grade"> <option value="6"{$grade6_sel}>Sixth</option> <option value="7"{$grade7_sel}>Seventh</option> <option value="8"{$grade8_sel}>Eighth</option> </select><br /><br /> </td> </tr><tr> <td>Are you human?</td> <td>{$recaptcha_code}</td> </tr><tr> <td></td> <td> <input type="submit" name="lmt_do_reg_individual" value="Register" /> <a href="Home">Cancel</a> </td> </tr> </table> </form> HEREDOC; die; }