";
$leseason = intval($_COOKIE["TeamRecordReportSeason"]);
$ledivision = intval($_COOKIE["TeamRecordReportDivision"]);
//$lecategory = intval($_COOKIE["TeamRecordReportCategory"]);
$lecompetition = $_COOKIE["TeamRecordReportCompetition"];
//$letier = intval($_COOKIE["TeamRecordReportTier"]);
$equipechoisie = intval($_COOKIE["TeamRecordReportTeam"]);
}//
if($leseason <= 0){
$leseason = getCurrentSeason();
}
// category and tier are not saved in the cookie as they can't be changed on this screen. The values can be passed into this screen.
// if we ever add those values to the screen then we can uncomment those lines.
setcookie("TeamRecordReportSeason", $leseason);
setcookie("TeamRecordReportDivision", $ledivision);
//setcookie("TeamRecordReportCategory", $lecategory);
setcookie("TeamRecordReportCompetition", $lecompetition);
//setcookie("TeamRecordReportTier", $letier);
setcookie("TeamRecordReportTeam", $equipechoisie);
//print "Season ".$_COOKIE["TeamRecordReportSeason"]."
";
//print "Division ".$_COOKIE["TeamRecordReportDivision"]."
";
//print "Category ".$_COOKIE["TeamRecordReportCategory"]."
";
//print "Competition ".$_COOKIE["TeamRecordReportCompetition"]."
";
//print "Team ".$_COOKIE["TeamRecordReportTeam"]."
";
$competewhere = "";
if(($lecategory > 0)){
$competewhere .= " AND gameschedule.categoryid = $lecategory";
}//
if(($letier > 0)){
$competewhere .= " AND gameschedule.groupid = $letier";
}//
$equipechoisie = intval($equipechoisie);
$sqlcn = pconnectDBr();
$sql = "SELECT gameschedule.gameid
, gameschedule.date
, gameschedule.homeid
, gameschedule.visitorid
, gamesheet.homescore
, gamesheet.homewin
, gamesheet.homelose
, gamesheet.hometie
, gamesheet.visitorscore
, gamesheet.visitorwin
, gamesheet.visitorlose
, gamesheet.visitortie
, gamesheet.homesportmanship
, gamesheet.visitorsportmanship
, gamesheet.dataverified
, gamesheet.homeforfeit
, gamesheet.visitorforfeit
FROM gamesheet
INNER JOIN gameschedule ON (gamesheet.seasonid = gameschedule.seasonid AND gamesheet.gameid = gameschedule.gameid)
WHERE (gameschedule.homeid = $equipechoisie OR gameschedule.visitorid = $equipechoisie)
AND gameschedule.seasonid = $leseason
AND gameschedule.divisionid = $ledivision
AND gameschedule.competitionid = $lecompetition
$competewhere
ORDER BY gameschedule.date, gameschedule.gameid ASC";
//print"$sql
";
$sqlresult = mysqli_query($sqlcn, $sql);
if(($sqlresult == true)&&(mysqli_num_rows($sqlresult) != 0)){
$totalrecords = mysqli_num_rows($sqlresult);
} else {
$totalrecords = 0;
}//sqlresult = good
?>