include 'dbc.php';
include 'gt.php';
set_time_limit(0);
$game_n = "SELECT * FROM Schedule WHERE Complete = 'Yes' AND Season = $SeasonNumber AND GameType = '$SeasonType' AND Level = 1 ORDER BY GameDay DESC LIMIT 1";
$gn = mysql_fetch_array(mysql_query($game_n,$connection));
// $show = "SELECT * FROM TJHLPageDisplay";
// $sr = mysql_fetch_array(mysql_query($show,$connection));
$show2 = "SELECT * FROM LeagueData WHERE League = 'TJHL'";
$lb = mysql_fetch_array(mysql_query($show2,$connection));
$ArtApp = $sr["ArtApp"]; // 1 = show, 0 = don't show
$vw = "= $timenow";
$waivnum = mysql_num_rows(mysql_query($query,$connection));
if ($waivnum > 0)
{
$waivers = mysql_query($query,$connection);
while ($row = mysql_fetch_array($waivers))
{
$WaiverText .= $vw . $row["PlayerID"] . ">";
$pid = $row["PlayerID"];
$query = "SELECT * FROM Players WHERE PlayerID = $pid";
$pres = mysql_fetch_array(mysql_query($query,$connection));
if ($row["CurrentWinner"] > 0)
{
$CurWin = $row["CurrentWinner"];
$query = "SELECT * FROM Teams WHERE TeamNum = $CurWin";
$tcwres = mysql_fetch_array(mysql_query($query,$connection));
$CurrentWinner = $tcwres["Short"] . " made claim -";
}
else
{
$CurrentWinner = "";
}
$WaiverText .= $pres["FirstName"] . " " . $pres["LastName"] . " - $CurrentWinner clears waivers on " . $row["EndTime"] . ". ";
}
}
if ($WaiverText == "") {$WaivApp = 0;}
else {$WaivApp = 1;}
$ArticleSubject = $sr["ArticleSubject"];
$ArticleText = $sr["ArticleText"];
// getting today's game day results
$query = "SELECT * FROM Schedule WHERE GameDay = $TodaysGameDay AND GameType = '$GameTypeToday' AND Season = $SeasonNum AND Level = 1";
$res = mysql_query($query,$connection);
$GameResults = "";
while ($r = @mysql_fetch_array($res))
{
$GameNum = $r["GameNum"];
$AwayTeam = $r["Away"];
$AwayScore = $r["AwayScore"];
$HomeTeam = $r["Home"];
$HomeScore = $r["HomeScore"];
$query = "SELECT * FROM Teams WHERE TeamNum = $AwayTeam";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$AwayTeam = $res2["City"];
$query = "SELECT * FROM Teams WHERE TeamNum = $HomeTeam";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$HomeTeam = $res2["City"];
$query = "SELECT * FROM GameResults WHERE GameNum = $GameNum AND Season = $SeasonNum AND Level = 1 AND Type = '$GameTypeToday'";
$res3 = @mysql_fetch_array(mysql_query($query,$connection));
$OT = $res3["OT"];
if ($OT == 0) {$OTText = "";}
else if ($OT == 1) {$OTText = " OT";}
else if ($OT > 1) {$OTText = " " . $OT . "OT";}
if ($res2["Level"] != 3)
{
$GameResults .= $AwayTeam . " " . $AwayScore . " @ " . $HomeTeam . " " . $HomeScore . $OTText . " More ";
}
else if ($res2["Level"] == 3)
{
$GameResults .= $AwayTeam . " " . $AwayScore . " @ " . $HomeTeam . " " . $HomeScore . $OTText . " More ";
}
}
if ($GameResults != NULL){
$GameResults .= 'All Games Summary ';
}
// getting next game day results
function OddRun($Low, $High){
// $OddTotal = $Low + $High;
for ($i = $Low; $i > 0; $i--){
$Factor = $High % $i;
if ($Factor == 0){
$Factor2 = $Low % $i;
if ($Factor2 == 0){
return $i;
}
}
}
}
$query = "SELECT * FROM Schedule WHERE GameDay = $NextGameDay AND GameType = '$GameTypeNext' AND Season = $SeasonNum AND Level = 1";
$resnum = @mysql_num_rows(mysql_query($query,$connection));
if ($resnum > 0) {$res = mysql_query($query,$connection); $NextGames = "";}
else {$NextGames = "no games scheduled";}
if ($resnum > 0)
{
while ($r = @mysql_fetch_array($res))
{
$AwayTeamNum = $r["Away"];
$HomeTeamNum = $r["Home"];
$query = "SELECT * FROM Teams WHERE TeamNum = $AwayTeamNum";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$AwayTeam = $res2["City"];
$AwayShort = $res2["Short"];
$query = "SELECT * FROM Teams WHERE TeamNum = $HomeTeamNum";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$HomeTeam = $res2["City"];
$HomeShort = $res2["Short"];
// print $AwayTeam . " " . $AwayShort . " ";
$query = "SELECT * FROM TeamStandings WHERE Level = 1 AND Team = $AwayTeamNum AND Season = $SeasonNum AND Type = '$SeasonType' ";
$Aquery = mysql_query($query,$connection);
$res2 = @mysql_fetch_array($Aquery);
$Pquery = "SELECT AVG(Total) FROM Players WHERE Level = 1 AND Team = $AwayTeamNum";
$P_query = mysql_query($Pquery,$connection);
$P_res = @mysql_fetch_array($P_query);
$AwayAverage = $P_res["AVG(Total)"];
$AwayBase = round($res2["Pct"]*10);
$AwaySpTeam = ((($res2["PPPct"] + $res2["PKPct"]) * 10) - 10) * 1.5;
if ($res2["GP"] == 0){
$AwayGD = 0;
} else {
$AwayGD = (($res2["GF"] - $res2["GA"])/$res2["GP"] * .5);
}
$AwayTotal = round((($AwayBase + $AwaySPTeam + $AwayGD) * $AwayAverage / 100)+($AwayAverage / 3.5));
if ($AwayTotal < 1){
$AwayTotal = 1;
}
// print $AwayBase . " - " . $AwaySpTeam . " - " . $AwayGD . ": " . $AwayTotal . " ";
$query = "SELECT * FROM TeamStandings WHERE Level = 1 AND Team = $HomeTeamNum AND Season = $SeasonNum AND Type = '$SeasonType' ";
$Aquery = mysql_query($query,$connection);
$res2 = @mysql_fetch_array($Aquery);
$Pquery = "SELECT AVG(Total) FROM Players WHERE Level = 1 AND Team = $HomeTeamNum";
$P_query = mysql_query($Pquery,$connection);
$P_res = @mysql_fetch_array($P_query);
$HomeAverage = $P_res["AVG(Total)"];
$HomeBase = round($res2["Pct"]*11);
$HomeSpTeam = ((($res2["PPPct"] + $res2["PKPct"]) * 10) - 10) * 1.5;
if ($res2["GP"] == 0){
$HomeGD = 0;
} else {
$HomeGD = (($res2["GF"] - $res2["GA"])/$res2["GP"] *.5);
}
$HomeTotal = round((($HomeBase + $HomeSPTeam + $HomeGD) * $HomeAverage / 100)+($HomeAverage / 3.5));
if ($HomeTotal < 1){
$HomeTotal = 1;
}
// print $HomeBase . " - " . $HomeSpTeam . " - " . $HomeGD . ": " . $HomeTotal . " ";
if ($AwayTotal == $HomeTotal) {
$Odds = "(+100 " . $HomeShort . ")";
} else if ($AwayTotal > $HomeTotal){
$Factor = OddRun($HomeTotal, $AwayTotal);
// print $Factor;
$TempAway = $AwayTotal / $Factor;
$TempHome = $HomeTotal / $Factor;
$TempTotal = round(-10/($HomeTotal/$AwayTotal))*10;
$Odds = '(' . $TempTotal . ' ' . $AwayShort . ')';
} else if ($HomeTotal > $AwayTotal){
$Factor = OddRun($AwayTotal, $HomeTotal);
// print $Factor;
$TempAway = $AwayTotal / $Factor;
$TempHome = $HomeTotal / $Factor;
// $TempTotal = ($HomeTotal+$AwayTotal) / $Factor;
// $Odds = '(' . $TempAway . ':' . $TempHome . ' ' . $HomeShort . ')';
$TempTotal = round(-10/($AwayTotal/$HomeTotal))*10;
$Odds = '(' . $TempTotal . ' ' . $HomeShort . ')';
}
$NextGames .= $AwayTeam . " @ " . $HomeTeam . " " . $Odds ." ";
}
}
else
{
$NextGames = $NextGameDayText;
}
include 'dbc.php';
function text_number($n)
{
// Array holding the teen numbers. If the last 2 numbers of $n are in this array, then we'll add 'th' to the end of $n
$teen_array = array(11, 12, 13, 14, 15, 16, 17, 18, 19);
// Array holding all the single digit numbers. If the last number of $n, or if $n itself, is a key in this array, then we'll add that key's value to the end of $n
$single_array = array(1 => 'st', 2 => 'nd', 3 => 'rd', 4 => 'th', 5 => 'th', 6 => 'th', 7 => 'th', 8 => 'th', 9 => 'th', 0 => 'th');
// Store the last 2 digits of $n in order to check if it's a teen number.
$if_teen = substr($n, -2, 2);
// Store the last digit of $n in order to check if it's a teen number. If $n is a single digit, $single will simply equal $n.
$single = substr($n, -1, 1);
// If $if_teen is in array $teen_array, store $n with 'th' concantenated onto the end of it into $new_n
if ( in_array($if_teen, $teen_array) )
{
$new_n = $n . 'th';
}
// $n is not a teen, so concant the appropriate value of it's $single_array key onto the end of $n and save it into $new_n
elseif ( $single_array[$single] )
{
$new_n = $n . $single_array[$single];
}
// Return new
return $new_n;
}
$ShowArticle = $_GET["ShowArticle"];
$ShowScores = $_GET["ShowScores"];
$ShowDisabled = $_GET["ShowDisabled"];
$ShowTwitter = $_GET["ShowTwitter"];
$ShowWaivers = $_GET["ShowWaivers"];
$ShowRecentTransa = $_GET["ShowRecentTransa"];
$ShowAll = $_GET["ShowAll"];
if ($ShowArticle == "")
{
$ShowArticle = 0;
}
if ($ShowScores == "")
{
$ShowScores = 0;
}
if ($ShowTwitter == "")
{
$ShowTwitter = 0;
}
if ($ShowDisabled == "")
{
$ShowDisabled = 0;
}
if ($ShowWaivers == "")
{
$ShowWaivers = 0;
}
if ($ShowRecentTransa == "")
{
$ShowRecentTransa = 0;
}
if ($ShowAll == 1)
{
$ShowArticle = 1;
$ShowScores = 1;
$ShowTwitter = 1;
$ShowDisabled = 1;
$ShowWaivers = 1;
$ShowRecentTransa = 1;
}
// Modified October 8, 2015 to add new ticker.
print '
Main Page
';
/*print '
";
*/
print '';
// ';
print '';
print '
LEAGUE BULLETINS -
Show All
';
print '
';
include '/home/jonlau/tjhl.hockeysim.ca/Ticker.php';
print "
$LeagueBulletins
";
print " ";
// Scores Re-Added November 22, 2007
print "
";
/**** Temporary added.
if ($ShowScores == 1)
{
print "
WHO'S HOT? & WHO'S NOT! -
Hide - More
";
// added code by Jon, Nov 9, 2007
$i = 0;
$query99 = "SELECT * FROM Players WHERE Position != 'G' ";
$result99 = mysql_query ($query99, $connection);
while ($row99 = mysql_fetch_array ($result99)){
$PID = $row99["PlayerID"];
$MajNum = 0;
$PIM = 0;
$Assists = 0;
$PlusMinus = 0;
$Goals = 0;
$Games = 0;
$Streaks = 0;
$querystreak = "SELECT PStrk FROM PlayerStats WHERE PlayerID = ".$PID." AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." AND Level = 1 AND PStrk > 0";
// print $querystreak;
$qresult = mysql_query($querystreak,$connection);
while ($qstreak = mysql_fetch_array ($qresult)){
$Streaks = $qstreak["PStrk"];
if ($Streaks == 0){
$Streaks = 3;
}
// print $Streaks;
}
$query = "SELECT
MajorPenTaken AS MajNum,
PIM AS PIM,
A AS A,
PlsMns AS PlsMns,
G AS G,
GP AS GP
FROM PlayerGameStats WHERE PlayerID = ".$PID." AND Level = 1 AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." ORDER BY GameNum DESC LIMIT ". $Streaks;
$player_result = mysql_query ($query, $connection);
while ($row_p = mysql_fetch_array ($player_result)){
$MajNum +=$row_p["MajNum"];
$PIM += $row_p["PIM"];
$Assists += $row_p["A"];
$PlusMinus += $row_p["PlsMns"];
$Goals += $row_p["G"];
$Games += $row_p["GP"];
}
$tally = 0;
if ($Games > 0){
$tally = (($Goals*2)+($Assists)*1.5);
$PIMCheck = $PIM;
if ($PIMCheck > 9.9){
$tally += ($PIMCheck * -1);
}
$MajCheck = $row_p["MajNum"];
if ($MajCheck > 0.9){
$tally += ($MajCheck * -3);
}
$tally += ($PlusMinus*1.75);
$PID_ar[$i] = $PID;
$Score[$i] = $tally;
$ScoreCheck[$i] = $Score[$i];
// print $PID_ar[$i] . " -> " . $Score[$i] . " = " .$ScoreCheck[$i] . " ";
$i++;
}
}
$query999 = "SELECT * FROM Players";
$result999 = mysql_query ($query999, $connection);
while ($row999 = mysql_fetch_array ($result999)){
$PID = $row999["PlayerID"];
$MajNum = 0;
$PIM = 0;
$Minutes = 0;
$ShotsAgainst = 0;
$GoalsAgainst = 0;
$Games = 0;
$ShutOuts = 0;
$query = "SELECT
MajorPenTaken AS MajNum,
GP AS GP,
Minutes AS Minutes,
SA AS SA,
PIM AS PIM,
GA AS GA,
SO AS SO
FROM GoalieGameStats WHERE PlayerID = ".$PID." AND Level = 1 AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." ORDER BY GameNum DESC LIMIT 3";
$goalie_result = mysql_query ($query, $connection);
while ($row_g = mysql_fetch_array ($goalie_result)){
$MajNum += $row_g["MajNum"];
$PIM += $row_g["PIM"];
$Minutes += $row_g["Minutes"];
$ShotsAgainst += $row_g["SA"];
$GoalsAgainst += $row_g["GA"];
$Games += $row_g["GP"];
$ShutOuts += $row_g["SO"];
}
$tally = 0;
if (($Minutes > 0)&&($Games > 0)){
$tally = 3.5 - ($GoalsAgainst / ($Minutes/60));
$tally *= 2.5;
if ($ShotsAgainst > 0){
$SPC = (($ShotsAgainst - $GoalsAgainst) / $ShotsAgainst) * 10;
$tally += (($SPC - 8.5) * 3.5);
}
$PIMCheck = $PIM;
if ($PIMCheck > 9.9){
$tally += ($PIMCheck * -1);
}
$MajCheck = $MajNum;
if ($MajCheck > 0.9){
$tally += ($MajCheck * -3);
}
$tally += ($ShutOuts*6);
if ($Minutes < (45*$Games)){
$tally *= 0;
}
$PID_ar[$i] = $PID;
$Score[$i] = $tally;
$ScoreCheck[$i] = $Score[$i];
$i++;
}
}
if ($ScoreCheck != NULL){
rsort($ScoreCheck);
for ($x = 0; $x < $i; $x++)
{
for ($j = 0; $j < $i; $j++)
{
if ($Score[$j] == $ScoreCheck[$x])
{
for ($ab = 0; $ab < $i; $ab++){
if ($CheckPID[$ab] == $PID_ar[$j]){
$YesOrNo = 1;
}
}
if ($YesOrNo == 1){
} else {
$LoopCheck[$x] = $j;
$CheckPID[$x] = $PID_ar[$j];
}
$YesOrNo = 0;
}
}
}
for ($x = 0; $x < 15; $x++){
$HotCheck[$x] = $PID_ar[$LoopCheck[$x]];
}
$j = 0;
for ($x = ($i-1); $x > ($i - 16); $x--){
$ColdCheck[$j] = $PID_ar[$LoopCheck[$x]];
$j++;
}
} else {
$ToPrintOrNo = 1;
}
print "";
print "Who's Hot? ";
if ($ToPrintOrNo == 1){
print "Not Available ";
} else {
for ($x = 0; $x < 5; $x++){
$query9999 = "SELECT * FROM Players WHERE PlayerID = ".$HotCheck[$x]." ";
$result9999 = mysql_query ($query9999, $connection);
while ($row9999 = mysql_fetch_array ($result9999)){
$TeamNum = $row9999["ProOwn"];
$Position = $row9999["Position"];
$HotID = $row9999["PlayerID"];
$querystreak2 = "SELECT PStrk FROM PlayerStats WHERE PlayerID = ".$HotID." AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." AND Level = 1 AND PStrk > 0";
// print $querystreak;
$qresult2 = mysql_query($querystreak2,$connection);
while ($qstreak2 = mysql_fetch_array ($qresult2)){
$Streaks2 = $qstreak2["PStrk"];
// print $Streaks;
}
$query = "SELECT * FROM Teams WHERE TeamNum = $TeamNum";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$TeamShort = $res2["Short"];
if ($row9999["Position"] != 'G'){
$PlayerName = $row9999["FirstName"] . " " . $row9999["LastName"];
$PlusMinus = 0;
$Assists = 0;
$Goals = 0;
$Games = 0;
$Points = 0;
$query = "SELECT
A AS A,
G AS G,
Pts AS Pts,
PlsMns AS PlsMns,
GP AS GP
FROM PlayerGameStats WHERE PlayerID = ".$HotCheck[$x]." AND Level = 1 AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." ORDER BY GameNum DESC LIMIT " . $Streaks2;
$player_result = mysql_query ($query, $connection);
while ($row_p = mysql_fetch_array ($player_result)){
$Points += $row_p["Pts"];
$Assists += $row_p["A"];
$PlusMinus += $row_p["PlsMns"];
$Goals += $row_p["G"];
$Games += $row_p["GP"];
}
print "
".$PlayerName." (".$Position.")
".$TeamShort."
GP ". $Games ." G " . $Goals ." A " . $Assists ." Pts " . $Points;
if ($PlusMinus > 0){
print " +/- " . $PlusMinus;
}
print " ";
} else {
$PlayerName = $row9999["FirstName"] . " " . $row9999["LastName"];
$Wins = 0;
$Losses = 0;
$Ties = 0;
$Minutes = 0;
$ShotsAgainst = 0;
$GoalsAgainst = 0;
$Games = 0;
$ShutOuts = 0;
$query = "SELECT
GP AS GP,
Minutes AS Minutes,
W AS W,
L AS L,
T AS T,
SA AS SA,
GA AS GA,
SO AS SO
FROM GoalieGameStats WHERE PlayerID = ".$HotCheck[$x]." AND Level = 1 AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." ORDER BY GameNum DESC LIMIT 3";
$goalie_result = mysql_query ($query, $connection);
while ($row_g = mysql_fetch_array ($goalie_result)){
$Wins += $row_g["W"];
$Losses += $row_g["L"];
$Ties += $row_g["T"];
$Minutes += $row_g["Minutes"];
$ShotsAgainst += $row_g["SA"];
$GoalsAgainst += $row_g["GA"];
$Games += $row_g["GP"];
$ShutOuts += $row_g["SO"];
}
print "
".$PlayerName." (".$Position.")
".$TeamShort."
GP ". $Games . " " . $Wins ."-". $Losses ."-". $Ties ." , ";
$SPC = (($ShotsAgainst - $GoalsAgainst) / $ShotsAgainst);
$GAA = $GoalsAgainst / (($Minutes)/60);
settype(number_format($SPC,3), "string");
$SPC = ltrim($SPC, '0');
print number_format($GAA,2) . " GAA , ";
print substr($SPC, 0, 4);
print "%";
if ($ShutOuts > 0){
print ", " . $ShutOuts . " SO ";
}
print " ";
}
}
}
}
print "Who's Not! ";
if ($ToPrintOrNo == 1){
print "Not Available ";
} else {
for ($x = 0; $x < 5; $x++){
$query9999 = "SELECT * FROM Players WHERE PlayerID = ".$ColdCheck[$x]." ";
$result9999 = mysql_query ($query9999, $connection);
while ($row9999 = mysql_fetch_array ($result9999)){
$TeamNum = $row9999["ProOwn"];
$Position = $row9999["Position"];
$query = "SELECT * FROM Teams WHERE TeamNum = $TeamNum";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$TeamShort = $res2["Short"];
if ($row9999["Position"] != 'G'){
$PlayerName = $row9999["FirstName"] . " " . $row9999["LastName"];
$PlusMinus = 0;
$Assists = 0;
$Goals = 0;
$Games = 0;
$Points = 0;
$MajNum = 0;
$PIM = 0;
$query = "SELECT
MajorPenTaken AS MajNum,
PIM AS PIM,
A AS A,
G AS G,
Pts AS Pts,
PlsMns AS PlsMns,
GP AS GP
FROM PlayerGameStats WHERE PlayerID = ".$ColdCheck[$x]." AND Level = 1 AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." ORDER BY GameNum DESC LIMIT 3";
$player_result = mysql_query ($query, $connection);
while ($row_p = mysql_fetch_array ($player_result)){
$Points += $row_p["Pts"];
$Assists += $row_p["A"];
$PlusMinus += $row_p["PlsMns"];
$Goals += $row_p["G"];
$Games += $row_p["GP"];
$MajNum += $row_p["MajNum"];
$PIM += $row_p["PIM"];
}
print "
".$PlayerName." (".$Position.")
".$TeamShort."
GP ". $Games ;
if ($Points == 0){
print " Pts " . $Points;
}
if ($PlusMinus < 0){
print " +/- " . $PlusMinus;
}
$PIMCheck = $PIM;
if ($PIMCheck > 9.9){
print " PIM " . $PIM;
}
$MajCheck = $MajNum;
if ($MajCheck > 0.9){
print " Majors " . $MajNum;
}
print " ";
} else {
$PlayerName = $row9999["FirstName"] . " " . $row9999["LastName"];
$Wins = 0;
$Losses = 0;
$Ties = 0;
$Minutes = 0;
$ShotsAgainst = 0;
$GoalsAgainst = 0;
$Games = 0;
$MajNum = 0;
$PIM = 0;
$query = "SELECT
MajorPenTaken AS MajNum,
GP AS GP,
Minutes AS Minutes,
W AS W,
L AS L,
T AS T,
SA AS SA,
GA AS GA,
PIM AS PIM
FROM GoalieGameStats WHERE PlayerID = ".$ColdCheck[$x]." AND Level = 1 AND Type = '".$SeasonType."' AND Season = ".$SeasonNumber." ORDER BY GameNum DESC LIMIT 3";
$goalie_result = mysql_query ($query, $connection);
while ($row_g = mysql_fetch_array ($goalie_result)){
$Wins += $row_g["W"];
$Losses += $row_g["L"];
$Ties += $row_g["T"];
$Minutes += $row_g["Minutes"];
$ShotsAgainst += $row_g["SA"];
$GoalsAgainst += $row_g["GA"];
$Games += $row_g["GP"];
$MajNum += $row_g["MajNum"];
$PIM += $row_g["PIM"];
}
print "
".$PlayerName." (".$Position.")
".$TeamShort."
GP ". $Games . " " . $Wins ."-". $Losses ."-". $Ties ." , ";
$SPC = (($ShotsAgainst - $GoalsAgainst) / $ShotsAgainst);
$GAA = $GoalsAgainst / (($Minutes)/60);
settype(number_format($SPC,3), "string");
$SPC = ltrim($SPC, '0');
print number_format($GAA,2) . " GAA , ";
print substr($SPC, 0, 4);
print "%";
$PIMCheck = $PIM / $Games;
if ($PIMCheck > 9.9){
$tally += ($PIMCheck * -1);
}
$MajCheck = $MajNum / $Games;
if ($MajCheck > 0.9){
$tally += ($MajCheck * -3);
}
print " ";
}
}
}
}
print "
";
print "
";
}
else if ($ShowScores == 0)
{
print "
";
}
end the Temporary comments ***/
print " ";
if ($ShowArticle == 1 AND $ArtApp == 1)
{
print "
Article - $ArticleSubject -
Hide
$ArticleText
";
print " ";
}
else if ($ShowArticle == 0 AND $ArtApp == 1)
{
print "
Article - $ArticleSubject -
Show
";
print " ";
}
else if ($ShowArticle == 2)
{
}
if ($ShowTwitter == 1)
{
print "
MEDIA FEED -
Hide
";
print "";
?>
/*print " ";
print '
*/
print '
';
}
else if ($ShowTwitter == 0)
{
print "
";
print " ";
}
if ($ShowDisabled == 1)
{
print "
DISABLED PLAYERS -
Hide - All Levels
Pro ";
$query = "SELECT * FROM Players WHERE Level = 1 AND (Injured > 0 OR Suspended > 0) ORDER BY LastName";
$result = mysql_query ($query, $connection);
while ($row = @mysql_fetch_array ($result))
{
$PlayerID = $row["PlayerID"];
$Injured = $row["Injured"];
$Suspended = $row["Suspended"];
if ($Injured > 0 OR $Suspended > 0)
{
print $vw . $PlayerID . ">";
$PlayerTeam = $row["Team"];
print $row["FirstName"] . " " . $row["LastName"] . "";
$query = "SELECT * FROM Teams WHERE TeamNum = $PlayerTeam";
$result3 = @mysql_fetch_array(mysql_query($query,$connection));
print " - " . $result3["City"] . " - ";
if ($Injured > 0)
{
print $Injured;
if ($Injured == 1)
{
print " game - injured. ";
}
else
{
print " games - injured. ";
}
}
else if ($Suspended > 0)
{
print $Suspended;
if ($Suspended == 1)
{
print " game - suspended. ";
}
else
{
print " games - suspended. ";
}
}
}
}
print "
";
print " ";
}
else if ($ShowDisabled == 0)
{
print "
";
print " ";
}
if ($ShowWaivers == 1 AND $WaivApp == 1)
{
print "
WAIVER LIST -
Hide
Current Priority: $PriorityText
$WaiverText
";
print " ";
}
else if ($ShowWaivers == 0 AND $WaivApp == 1)
{
print "
";
print " ";
}
if ($ShowRecentTransa == 1)
{
print "
RECENT TRANSACTIONS -
Hide - More
";
$Month = date("m");
$YearToday = date("Y");
$NextYear = $YearToday;
$PreviousMonth = $Month - 1;
$NextMonth = $Month + 1;
if ($NextMonth == 13){
$NextMonth = 1;
$NextYear = $YearToday + 1;
}
$D1 = $YearToday . "-" . $PreviousMonth . "-01";
$Date1 = strtotime($D1);
$D2 = $NextYear . "-" . $NextMonth . "-01";
$Date2 = strtotime($D2);
$query = "SELECT * FROM PlayerTrades WHERE UNIX_TIMESTAMP(Date) >= $Date1 AND UNIX_TIMESTAMP(Date) < $Date2 ORDER BY Date DESC";
$trades = mysql_query($query,$connection);
$RowDate = "";
$counter = 0;
while ($row = @mysql_fetch_array($trades))
{
$counter++;
$COMTick = $row["GMApproved"];
if ($RowDate != $row["Date"])
{
if ($counter != 1)
{
print "";
}
$RowDate = $row["Date"];
$R1 = strtotime($RowDate);
$RowDate1 = date("F j Y", $R1);
print "$RowDate1 ";
}
$TradeID = $row["TransID"];
$Team1 = $row["Team1"];
$Team2 = $row["Team2"];
$Players1 = $row["Players1"];
$Players2 = $row["Players2"];
$Picks1 = $row["Picks1"];
$Picks2 = $row["Picks2"];
$Money1 = $row["Money1"];
$Money2 = $row["Money2"];
$query = "SELECT * FROM Teams WHERE TeamNum = $Team1";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$TeamName1 = $res2["City"];
$query = "SELECT * FROM Teams WHERE TeamNum = $Team2";
$res2 = @mysql_fetch_array(mysql_query($query,$connection));
$TeamName2 = $res2["City"];
$Player1 = explode (",", $row["Players1"]);
$MaxI = count($Player1);
$Pick1 = explode (",", $Picks1);
print "-$TeamName1 trades ";
if ($Player1[0] != 0)
{
for ($i = 0; $i < $MaxI; $i++)
{
$PlayerID = $Player1[$i];
$query = "SELECT * FROM Players WHERE PlayerID = $PlayerID";
$res3 = @mysql_fetch_array(mysql_query($query,$connection));
$PlayerName = $res3["FirstName"] . " " . $res3["LastName"];
$SkillClass = $res3["SkillClass"];
$MarqueeSymbol = '';
include 'PlayerSkillClass.php';
print $vw . $PlayerID . ">$PlayerName" . $MarqueeSymbol;
if (($i + 1 < $MaxI) OR ($i + 1 == $MaxI AND ($Picks1 != "" OR $Money1 != "0.00")))
{
print ", ";
}
}
}
$MaxI = count($Pick1);
if ($Pick1[0] != 0)
{
for ($i = 0; $i < $MaxI; $i++)
{
$PickID = $Pick1[$i];
$query = "SELECT * FROM TeamDraftPicks WHERE PickID = $PickID";
$res3 = @mysql_fetch_array(mysql_query($query,$connection));
$PickTeam = $res3["Team"];
$query = "SELECT * FROM Teams WHERE TeamNum = $PickTeam";
$res4 = @mysql_fetch_array(mysql_query($query,$connection));
print $res4["City"] . "'s S" . $res3["Season"] . " " . text_number($res3["Round"]) . " Round pick";
if (($i + 1 < $MaxI) OR ($i + 1 == $MaxI AND ($Money1 != "0.00")))
{
print ", ";
}
}
}
if ($Money1 != "0")
{
print "$" . number_format($Money1);
}
$Player2 = explode (",", $row["Players2"]);
$MaxI = count($Player2);
$Pick2 = explode (",", $Picks2);
print " to $TeamName2 for ";
if ($Player2[0] != 0)
{
for ($i = 0; $i < $MaxI; $i++)
{
$PlayerID = $Player2[$i];
$query = "SELECT * FROM Players WHERE PlayerID = $PlayerID";
$res3 = @mysql_fetch_array(mysql_query($query,$connection));
$PlayerName = $res3["FirstName"] . " " . $res3["LastName"];
$SkillClass = $res3["SkillClass"];
$MarqueeSymbol = '';
include 'PlayerSkillClass.php';
print $vw . $PlayerID . ">$PlayerName" . $MarqueeSymbol;
if (($i + 1 < $MaxI) OR ($i + 1 == $MaxI AND ($Picks2 != "" OR $Money2 != "0.00")))
{
print ", ";
}
}
}
$MaxI = count($Pick2);
if ($Pick2[0] != 0)
{
for ($i = 0; $i < $MaxI; $i++)
{
$PickID = $Pick2[$i];
$query = "SELECT * FROM TeamDraftPicks WHERE PickID = $PickID";
$res3 = @mysql_fetch_array(mysql_query($query,$connection));
$PickTeam = $res3["Team"];
$query = "SELECT * FROM Teams WHERE TeamNum = $PickTeam";
$res4 = @mysql_fetch_array(mysql_query($query,$connection));
print $res4["City"] . "'s S" . $res3["Season"] . " " . text_number($res3["Round"]) . " Round pick";
if (($i + 1 < $MaxI) OR ($i + 1 == $MaxI AND ($Money2 != "0.00")))
{
print ", ";
}
}
}
if ($Money2 != "0")
{
print "$" . number_format($Money2);
}
print ". ";
}
print "
";
}
else if ($ShowRecentTransa == 0)
{
print "
";
}
?>