exit();
$link=mysqli_connect('localhost', 'atsdb','db_nhl009','atsrdbnhl');
require "Templates/header.inc.php";
if($val=='')
{
$val='MLB';
}
elseif($val=='CFB')
{
$val='NCAAF';
}
else
{
$val=$val;
}
$tagval=$val;
include "game_times.php";
#---- create expiry date
$select =$val;
#---collect the league information
$leagueqry=mysqli_query($link,"select league_no,league_id,league_name from ats_league1 where league_name='$select' ");
list($lno,$lid,$lname)=mysqli_fetch_array($leagueqry);
$demoqry=mysqli_query($link,"select * from new_asp_schedule where game_date between '$startdate' and '$enddate' and league_no=$lno and (team1 not like '%Teams%' and team2 not like '%Teams%') and (team1 not like '%Live%' and team2 not like '%Live%') order by game_date,game_no1 ");
$demo_num=mysqli_num_rows($demoqry);
?>
Stats For
#--collect the schedule from new_asp_schedule which is taken from "http://thegreek.com/sports/live/pstdata.asp "
$dateqry=mysqli_query($link,"select distinct game_date from new_asp_schedule where game_date between '$startdate' and '$enddate' and league_no=$lno and (team1 not like '%Teams%' and team2 not like '%Teams%') and (team1 not like '%Live%' and team2 not like '%Live%') and (team1 not like '%NFC%' and team2 not like '%AFC%') and game_status!='2' order by game_date,game_no1 ");
$dnum=mysqli_num_rows($dateqry);
if($dnum)
{
$date_array=array();
while($drow=mysqli_fetch_array($dateqry))
{
$date_array[ ]=$drow['game_date'];
}
?>
LEAGUE : |
}else{?>
LEAGUE : |
}?>
//print_r($date_array);
#--for loop to display the matches date by date
for($dd=0;$dd
DATE : |
}else{?>
DATE : |
}?>
Time |
Teams |
Team Pitchers |
}?>
Current Line |
ATS Matchups Report |
Quick Stats |
Line Moves |
#--get the table name from leaguename
$lname1=strtolower($lname);
$table=$lname1.'_teams';
#--collect the schedule inforamtion (gamedate,gametime,team1,team2,cris openers,etc) from new_asp_schedule
$roadqry=mysqli_query($link,"select * from new_asp_schedule where game_date ='$date' and league_no=$lno and (team1 not like '%Teams%' and team2 not like '%Teams%') and game_status!='2' order by game_date,game_no1 ");
$rnum=mysqli_num_rows($roadqry);
if($rnum)
{
while ($roadrow=mysqli_fetch_array($roadqry))
{
$home_cris="";
$road_cris="";
$schedule_id=$roadrow['schedule_id'];#--league no
$league=$roadrow['league_no'];#--league no
$date=$roadrow['game_date'];#--game date on which game is scheduled
$time=$roadrow['game_time']; # --time of game
$road_gameno=$roadrow['game_no1']; #--road team game number
$home_gameno=$roadrow['game_no2'];#--home team game number
//echo "road_gameno=$road_gameno----home_gameno=$home_gameno
";
$road_score=$roadrow['team1_score']; #--road team score
$home_score=$roadrow['team2_score'];#--home team score
$road_team=$roadrow['team1'];#--road team name
$home_team=$roadrow['team2'];#--home team name
//echo "road_team=$road_team----home_team=$home_team
";
$road_pitcher=$roadrow['pitcher1'];#--road team pitcher
$home_pitcher=$roadrow['pitcher2'];#--home team pitcher
$road_pithand=$roadrow['pitcher1_hand'];#--road team picther's hand
$home_pithand=$roadrow['pitcher2_hand'];#--home team picther's hand
$game_total=$roadrow['game_total']; #--game total
$road_spread=$roadrow['team1_spread']; #---road team spread
$home_spread=$roadrow['team2_spread'];#---home team spread
$road_ML=$roadrow['team1_ML'];#---road team moneyline
$home_ML=$roadrow['team2_ML'];#---home team moneyline
$tot_overmoney=$roadrow['tot_overmoney'];#---total point over money
$tot_undermoney=$roadrow['tot_undermoney'];#---total point under money
$lmsel1=mysqli_query($link,"SELECT count(*) as count FROM thegreek_schedule WHERE league_no = '$league' AND game_date BETWEEN '$startdate' AND '$enddate' and (game_status!='2' or game_status!='3') and game_no1='$road_gameno' and game_no2='$home_gameno' GROUP BY game_no1 ORDER BY game_date, game_no1 ");
list($count)=mysqli_fetch_array($lmsel1);
if($league=='1' || $league=='18' || $league=='3' || $league=='2')#--leagueno 1 for NFL,18 for CFL,3 for NBA
{
if($road_spread<0 && $home_spread>0)
{
$road_cris=$road_spread;
$home_cris=$game_total;
}
elseif($home_spread<0 && $road_spread>0)
{
$road_cris=$game_total;
$home_cris=$home_spread;
}
elseif($home_spread==0 && $road_spread==0)
{
$road_cris=$road_spread;
$home_cris=$game_total;
}
$home_cris=abs($home_cris);
$road_cris=abs($road_cris);
}
elseif($league=='5' || $league=='7') #--5 is league no for MLB & 7 is for NHL
{
if($home_ML<0 && $road_ML>0)
{
$home_cris=$home_ML;
$road_cris=$game_total;
}
elseif($home_ML>0 && $road_ML<0)
{
$home_cris=$game_total;
$road_cris=$road_ML;
}
elseif(($home_ML<0 && $road_ML<0) && ($home_ML!=$road_ML))
{
if($home_ML<$road_ML)
{
$home_cris=$home_ML;
$road_cris=$game_total;
}
elseif($home_ML>$road_ML)
{
$home_cris=$game_total;
$road_cris=$road_ML;
}
}
elseif(($home_ML<0 && $road_ML<0) && ($home_ML==$road_ML))
{
if($tot_undermoney<0 && $tot_overmoney>0)
{
$home_cris=$home_ML;
$road_cris=$game_total;
}
elseif($tot_undermoney>0 && $tot_overmoney<0)
{
$home_cris=$game_total;
$road_cris=$road_ML;
}
elseif(($tot_undermoney<0 && $tot_overmoney<0) && ($tot_undermoney!=$tot_overmoney))
{
if($tot_undermoney<$tot_overmoney)
{
$home_cris=$home_ML;
$road_cris=$game_total;
}
elseif($tot_undermoney>$tot_overmoney)
{
$home_cris=$game_total;
$road_cris=$road_ML;
}
}
elseif(($tot_undermoney<0 && $tot_overmoney<0) && ($tot_undermoney==$tot_overmoney))
{
if($home_spread<0 && $road_spread>0)
{
$home_cris=$home_ML;
$road_cris=$game_total;
}
elseif($home_spread>0 && $road_spread<0)
{
$home_cris=$game_total;
$road_cris=$road_ML;
}
elseif(($home_spread<0 && $road_spread<0) && ($home_spread!=$road_spread))
{
if($home_spread<$road_spread)
{
$home_cris=$home_ML;
$road_cris=$game_total;
}
elseif($home_spread>$road_spread)
{
$home_cris=$game_total;
$road_cris=$road_ML;
}
}
elseif(($home_spread<0 && $road_spread<0) && ($home_spread==$road_spread))
{
$home_cris='pk';
$road_cris='pk';
}
}#2nd main elseif
}#main elseif
}#end of elseif for league
if(preg_match("/'/",$road_team))
{
$road_team=addslashes($road_team);
}
#chk for mlb
if($table=='mlb_teams')
{
//$rqry=mysqli_query($link,"select team_id,team_name,alias_teamname from $table where new_teamname='$road_team'");
###Changes made on 21june11
$rqry=mysqli_query($link,"select team_id,team_name,new_teamname,alias_teamname from $table where new_teamname='$road_team' or team_name='$road_team'");
list($road_teamid,$road_team,$road_team111,$rteam)=mysqli_fetch_array($rqry);
}
elseif($table=='ncaaf_teams')
{
$rteam=$road_team;
$rqry=mysqli_query($link,"select team_id,team_name from $table where team_name='$road_team' or score_teamname='$road_team' or new_teamname='$road_team' ");
list($road_teamid,$road_team)=mysqli_fetch_array($rqry);
if($road_team=='Texas A&M')
{
$road_team11='Texas A^M';
}else
{
$road_team11=$road_team;
}
}
else
{
$rteam=$road_team;
if($select =='CFL' && $road_team=='B.C. LIONS')
{
$road_team='BRITISH COLUMBIA';
$rteam=$road_team;
}
if($select =='NHL' && $road_team=='ST. LOUIS')
{
$road_team='ST LOUIS';
$rteam=$road_team;
}
$rqry=mysqli_query($link,"select team_id,team_name from $table where new_teamname like '%$road_team%' or team_name like '%$road_team%'");
list($road_teamid,$road_team)=mysqli_fetch_array($rqry);
}
if(preg_match("/'/",$home_team))
{
$home_team=addslashes($home_team);
}
if($table=='mlb_teams')
{
//echo "select team_id,team_name,new_teamname,alias_teamname from mlb_teams where new_teamname='$home_team'
";
$hqry=mysqli_query($link,"select team_id,team_name,new_teamname,alias_teamname from mlb_teams where (new_teamname='$home_team' or team_name='$home_team')");
list($home_teamid,$home_team,$home_team111,$hteam)=mysqli_fetch_array($hqry);
}
elseif($table=='ncaaf_teams')
{
$hteam=$home_team;
$hqry=mysqli_query($link,"select team_id,team_name from $table where (team_name='$home_team' or score_teamname='$home_team' or new_teamname='$home_team')");
list($home_teamid,$home_team)=mysqli_fetch_array($hqry);
if($home_team=='Texas A&M')
{
$home_team11='Texas A^M';
}else
{
$home_team11=$home_team;
}
}
else
{
if($select =='CFL' && $home_team=='B.C. LIONS')
{
$home_team='BRITISH COLUMBIA';
$hteam=$home_team;
}
if($select =='NHL' && $home_team=='ST. LOUIS')
{
$home_team='ST LOUIS';
$hteam=$home_team;
}
$hqry=mysqli_query($link,"select team_id,team_name from $table where new_teamname like '%$home_team%'");
list($home_teamid,$home_team)=mysqli_fetch_array($hqry);
}
//echo "$road_team----$home_team
";
#chk for blank data
if(trim($road_team)!="" && trim($home_team)!="")
{
?>
|
#########################Game No with Team name########################
if($session_var=='1')
{
if($select=='MLB')
{
//echo "road_team=$road_team----home_gameno=$home_gameno
";
$name2=$date.'~'.$time.'~'.$road_teamid.'~'.$road_team.'~'.$home_teamid.'~'.$home_team.'~'.$lname.'~'.$road_pitcher.'~'.$road_pithand.'~'.$home_pitcher.'~'.$home_pithand.'~'.$road_gameno.'~'.$home_gameno;
?>
()
()
|
}
elseif($select=='NHL')
{
$name2=$date.'~'.$time.'~'.$road_teamid.'~'.$road_team.'~'.$home_teamid.'~'.$home_team.'~'.$lname.'~'.$road_gameno.'~'.$home_gameno;
?>
()
()
|
}
elseif($select=='NCAAF')
{
$name2=$date.'~'.$time.'~'.$road_teamid.'~'.$road_team11.'~'.$home_teamid.'~'.$home_team11.'~'.$lname.'~'.$road_gameno.'~'.$home_gameno;
?>
()
()
|
}
else
{
$name2=$date.'~'.$time.'~'.$road_teamid.'~'.$road_team.'~'.$home_teamid.'~'.$home_team.'~'.$lname.'~'.$road_gameno.'~'.$home_gameno;
?>
()
()
|
}
}#if(session_is_registered("loggedin"))
elseif($session_var=='2')
{
?>
()
()
|
}
else
{
?>
()
()
|
}
#########################Game No with Team name########################
#########################Game Pitcher FOR MLB########################
if($select=='MLB')
{
?>
() () |
}
#########################Game Pitcher FOR MLB########################
#########################Game Line Total########################
?>
|
#########################Game Line Total########################
#########################ATS MATCHUPS LINK########################
?>
if($session_var=='1')
{
if($select=='MLB')
{
?>
ATS Matchups Report
}
elseif($select=='NCAAF')
{
?>
ATS Matchups Report
}
else
{
?>
ATS Matchups Report
}
}#if(session_is_registered("loggedin"))
elseif($session_var=='2')
{
?>
ATS Matchups Report
}
else
{
?>
ATS Matchups Report
}
#########################ATS MATCHUPS LINK########################
?>
|
#########################QuiCK Stats LINK########################
if($session_var=='1')
{
if($select=='MLB')
{
?>
Quick Stats
}
elseif($select=='NCAAF')
{
?>
Quick Stats
}
else
{
?>
Quick Stats
}
}# if(session_is_registered("loggedin"))
elseif($session_var=='2')
{
?>
Quick Stats
}
else
{
?>
Quick Stats
}
#########################QuiCK Stats LINK########################
?>
|
#########################Cheatsheet & Linemoves LINK########################
if($session_var=='1')
{
?>
Line Moves
|
}
elseif($session_var=='2')
{
?>
Line Moves
|
}
else
{
?>
Line Moves
|
}
#########################Cheatsheet & Linemoves LINK########################
?>
}#endif($road_team!="" && $home_team!="")
if($rnum==$nullnum)
{?>
No Matches Found For Current Date |
}
}#end while($roadrow)
}#ifrnum
else
{
?>
No Matches Found For Current Date |
}
}#end for date array
?>
}#end if dnum
else
{
?>
}?>
The MLB Baseball team by team directory pages gives you past MLB Baseball results & scores from each Major League Baseball teams from 1996 to present. Furthemore, you will find Baseball Betting stats for against the spread players who are wagering on baseball games. Plus, you will find MLB team trends, systems and head to head stats records
mysqli_close($link);
require "Templates/footer.inc.php";
?>