require '../members/check.php'; ?>
Tiger Roar - Fantasy Baseball
|
Tiger Roar - Fantasy Baseball |
Weekly Standings
if (isset($_GET['week'])) { $week = $_GET['week']; } else { $week = ""; }
if (!preg_match("/^W[0-9]{1,2}$/", "$week")) { # No Week is selected
print "
\n";
print "Select a week:
\n";
include 'dropdownmenu.php';
print "\n";
print "
\n";
exit;
}
# Else, Week is selected
$week_YYYY = $week."_2024";
#print "$week_YYYY";
#include '../picks/weekswitch.php' or die ("Failed at line 47.");
include 'mysql_connect.php';
$link = mysql_connect ($db_hostname, $db_username, $db_password) or die ("Unable to connect to database.");
if (isset($_GET['start'])) { $start = $_GET['start']; }
else {
$start = 0;
}
$display = 1000;
$next = $start + $display;
$i = $start + 1;
$query = "SELECT * FROM $week_YYYY ORDER BY total desc, time asc limit $start,$display";
$result = mysql_db_query ($db_name, $query, $link);
if(@mysql_query($query)) {
$number_of_members = mysql_numrows($result);
}
if($number_of_members !="") {
$active_query = "SELECT * FROM this_week";
$active_result = mysql_db_query ($db_name, $active_query, $link);
$active_members = mysql_numrows($active_result);
print "\n";
print "
\n";
print "$week_selection
\n";
include 'dropdownmenu.php';
print "\n";
//Top Info Section
if ($active_members >= $next) {
#print "Showing $start - $next Next page\n";
}
else {
#print "Showing $start - $active_members\n";
}
print "*** Wins by first tiebreaker\n";
print "
\n";
print "\n";
//Table
print "\n";
print "\n";
print " | \n";
print "Member | \n";
print "Player 1 | \n";
print "Score | \n";
print "Player 2 | \n";
print "Score | \n";
print "Player 3 | \n";
print "Score | \n";
print "Player 4 | \n";
print "Score | \n";
print "Total | \n";
print "
\n";
//Get results from database
while ($Row = mysql_fetch_array ($result)) {
print "\n";
print "$i | \n";
print "$Row[login] | \n";
print "$Row[player1] | \n";
print "$Row[score1] | \n";
print "$Row[player2] | \n";
print "$Row[score2] | \n";
print "$Row[player3] | \n";
print "$Row[score3] | \n";
print "$Row[player4] | \n";
print "$Row[score4] | \n";
print "$Row[total] | \n";
$i++;
}
print "
\n";
print "
\n";
mysql_close ($link);
if ($active_members >= $next) {
#print "Showing $start - $next Next page\n";
}
else {
#print "Showing $start - $active_members\n";
}
exit;
}
else {
print "\n";
print "
\n";
print "$week_selection
\n";
include 'dropdownmenu.php';
print "\n";
print "
This week has not been played yet
";
exit;
}
?>