function medalList($event) { $def1 = ""; $def2 = ""; $def4 = array("", ""); $def8 = array("", "", "", ""); $finalists = $event->getFinalists(); $t4used = 0; $t8used = 0; foreach ($finalists as $finalist) { if ($finalist['medal'] == '1st') { $def1 = $finalist['player']; } elseif ($finalist['medal'] == '2nd') { $def2 = $finalist['player']; } elseif ($finalist['medal'] == 't4') { $def4[$t4used++] = $finalist['player']; } elseif ($finalist['medal'] == 't8') { $def8[$t8used++] = $finalist['player']; } } echo "<tr><td colspan=\"2\">"; echo "<input type=\"hidden\" name=\"view\" value=\"reg\">"; echo "<table align=\"center\" style=\"border-width: 0px;\">"; echo "<tr><td align=\"center\" colspan=\"2\"><b>Medals</td></tr>"; echo "<tr><td colspan=\"2\" width=200> </td></tr>"; echo "<tr><td align=\"center\"><b>Medal</td>"; echo "<td align=\"center\"><b>Player</td></tr>"; echo "<tr><td align=\"center\">"; echo "<img src=\"/images/1st.gif\"></td>"; echo "<td align=\"center\">"; playerDropMenu($event, "1", $def1); echo "</td></tr>"; echo "<tr><td align=\"center\">"; echo "<img src=\"/images/2nd.gif\"></td>"; echo "<td align=\"center\">"; playerDropMenu($event, "2", $def2); echo "</td></tr>"; for ($i = 3; $i < 5; $i++) { echo "<tr><td align=\"center\">"; echo "<img src=\"/images/t4.gif\"></td>"; echo "<td align=\"center\">"; playerDropMenu($event, "{$i}", $def4[$i - 3]); echo "</td></tr>"; } for ($i = 5; $i < 9; $i++) { echo "<tr><td align=\"center\">"; echo "<img src=\"/images/t8.gif\"></td>"; echo "<td align=\"center\">"; playerDropMenu($event, "{$i}", $def8[$i - 5]); echo "</td></tr>"; } echo "<tr><td> </td></tr>"; echo "<tr><td colspan=\"2\" align=\"center\">"; echo "<input type=\"submit\" name=\"mode\" value=\"Update Medals\">"; echo "</td></tr>"; echo "</table>"; echo "</td></tr>"; }
function medalList($event) { $def1 = ""; $def2 = ""; $def4 = array("", ""); $def8 = array("", "", "", ""); $finalists = $event->getFinalists(); $t4used = 0; $t8used = 0; foreach ($finalists as $finalist) { if ($finalist['medal'] == '1st') { $def1 = $finalist['player']; } elseif ($finalist['medal'] == '2nd') { $def2 = $finalist['player']; } elseif ($finalist['medal'] == 't4') { $def4[$t4used++] = $finalist['player']; } elseif ($finalist['medal'] == 't8') { $def8[$t8used++] = $finalist['player']; } } // Start a new form echo "<form action=\"event.php\" method=\"post\" "; echo "enctype=\"multipart/form-data\">"; echo "<input type=\"hidden\" name=\"name\" value=\"" . htmlentities($event->name) . "\">"; echo "<table style=\"border-width: 0px\" align=\"center\">"; echo "<tr><td colspan=\"2\">"; echo "<input type=\"hidden\" name=\"view\" value=\"reg\">"; echo "<table align=\"center\" style=\"border-width: 0px;\">"; echo "<tr><td align=\"center\" colspan=\"2\"><b>Medals</td></tr>"; echo "<tr><td colspan=\"2\" width=200> </td></tr>"; echo "<tr><td align=\"center\"><b>Medal</td>"; echo "<td align=\"center\"><b>Player</td></tr>"; echo "<tr><td align=\"center\">"; echo image_tag("1st.png") . "</td>"; echo "<td align=\"center\">"; playerDropMenu($event, "1", $def1); echo "</td></tr>"; echo "<tr><td align=\"center\">"; echo image_tag("2nd.png") . "</td>"; echo "<td align=\"center\">"; playerDropMenu($event, "2", $def2); echo "</td></tr>"; for ($i = 3; $i < 5; $i++) { echo "<tr><td align=\"center\">"; echo image_tag("t4.png") . "</td>"; echo "<td align=\"center\">"; playerDropMenu($event, "{$i}", $def4[$i - 3]); echo "</td></tr>"; } for ($i = 5; $i < 9; $i++) { echo "<tr><td align=\"center\">"; echo image_tag("t8.png") . "</td>"; echo "<td align=\"center\">"; playerDropMenu($event, "{$i}", $def8[$i - 5]); echo "</td></tr>"; } echo "<tr><td> </td></tr>"; echo "<tr><td colspan=\"2\" align=\"center\">"; echo "<input type=\"submit\" name=\"mode\" value=\"Update Medals\">"; echo "</form>"; echo "</td></tr>"; echo "</table>"; echo "</td></tr>"; echo "</table>"; }