function preview_message() { if (!validate_message()) { return; } global $subject, $bb_body, $body, $email, $EMAIL_ADDRESS, $LMT_EMAIL; // Get info for the byline $query = 'SELECT name, email FROM users WHERE id="' . $_SESSION['user_id'] . '"'; $result = DB::queryRaw($query); $row = mysqli_fetch_assoc($result); $disp_subject = '[LMT ' . htmlentities(map_value('year')) . '] ' . $subject; lmt_page_header('Email Coaches'); echo <<<HEREDOC <h1>Email Coaches</h1> <table class="spacious"> <tr> <td>From:</td> <td><span class="b">LMT Mailbot <{$EMAIL_ADDRESS}></span></td> </tr><tr> <td>Reply To: </td> <td><span class="b">{$LMT_EMAIL}</span><br /></td> </tr><tr> <td>Subject:</td> <td><span class="b">{$disp_subject}</span><br /><br /></td> </tr><tr> <td>Body:</td> <td>{$bb_body}<br /><br /></td> </tr><tr> <td></td> <td> <form id="composeMessage" method="post" action="{$_SERVER['REQUEST_URI']}"><div> <input type="hidden" name="subject" value="{$subject}" /> <input type="hidden" name="body" value="{$body}" /> <input type="hidden" name="email" value="{$email}" /> <input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}" /> <input type="submit" name="lmtc_do_reedit_message" value="Back to Editing" /> <input type="submit" name="lmtc_do_post_message" value="Send Message" /> </div></form> </td> </tr><tr> <td></td> <td><span class="small">Please do not click the "Send Message" button twice!</span></td> </tr> </table> HEREDOC; }
function show_logged_in_page() { //If there's no such school, we're in the middle of adding it or something. if (DB::queryFirstField('SELECT COUNT(*) FROM teams WHERE school=%i', $_SESSION['LMT_user_id']) == 0) { header('Location: Team?Add'); die; } lmt_page_header('Team Registration'); $lmt_year = htmlentities(map_value('year')); $school_name = htmlentities($_SESSION['LMT_school_name']); $table = lmt_db_table('SELECT team_id, name, school, (SELECT COUNT(*) FROM individuals WHERE individuals.team = teams.team_id AND individuals.deleted="0")' . ' AS size FROM teams WHERE school="' . mysqli_real_escape_string(DB::get(), $_SESSION['LMT_user_id']) . '" AND deleted="0" ORDER BY size, name', array('name' => 'Name', 'size' => 'Size'), array('<img src="../../res/icons/edit.png" alt="Edit" />' => 'Team?Edit={team_id}', '<img src="../../res/icons/delete.png" alt="Delete" />' => 'Team?Delete={team_id}'), 'No Teams', 'contrasting indented'); echo <<<HEREDOC <h1>Team Registration</h1> <h3 class="smbottom">Teams for {$school_name}</h3> <span class="small"> <a href="Team?Add">Add a Team</a> | <a href="Signout">Sign Out</a></span><br /><br /> {$table} HEREDOC; }
function do_edit_page() { if ((int) $_GET['ID'] == -1) { trigger_error('Cannot edit Registration page', E_USER_ERROR); } if ($_POST['xsrf_token'] != $_SESSION['xsrf_token']) { trigger_error('XSRF code incorrect', E_USER_ERROR); } $name = $_POST['name']; $content = $_POST['content']; if ($name == '') { show_form('Please choose a name for the page'); } if (strlen($name) > 25) { show_form('The page name may not be longer than 25 characters'); } str_replace($content, "{INDIVCOST}", map_value()); if (strlen($content) > 20000) { show_form('The content may not be longer than 20,000 characters'); } // ** VALIDATION COMPLETE ** \\ DB::queryRaw('UPDATE pages SET name="' . mysqli_real_escape_string(DB::get(), $name) . '", content="' . mysqli_real_escape_string(DB::get(), $content) . '" WHERE page_id="' . mysqli_real_escape_string(DB::get(), $_GET['ID']) . '" LIMIT 1'); header('Location: View?ID=' . $_GET['ID']); }
<?php /* * LMT/Backstage/Home.php * LHS Math Club Website * * A landing page for people going Backstage */ require_once '../../.lib/lmt-functions.php'; backstage_access(); global $use_rel_external_script; $use_rel_external_script = true; lmt_page_header('Backstage'); echo '<h1>Backstage</h1>' . map_value('backstage_message');
function insert_archive_page($yrfrom, $yrto) { //Get the page data $dropbox_link = 'https://www.dropbox.com/sh/6wo6f5i8il42m1c/q8Vv_FHnxM/LMT'; $nth = intval(map_value('year')) - 2009 . 'th'; //This will last until the 21st LMT. Wow. $date = map_value('date'); $num_participants = DB::queryFirstField("SELECT COUNT(*) FROM `individuals` WHERE (score_theme IS NOT NULL OR score_individual IS NOT NULL) AND deleted=0"); $num_teams = DB::queryFirstField("SELECT COUNT(*) FROM `teams` WHERE (score_team_short IS NOT NULL OR score_team_long IS NOT NULL) AND deleted=0"); $num_schools = DB::queryFirstField("SELECT COUNT(DISTINCT school_id) FROM `schools` RIGHT JOIN teams ON schools.school_id=teams.school WHERE (teams.score_team_short IS NOT NULL OR teams.score_team_long IS NOT NULL) AND teams.deleted=0 AND schools.deleted=0"); $content = <<<HEREDOC <h1>{$yrfrom} Archive</h1> <h3>{$nth} Annual LMT</h3> <strong>Date: </strong>{$date}<br> <strong>Number of participants: </strong>{$num_participants}<br> <strong>Number of teams: </strong>{$num_teams}<br> <strong>Number of schools represented: </strong>{$num_schools}<br> <br> <!--Fill in the questionmarks and un-comment the Flickr link below!--> <!--<p><strong>View photos of the event </strong><a href="?????????" rel="external">on Flickr</a>.</p><br/>--> <h3>Problems and Solutions</h3>All archived problems and solutions can be found at <a href="{$dropbox_link}" rel="external">this Dropbox folder</a>.<br/> HEREDOC; //Get the exported results global $EXPORT_STR; $EXPORT_STR = true; require_once 'Export.php'; //Supposedly also in Backstage dir $content .= show_page(); //Insert it $order_num = 3000 - $yrfrom; //specially determined formula for ordering in reverse, yet never overflowing. Not for 900 years. As long as stuff stays consistent, orderings should be able to stay the same. //--todo-- check to make sure the order number doesn't already exist, because that vastly messes things up DB::insert('pages', array('name' => "{$yrfrom} Archive", 'content' => $content, 'order_num' => $order_num)); }
function preview_message() { // Get info for the byline $disp_subject = '[LMT ' . intval(map_value('year')) . '] ' . $_POST['subject']; lmt_page_header('Email Individuals'); echo <<<HEREDOC <h1>Email Individuals</h1> <table class="spacious"> <tr> <td>From:</td> <td><span class="b">LHS Math Club Mailbot <{$EMAIL_ADDRESS}></span></td> </tr><tr> <td>Reply To: </td> <td><span class="b">{$LMT_EMAIL}</span><br /></td> </tr><tr> <td>Subject:</td> <td><span class="b">{$disp_subject}</span><br /><br /></td> </tr><tr> <td>Body:</td> <td>{$bb_body}<br /><br /></td> </tr><tr> <td></td> <td> <form id="composeMessage" method="post" action="{$_SERVER['REQUEST_URI']}"><div> <input type="hidden" name="subject" value="{$subject}" /> <input type="hidden" name="body" value="{$body}" /> <input type="hidden" name="email" value="{$email}" /> <input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}" /> <input type="submit" name="lmti_do_reedit_message" value="Back to Editing" /> <input type="submit" name="lmti_do_post_message" value="Send Message" /> </div></form> </td> </tr><tr> <td></td> <td><span class="small">Please do not click the "Send Message" button twice!</span></td> </tr> </table> HEREDOC; }
function show_page() { global $header_noprint; $header_noprint = true; lmt_page_header('Score Sheets'); $message = ''; $lmt_year = intval(map_value('year')); $lmt_nextyear = $lmt_year + 1; $lmt_archive_url = URL::lmt() . "/{$lmt_year}_Archive"; if (scoring_is_enabled()) { $message = '<div class="error noPrint">Score entry is still enabled! Disable it <a href="../Scoring/Refrigerator">here</a>.</div><br />'; } echo <<<HEREDOC <h1 class="noPrint">Score Emails</h1> {$message} \t \t <style>textarea{width: 100%;height: 400px;}</style> \t \t\t<form method="post" action="{$_SERVER['REQUEST_URI']}"> \t\t\t<input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}"/> \t\t\t<input type="submit" name="Send" value="Send All Emails"/> \t\t</form> <div> HEREDOC; $individuals = DB::query('SELECT individuals.name as ind_name, individuals.grade as grade, ' . 'IFNULL(score_team_short, 0) + IFNULL(score_team_long, 0) AS score_team, ' . 'score_guts, teams.name AS team_name, score_individual as score_ind, score_theme, email ' . 'FROM individuals LEFT JOIN teams ON team=team_id ' . 'WHERE email != "" AND individuals.deleted = 0 ORDER BY ind_name'); foreach ($individuals as $ind) { $if_not_eighth = ""; if ($ind['grade'] != 8) { ", and we hope to see you at LMT {$lmt_nextyear}"; } $body = <<<HEREDOC Hello, Thanks for coming to LMT {$lmt_year}; here are your individual results! [b]Name:[/b] {$ind['ind_name']} [b]Individual Score:[/b] {$ind['score_ind']} [b]Theme Score:[/b] {$ind['score_theme']} As an unaffiliated individual, you were also placed onto a team. Here's how you did: [b]Team Name:[/b] {$ind['team_name']} [b]Team Round Score:[/b] {$ind['score_team']} [b]Guts Round Score:[/b] {$ind['score_guts']} You can also find useful things such as overall results, photos, and problems and solutions at [url]{$lmt_archive_url}[/url]. Finally, we'd love to hear from you! Any feedback at all about how we did this year and how we might improve for next year is greatly appreciated. Thanks for coming{$if_not_eighth}! LHS Math Team Captains HEREDOC; if (array_key_exists('Send', $_POST) && $_POST['xsrf_token'] == $_SESSION['xsrf_token']) { echo $ind['email']; $err = lmt_send_email($ind['email'], "Scores!", $body); if ($err !== true) { alert($err, -1); return; } else { alert("Sent to {$ind['email']}", 1); } } echo "<h2>{$ind['email']}</h2><div style='border:solid 1px #000'>" . BBCode($body) . "</div>"; } $teams = DB::query('SELECT team_id, IFNULL(score_team_short, 0) + IFNULL(score_team_long, 0) AS score_team, ' . ' score_guts, teams.name AS team_name, teams.school AS school_id,' . ' schools.name AS school_name, coach_email ' . ' FROM teams RIGHT JOIN schools ON teams.school=schools.school_id ' . ' WHERE teams.deleted=0 ORDER BY school_name, team_name'); for ($i = -1; $i + 1 < count($teams);) { $body = ''; do { $i++; $team = $teams[$i]; $school = htmlentities($team['school_name']); $coach_email = htmlentities($team['coach_email']); $team_id = htmlentities($team['team_id']); $team_name = htmlentities($team['team_name']); $score_team = htmlentities($team['score_team']); $score_guts = htmlentities($team['score_guts']); if ($body == '') { $body = <<<HEREDOC Hello, Thanks for coming to LMT {$lmt_year}; here are the results for your team(s)! [b]School Name:[/b] {$school} HEREDOC; } if (is_null($team['score_team'])) { $score_team = 'NONE'; } if (is_null($team['score_guts'])) { $score_guts = 'NONE'; } $body .= <<<HEREDOC [b]Team Name:[/b] {$team_name} [b]Team Round Score:[/b] {$score_team} [b]Guts Round Score:[/b] {$score_guts} HEREDOC; $members = DB::query('SELECT name, score_individual, score_theme, email FROM individuals WHERE team=%i AND deleted="0" ORDER BY name', $team_id); if (count($members) == 0) { $body .= "\n\nNo Team Members\n"; } else { $body .= "\n\n[b]Individual Scores: Individual Round, Theme Round[/b]\n"; } foreach ($members as $member) { $name = htmlentities($member['name']); $score_individual = htmlentities($member['score_individual']); $score_theme = htmlentities($member['score_theme']); if (is_null($member['score_individual'])) { $score_individual = 'NONE'; } if (is_null($member['score_theme'])) { $score_theme = 'NONE'; } $indiv_msg = ''; if ($member['email'] != '') { $indiv_msg = ' (Unaffiliated Individual)'; } $body .= "{$name}{$indiv_msg}: {$score_individual}, {$score_theme}\n"; } $body .= "\n"; } while ($i + 1 < count($teams) && $teams[$i]['coach_email'] == $teams[$i + 1]['coach_email']); $body .= <<<HEREDOC You can also find useful things such as overall results, photos, and problems and solutions at [url]{$lmt_archive_url}[/url]. Finally, we'd love to hear from you! Any feedback at all about how we did this year and how we might improve for next year is greatly appreciated. Thanks for coming, and we hope to see you at LMT {$lmt_nextyear}! LHS Math Team Captains HEREDOC; if (array_key_exists('Send', $_POST) && $_POST['xsrf_token'] == $_SESSION['xsrf_token']) { echo $coach_email; $err = lmt_send_email($coach_email, "Scores!", $body); if ($err !== true) { alert($err, -1); return; } else { alert("Sent to {$coach_email}", 1); } } echo "<h2>{$coach_email}</h2><div style='border:solid 1px #000'>" . BBCode($body) . "</div>"; } echo " </div>"; }
function show_page() { global $javascript; $javascript = <<<HEREDOC function processKey(e, id) { if (null == e) e = window.event; if (e.keyCode == 13) { document.getElementById(id).click(); return false; } } HEREDOC; lmt_page_header('Status'); if (registration_is_open()) { $reg_status = 'Open'; $reg_action = 'lmt_close_reg'; $reg_action_name = 'Close'; } else { $reg_status = 'Closed'; $reg_action = 'lmt_open_reg'; $reg_action_name = 'Open'; } if (backstage_is_open()) { $backstage_status = 'Open'; $backstage_action = 'lmt_close_backstage'; $backstage_action_name = 'Close'; } else { $backstage_status = 'Closed'; $backstage_action = 'lmt_open_backstage'; $backstage_action_name = 'Open'; } if (scoring_is_enabled()) { $scoring_status = 'Enabled'; $scoring_action = 'lmt_freeze_scoring'; $scoring_action_name = 'Freeze'; } else { $scoring_status = 'Frozen'; $scoring_action = 'lmt_enable_scoring'; $scoring_action_name = 'Enable'; } $lmt_year = htmlentities(map_value('year')); $lmt_date = htmlentities(map_value('date')); $individual_cost = htmlentities(map_value('indiv_cost')); $team_cost = htmlentities(map_value('team_cost')); $backstage_message = htmlentities(map_value('backstage_message')); $reg_close = htmlentities(map_value('reg_close')); $num_coaches = DB::queryFirstField('SELECT COUNT(*) AS c FROM schools WHERE deleted="0"'); $num_teams = DB::queryFirstField('SELECT COUNT(*) AS c FROM teams WHERE deleted="0"'); $num_individuals = DB::queryFirstField('SELECT COUNT(*) AS c FROM individuals WHERE email <> "" AND deleted="0"'); echo <<<HEREDOC <h1>Status</h1> <h2>Settings</h2> <div class="indented"> <form method="post" action="{$_SERVER['REQUEST_URI']}"> <div><input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}" /></div> <table style='vertical-align:middle;'> <tr> <td>Registration:</td> <td><span class="b">{$reg_status}</span></td> <td><input type="submit" name="{$reg_action}" value="{$reg_action_name}" /></td> </tr><tr> <td>Backstage:</td> <td><span class="b">{$backstage_status}</span> <span class="small">to regular members</span></td> <td><input type="submit" name="{$backstage_action}" value="{$backstage_action_name}" /></td> </tr><tr> <td>Score Entry:</td> <td><span class="b">{$scoring_status}</span></td> <td><input type="submit" name="{$scoring_action}" value="{$scoring_action_name}" /></td> </tr><tr> <td>Date:</td> <td><input type="text" name="date" value="{$lmt_date}" size="25" onkeydown="return processKey(event, 'lmtChangeDate');" /> </td> <td><input id="lmtChangeDate" type="submit" name="lmt_update_date" value="Update" /></td> </tr><tr> <td>Year:</td> \t\t\t <td><input type="text" name="year" value="{$lmt_year}" size="4" maxlength="4" onkeydown="return processKey(event, 'lmtChangeYear');" /></td> <td><input id="lmtChangeYear" type="submit" name="lmt_update_year" value="Update" /><div style='color:red;font-size:0.6em;'>Use <a href='Post_LMT'>Post_LMT</a> directly after the LMT event ends.</div></td> </tr><tr> <td>Individual Cost:</td> <td><input type="text" name="indiv_cost" value="{$individual_cost}" size="25" onkeydown="return processKey(event, 'lmtChangeIndiv');" /></td> <td><input id="lmtChangeIndiv" type="submit" name="lmt_update_indiv_cost" value="Update" /></td> </tr><tr> <td>Team Cost:</td> <td><input type="text" name="team_cost" value="{$team_cost}" size="25" onkeydown="return processKey(event, 'lmtChangeTeam');" /></td> <td><input id="lmtChangeTeam" type="submit" name="lmt_update_team_cost" value="Update" /></td> </tr><tr> <td>Backstage Message: </td> <td><textarea name="backstage_message" rows="5" cols="20">{$backstage_message}</textarea></td> <td><input id="lmtBackstageMessage" type="submit" name="lmt_update_backstage_message" value="Update" /></td> </tr><tr> <td>Registration Closing Date:</td> <td><input type="text" name="reg_close" value="{$reg_close}" size="25" onkeydown="return processKey(event, 'lmtRegClose');" /></td> <td><input id="lmtRegClose" type="submit" name="lmt_update_reg_close" value="Update" /></td> </tr> </table> </form> </div> <br /> <h2>Statistics</h2> <div class="indented"> <span class="b">{$num_coaches}</span> coaches have registered a total of <span class="b">{$num_teams}</span> teams.<br /> <span class="b">{$num_individuals}</span> unaffiliated individuals have signed up. </div> HEREDOC; die; }
function process_form() { // INITIAL DATA FETCHING global $name, $email, $grade; // so that the show_form function can use these values later $name = htmlentities(ucwords(trim($_POST['name']))); $name = preg_replace('/\\s\\s+/', ' ', $name); $name = preg_replace('/\\-+/', '-', $name); $email = htmlentities($_POST['email']); $grade = $_POST['grade']; $name_msg = validate_name($name); if ($name_msg !== true) { show_form($name_msg, 'name'); } $grade_msg = validate_grade($grade); if ($grade_msg !== true) { show_form($grade_msg, 'grade'); } $recaptcha_msg = validate_recaptcha(); if ($recaptcha_msg !== true) { show_form($recaptcha_msg, 'recaptcha_response_field'); } $email_msg = validate_email($email); if ($email_msg !== true) { show_form($email_msg, 'email'); } // ** All information has been validated at this point ** // Create database entry DB::insert('individuals', array('name' => $name, 'grade' => $grade, 'email' => $email)); $id = DB::insertId(); //Get AUTO_INCREMENT id // Start outputting the top part of the page, to make it seem responsive while we send the email lmt_page_header('Individual Registration'); // Send the email $lmt_year = htmlentities(map_value('year')); $lmt_date = htmlentities(map_value('date')); $cost = htmlentities(map_value('indiv_cost')); $url = get_site_url() . '/LMT'; global $LMT_EMAIL; $subject = "LMT {$lmt_year} Registration Receipt"; $body = <<<HEREDOC Hi {$name}, You have successfully registered as an individual for LMT {$lmt_year}! [b]Please print out this email and bring it to the competition along with the registration fee of {$cost}[/b]. Date: [b]{$lmt_date}[/b] Location: Lexington High School [url]http://www.lhsmath.org/LMT/Location[/url] If you have any questions, please contact us at [email]{$LMT_EMAIL}[/email]. ______________________________________________________________ Registration: [b]Individual[/b] ID: [b]{$id}[/b] Name: [b]{$name}[/b] Email: [b]{$email}[/b] Grade: [b]{$grade}[/b] ______________________________________________________________ HEREDOC; lmt_send_email(array($email => $name), $subject, $body); // Show the post-registration message echo <<<HEREDOC <h1>Individual Registration</h1> <div class="text-centered"> You have successfully registered for LMT {$lmt_year}! An email has been sent with more information. </div> HEREDOC; }
function process_form() { // INITIAL DATA FETCHING global $school_name, $email; // so that the show_form function can use these values later $school_name = htmlentities(trim($_POST['school_name'])); $email = htmlentities($_POST['email']); $name_msg = validate_school_name($school_name); $recaptcha_msg = validate_recaptcha(); $email_msg = validate_coach_email($email); if ($name_msg !== true) { alert($name_msg, -1); } else { if ($recaptcha_msg !== true) { alert($recaptcha_msg, -1); } else { if ($email_msg !== true) { alert($email_msg, -1); } else { // ** All information has been validated at this point ** $access_code = generate_code(5); // Create database entry DB::insert('schools', array('name' => $school_name, 'coach_email' => $email, 'access_code' => $access_code)); // Get user id (MySQL AUTO_INCREMENT id) $id = DB::insertId(); global $LMT_EMAIL; $lmt_year = htmlentities(map_value('year')); $lmt_date = htmlentities(map_value('date')); // Send the email $url = get_site_url() . '/LMT/Registration/Signin?ID=' . $id . '&Code=' . $access_code; $subject = "LMT {$lmt_year} Account"; $body = <<<HEREDOC To: {$school_name} Thank you for registering your school for the LMT! The contest will be held on [b]{$lmt_date} [/b] at Lexington High School. You may register teams for LMT {$lmt_year} via the link below. This link will also enable you to modify teams as long as registration is open. [b][url]{$url} [/url][/b] If you have any questions, please contact us at [email]{$LMT_EMAIL} [/email]. HEREDOC; lmt_send_email(array($email => $school_name), $subject, $body); // Show the post-registration message echo <<<HEREDOC <h1>Coach Registration</h1> <div class="text-centered"> Your account was created. Please check your email inbox for a confirmation email. </div> HEREDOC; die; } } } }
function lmt_send_list_email($bcc_list, $subject, $bb_body, $list_id) { global $LMT_EMAIL; $site_url = str_replace(array('http://www.', 'http://'), '', get_site_url()); return send_email($bcc_list, $subject, $bb_body, array($LMT_EMAIL => 'LMT Contact'), '[LMT ' . intval(map_value('year')) . '] ', "\n\n\n---\nLexington Mathematics Tournament\n[url]" . get_site_url() . "/LMT[/url]\n\nYou received this email because you registered for the LMT. To unsubscribe, please contact [email]lmt@lhsmath.org.[/email]", array('Precedence' => 'bulk', 'List-Id' => '<' . $list_id . '.lmt.' . $site_url . '>', 'List-Unsubscribe' => '<mailto:webmaster@lhsmath.org>')); }
function show_add_page($err, $selected_field) { global $team_name, $members; $c = DB::queryFirstField('SELECT COUNT(*) FROM teams WHERE school=%i', $_SESSION['LMT_user_id']); $cancel_link = ''; if ($c != 0) { $cancel_link = "\n <a href=\"Home\">Cancel</a>"; } if ($err != '') { $err = "\n <div class=\"error\">{$err}</div><br />\n"; } $lmt_cost = htmlentities(map_value('team_cost')); $school_name = htmlentities($_SESSION['LMT_school_name']); lmt_page_header('Add Team'); echo <<<HEREDOC \t<script>document.forms['lmtRegAddTeam'].{$selected_field}.focus();</script> <h1>Add a Team</h1> <div class="instruction"> Team registration costs <span class="b">{$lmt_cost}</span>, paid at the competition.<br /> <br /> Please read the rules before registering teams. Though LMT is open to teams of 4, 5, or 6 competitors, we stress that a full team is one of 6 students. The option for smaller teams is intended for schools who may not be able to field full teams, but still have significant interest in the competition, or in case unexpected conflicts arise for individual members come competition day. Forming smaller teams is \t otherwise strongly discouraged.<br /> <br /> You may add, remove and edit teams until registration closes. </div> <br /><br /> {$err} <form id="lmtRegAddTeam" method="post" action="{$_SERVER['REQUEST_URI']}"> <table> <tr> <td>School:</td> <td><span class="b">{$school_name}</span><br><br></td> <td></td> </tr><tr> <td>Team Name: </td> <td> <input type="text" name="team_name" size="25" maxlength="25" value="{$team_name}" /> </td> <td></td> </tr><tr> <td>Members:</td> <td class="u">Name</td> <td class="u">Grade</td> </tr><tr> <td></td> <td><input type="text" name="name1" size="25" maxlength="25" value="{$members[1]['name']}" /></td> <td> <select name="grade1"> <option value="6"{$members[1]['6sel']}>Sixth</option> <option value="7"{$members[1]['7sel']}>Seventh</option> <option value="8"{$members[1]['8sel']}>Eighth</option> </select> </td> </tr><tr> <td></td> <td><input type="text" name="name2" size="25" maxlength="25" value="{$members[2]['name']}" /></td> <td> <select name="grade2"> <option value="6"{$members[2]['6sel']}>Sixth</option> <option value="7"{$members[2]['7sel']}>Seventh</option> <option value="8"{$members[2]['8sel']}>Eighth</option> </select> </td> </tr><tr> <td></td> <td><input type="text" name="name3" size="25" maxlength="25" value="{$members[3]['name']}" /></td> <td> <select name="grade3"> <option value="6"{$members[3]['6sel']}>Sixth</option> <option value="7"{$members[3]['7sel']}>Seventh</option> <option value="8"{$members[3]['8sel']}>Eighth</option> </select> </td> </tr><tr> <td></td> <td><input type="text" name="name4" size="25" maxlength="25" value="{$members[4]['name']}" /></td> <td> <select name="grade4"> <option value="6"{$members[4]['6sel']}>Sixth</option> <option value="7"{$members[4]['7sel']}>Seventh</option> <option value="8"{$members[4]['8sel']}>Eighth</option> </select> </td> </tr><tr> <td></td> <td><input type="text" name="name5" size="25" maxlength="25" value="{$members[5]['name']}" /></td> <td> <select name="grade5"> <option value="6"{$members[5]['6sel']}>Sixth</option> <option value="7"{$members[5]['7sel']}>Seventh</option> <option value="8"{$members[5]['8sel']}>Eighth</option> </select> </td> </tr><tr> <td></td> <td><input type="text" name="name6" size="25" maxlength="25" value="{$members[6]['name']}" /></td> <td> <select name="grade6"> <option value="6"{$members[6]['6sel']}>Sixth</option> <option value="7"{$members[6]['7sel']}>Seventh</option> <option value="8"{$members[6]['8sel']}>Eighth</option> </select> </td> </tr><tr> <td colspan="2"> <input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}" /> <input type="submit" name="lmt_do_reg_add" value="Add This Team" />{$cancel_link} </td> </tr> </table> </form> HEREDOC; die; }