0) && ($sportids < $numsports) ) { # do something } else { $sportids = 1; } $posar = array(); $color = 0; $hour = date(H); $ymd = date("Y-m-d", strtotime("-1 day")); $projectiondate = '2001'; $counter = 0; $html = "

"; for( $x=1; $x <= $numsports; $x++ ) { $sidname = $sportid[$x][name]; $html.=<<$sidname  EOF; } $sql0 = "select id,name,symbol,posid from players where sid=$sportids and active=0 order by posid, symbol"; if( $res0 = mysql_query($sql0, $db) ) { while( list($plid, $name, $symbol, $posid, $value, $lastdiv, $totalshares) = mysql_fetch_array($res0) ) { unset($fieldlist); foreach($positionsinfolist[$posid] as $info) { if( !isset($fieldlist) ) $fieldlist = $info; else $fieldlist.= ",$info"; } $smallname = $positions[$posid][smallname]; $sql1 = "select $fieldlist from " . $smallname . "info where playerid=$plid"; $res1 = mysql_query($sql1, $db); $infoarray = mysql_fetch_array($res1); if($infoarray[team]!='') { $teamsql = "select name from teams where id=" . $infoarray[team]; $teamres = mysql_query($teamsql, $db); list($team) = mysql_fetch_array($teamres); } $lastpositionname=$positionfullname; $positionfullname = $positions[$posid][fullname]; if($positionfullname!=$lastpositionname) { array_push($posar, $posid); $numrows=count($positionsstatslist[$posid]); if($counter) { $html .=<< EOF; } $disppositionfullname = $positionfullname . "s"; $html .=<<
$disppositionfullname

EOF; $html .= "\n"; $html .= "\n"; if( ($sportids != 3) && ($sportids != 2) && ($posid != 13) && ($posid != 14) ) $html .="\n"; $html .="\n"; #for( $x = 0; $x < $numrows; $x++ ) #{ #if($positionsstatsnames[$posid][$x] == "Total Games") #$positionsstatsnames[$posid][$x]="Games"; #if($positionsstatsnames[$posid][$x] == "Homeruns") #$positionsstatsnames[$posid][$x]="HRs"; #if($positionsstatsnames[$posid][$x] == "Power Play Goal") #$positionsstatsnames[$posid][$x]="PPG"; #if($positionsstatsnames[$posid][$x] == "Short Handed Goal") #$positionsstatsnames[$posid][$x]="SHG"; #$html.= "\n"; #} } $counter++; unset($statslist); foreach( $positionsstatslist[$posid] as $stats) { #if(!isset($statslist)) $statslist = "`$stats"; #else $statslist.= "`,`$stats"; } #$sql = "select $statslist` from " . $smallname . "stats" . $projectiondate . " where playerid=$plid"; $res = mysql_query($sql, $db); $projarray = mysql_fetch_array($res); $u++; if( $u == 3 ) { # die($sql); } if(!$color) { $bgcolor="#FFFFFF"; $color++; } else { $bgcolor="#EEEEEE"; $color = 0; } $html .= "\n"; $html .= "\n"; $html .= "\n"; if(($sportids!=3) && ($sportids!=2) && ($posid!=13) && ($posid!=14)) $html.="\n"; $html.="\n"; for( $x = 0; $x < $numrows; $x++ ) { $html.= "\n"; } } } $html .=<<
IDNameTeamSymbol" . $positionsstatsnames[$posid][$x] . "
$plid$name$team$symbol" . $projarray[$positionsstatslist[$posid][$x]] . "

EOF; #
(right-click choose 'Safe Target As...')

foreach($posar as $x) { if($positions[$x][fullname]!="NFL Defense") $posidname = $positions[$x][fullname] . "s"; else $posidname = $positions[$x][fullname]; $html .=<<

  EOF; print $templatetop; print $html; print $templatebottom; ?>