include("header.php"); ?>
Game Schedules
Season*
Division*
Category*
Competition*
Group
-- Select Season--
$sql = "SELECT distinct seasons.seasonid , seasons.season FROM seasons INNER JOIN gameschedule ON seasons.seasonid = gameschedule.seasonid ORDER BY seasonid"; if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ while($sqlrow = mysqli_fetch_array($sqlresult)){ if(intval($leseason) == $sqlrow[seasonid]){ ?>
= $sqlrow[season] ?>
} else { ?>
= $sqlrow[season] ?>
}//end if }//end loop mysqli_free_result($sqlresult); } } ?>
//print "Season SQL: $sql
";?>
-- Select Divisions --
$sql = "SELECT DISTINCT divisions.divisionid , divisions.name FROM divisions INNER JOIN gameschedule ON divisions.divisionid = gameschedule.divisionid WHERE gameschedule.seasonid = $leseason ORDER BY divisions.startage;"; if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ while($sqlrow = mysqli_fetch_array($sqlresult)){ if(intval($ledivision) == $sqlrow[divisionid]){ ?>
= $sqlrow[name] ?>
} else { ?>
= $sqlrow[name] ?>
}//end if }//end loop mysqli_free_result($sqlresult); } } ?>
//print "Divisions SQL: $sql
"; ?>
-- Select Category--
$sql = "SELECT DISTINCT categories.categoryid AS categoryid , categories.category AS category FROM categories INNER JOIN gameschedule ON categories.categoryid = gameschedule.categoryid WHERE gameschedule.divisionid = $ledivision AND gameschedule.seasonid = $leseason ORDER BY categories.category;"; if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ while($sqlrow = mysqli_fetch_array($sqlresult)){ if(intval($lecategory) == $sqlrow[categoryid]){ ?>
= $sqlrow[category] ?>
} else { ?>
= $sqlrow[category] ?>
}//end if }//end loop mysqli_free_result($sqlresult); } } ?>
//print "Category SQL: $sql
"; ?>
-- Select Competition--
$sql = "SELECT DISTINCT competition.competitionid , competition.competition FROM competition INNER JOIN gameschedule ON competition.competitionid = gameschedule.competitionid WHERE gameschedule.categoryid = $lecategory AND gameschedule.divisionid = $ledivision AND gameschedule.seasonid = $leseason ORDER BY competition.competition;"; if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ while($sqlrow = mysqli_fetch_array($sqlresult)){ if(intval($lecompetition) == $sqlrow[competitionid]){ ?>
= $sqlrow[competition] ?>
} else { ?>
= $sqlrow[competition] ?>
}//end if }//end loop mysqli_free_result($sqlresult); } } ?>
//print "Competition SQL: $sql
"; ?>
-- All Groups --
$sql = "SELECT DISTINCT tiers.tierid , tiers.tier FROM tiers INNER JOIN gameschedule ON tiers.tierid = gameschedule.groupid WHERE gameschedule.divisionid = $ledivision AND gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason ORDER BY tiers.tier;"; if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ while($sqlrow = mysqli_fetch_array($sqlresult)){ if(intval($letier) == $sqlrow[tierid]){ ?>
= $sqlrow[tier] ?>
} else { ?>
= $sqlrow[tier] ?>
}//end if }//end loop mysqli_free_result($sqlresult); } } ?>
//print "Tiers SQL: $sql
"; ?>
Team
Sort Sequence*
-- All Teams --
$callteam = "theid"; $callteamname = "thename"; $recordsadded = array(); $records = array(); $x = 0; if($letier > 0){ $sql = "SELECT DISTINCT teams.teamid , teams.name , gameschedule.divisionid FROM teams INNER JOIN gameschedule ON teams.teamid = gameschedule.homeid WHERE gameschedule.divisionid = $ledivision AND gameschedule.groupid = $letier AND gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason ORDER BY teams.name;"; } else { $sql = "SELECT DISTINCT teams.teamid , teams.name , gameschedule.divisionid FROM teams INNER JOIN gameschedule ON teams.teamid = gameschedule.homeid WHERE gameschedule.divisionid = $ledivision AND gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason ORDER BY teams.name;"; } if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ while($sqlrow = mysqli_fetch_array($sqlresult)){ if(array_search($sqlrow["teamid"], $recordsadded) === false){ $recordsadded[] = $sqlrow["teamid"]; $records[$x]["theid"] = $sqlrow["teamid"]; $records[$x]["thename"] = $sqlrow["name"]; $records[$x]["thedivision"] = $sqlrow["divisionid"]; $x++; }// }// @mysqli_free_result($sqlresult); } }// //NEXT if($letier > 0){ $sql = "SELECT DISTINCT teams.teamid , teams.name , gameschedule.divisionid FROM teams INNER JOIN gameschedule ON teams.teamid = gameschedule.visitorid WHERE gameschedule.divisionid = $ledivision AND gameschedule.groupid = $letier AND gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason ORDER BY teams.name;"; } else { $sql = "SELECT DISTINCT teams.teamid , teams.name , gameschedule.divisionid FROM teams INNER JOIN gameschedule ON teams.teamid = gameschedule.visitorid WHERE gameschedule.divisionid = $ledivision AND gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason ORDER BY teams.name;"; } if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ while($sqlrow = mysqli_fetch_array($sqlresult)){ if(array_search($sqlrow["teamid"], $recordsadded) === false){ $recordsadded[] = $sqlrow["teamid"]; $records[$x]["theid"] = $sqlrow["teamid"]; $records[$x]["thename"] = $sqlrow["name"]; $records[$x]["thedivision"] = $sqlrow["divisionid"]; $x++; }// }// @mysqli_free_result($sqlresult); } }// //SORT if(count($records) > 0){ foreach($records as $key => $row){ $theid[$key] = $row['theid']; $thename[$key] = $row['thename']; $thedivision[$key] = $row['thedivision']; }// array_multisort($thename, SORT_ASC, $records); }//COUNT RECORDS for($y = 0; $y < count($records); $y++){ if(intval($leteam) == $records[$y][$callteam]){ ?>
= $records[$y][$callteamname] ?>
} else { ?>
= $records[$y][$callteamname] ?>
}//end if }//end loop ?>
//print "Teams SQL: $sql
"; ?>
>In Date/Time and then Game ID Order
>In Game ID Order
$leid = -1; $hasrecords = false; $leteam = intval($leteam); $letier = intval($letier); $previousSeries = ''; if($sortOrder == 1){ $orderBy = 'ORDER BY gameschedule.series, gameschedule.date, gameschedule.starttime, gameschedule.gameid'; } else { $orderBy = 'ORDER BY gameschedule.series, gameschedule.gameid'; } if(($leteam != -1)&&($letier != -1)){ //print "1
"; $sql = "SELECT gameschedule.gameid , gameschedule.groupid , gameschedule.series , gameschedule.homeid , gameschedule.visitorid , gameschedule.date , gameschedule.location , gameschedule.starttime , gameschedule.endtime , gameschedule.status , gameschedule.comments FROM gameschedule WHERE gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason AND gameschedule.divisionid = $ledivision AND gameschedule.groupid = $letier AND (gameschedule.homeid = $leteam OR gameschedule.visitorid = $leteam) $orderBy"; } else if (($leteam == -1)&&($letier != -1)){ //print "2
"; $sql = "SELECT gameschedule.gameid , gameschedule.groupid , gameschedule.series , gameschedule.homeid , gameschedule.visitorid , gameschedule.date , gameschedule.location , gameschedule.starttime , gameschedule.endtime , gameschedule.status , gameschedule.comments FROM gameschedule WHERE gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason AND gameschedule.divisionid = $ledivision AND gameschedule.groupid = $letier $orderBy"; } else if (($leteam != -1)&&($letier == -1)){ //print "3
"; $sql = "SELECT gameschedule.gameid , gameschedule.groupid , gameschedule.series , gameschedule.homeid , gameschedule.visitorid , gameschedule.date , gameschedule.location , gameschedule.starttime , gameschedule.endtime , gameschedule.status , gameschedule.comments FROM gameschedule WHERE gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason AND gameschedule.divisionid = $ledivision AND (gameschedule.homeid = $leteam OR gameschedule.visitorid = $leteam) $orderBy"; } else { //print "4
"; $sql = "SELECT gameschedule.gameid , gameschedule.groupid , gameschedule.series , gameschedule.homeid , gameschedule.visitorid , gameschedule.date , gameschedule.location , gameschedule.starttime , gameschedule.endtime , gameschedule.status , gameschedule.comments FROM gameschedule WHERE gameschedule.categoryid = $lecategory AND gameschedule.competitionid = $lecompetition AND gameschedule.seasonid = $leseason AND gameschedule.divisionid = $ledivision $orderBy"; }//end if //print "$sql
"; if($sqlcn){ $sqlresult = mysqli_query($sqlcn, $sql); if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){ $hasrecords = true; $zo = 0; }// }// ?> if($hasrecords == false){ ?>
There Are No Games Scheduled for this Filtered Selection
} else { ?>
Date & Time Subject To Change Without Notice. Please Confirm With Your Team Manager.
Season:
= getSeasonName($leseason) ?>
Division:
= ($ledivision == -1)?"All Divisions":getDivisionName($ledivision) ?>
Group:
= ($letier == -1)?"All Groups":getTierName($letier) ?>
Competition:
= getCompetitionName($lecompetition) ?>
Category:
= getCategoryName($lecategory) ?>
Date:
= date("F j, Y") ?>
Game ID
Group
Home
Visitor
Date
Location
Start Time
End Time
Status
Remarks
while($sqlrow = mysqli_fetch_array($sqlresult)){ if (($sqlrow[series] > '') && ($sqlrow[series] != $previousSeries) && ($letier != -1)&& ($leteam == -1)){ ?>
= $sqlrow[series] ?>
} ?>
= $sqlrow[gameid] ?>
= getTierName($sqlrow[groupid]) ?>= ($sqlrow[series] == "")?"":" - ".$sqlrow[series] ?>
print "
"; } else { print ">"; } print (getTeamName($sqlrow["homeid"])); print "
\n"; ?>
print "
"; } else { print ">"; } print (getTeamName($sqlrow["visitorid"])); print "
\n"; ?>
= ($sqlrow[date] == "")?" ":date("D M j, Y", strtotime($sqlrow[date])) ?>
= ($sqlrow[location] == "")?" ":$sqlrow[location] ?>
= ($sqlrow[starttime] == "")?" ":$sqlrow[starttime] ?>
= ($sqlrow[endtime] == "")?" ":$sqlrow[endtime] ?>
= ($sqlrow[status] == "")?" ":$sqlrow[status] ?>
= ($sqlrow[comments] == "")?" ":$sqlrow[comments] ?>
$previousSeries = $sqlrow[series]; }//end loop ?>
} ?>