예제 #1
0
<?php

/*
 * LMT/Registration/Individual.php
 * LHS Math Club Website
 */
require_once '../../.lib/lmt-functions.php';
lmt_reg_restrict_access('X');
if (isset($_POST['lmt_do_reg_individual'])) {
    process_form();
} else {
    show_form('', 'name');
}
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
예제 #2
0
<?php

/*
 * LMT/Registration/Team.php
 * LHS Math Club Website
 */
require_once '../../.lib/lmt-functions.php';
lmt_reg_restrict_access('L');
if (isset($_POST['lmt_do_reg_add'])) {
    do_add();
} else {
    if (isset($_POST['lmt_do_reg_edit_name'])) {
        do_edit_name();
    } else {
        if (isset($_POST['lmt_do_reg_delete'])) {
            do_delete();
        } else {
            if (isset($_POST['lmt_do_reg_add_member'])) {
                do_add_member();
            } else {
                if (isset($_POST['lmt_do_reg_edit_member'])) {
                    do_edit_member();
                } else {
                    if (isset($_GET['Add'])) {
                        show_add_page('', 'team_name');
                    } else {
                        if (isset($_GET['Edit'])) {
                            show_edit_page('', "document.forms['lmtRegAddMember'].member_name.focus();");
                        } else {
                            if (isset($_GET['Delete'])) {
                                show_delete_page();