$league_qry=mysqli_query($link,"select league_no from ats_league1 where league_name='$league'");
list($lno)=mysqli_fetch_array($league_qry);
#--taking current date
include "game_times.php";
//$startdate=$enddate='2005-10-14';
#taking pitchers name if MLB
if($league=='MLB')
{
$roadpitcher=$name1[7];
$roadpithand=$name1[8];
$homepitcher=$name1[9];
$homepithand=$name1[10];
$roadgameno=$name1[11];
$homegameno=$name1[12];
}
else
{
$roadgameno=$name1[7];
$homegameno=$name1[8];
}
$league1=strtolower($league);
$table=$league1.'_teams';
if($league=='CFL')
{
$baseimgpath='../atsdb2/'.$league1.'/'.$league1.'_db3_images/';
$img1=$baseimgpath.$roadteam.'.gif';
$img2=$baseimgpath.$hometeam.'.gif';
if($roadteam=='')
$img1='dummy1.jpg';
if($hometeam=='')
$img2='dummy1.jpg';
}
elseif($league=='NFL')
{
$baseimgpath='../atsdb2/'.$league1.'/'.$league1.'_images/';
$img1=$baseimgpath.$roadteam.'.gif';
$img2=$baseimgpath.$hometeam.'.gif';
if($roadteam=='')
$img1='dummy1.jpg';
if($hometeam=='')
$img2='dummy1.jpg';
}
else
{
$baseimgpath='../atsdb2/'.$league1.'/'.$league1.'_images/';
$img1=$baseimgpath.$roadteam1.'.gif';
$img2=$baseimgpath.$hometeam1.'.gif';
if($roadteam1=='')
$img1='dummy1.jpg';
if($hometeam1=='')
$img2='dummy1.jpg';
}
$sel_league=mysqli_query($link,"select league_no from ats_league1 where league_name='$league'");
list($lno)=mysqli_fetch_array($sel_league);
$league1=strtolower($league);
$table=$league1.'_teams';
$road_side="";
$home_side="";
$over_disp="";
$linetotal_qry=mysqli_query($link,"select * from new_asp_schedule where game_date = '$date' and league_no='$lno' and game_no1='$roadgameno' and game_no2='$homegameno'");
while($row=mysqli_fetch_array($linetotal_qry))
{
$team1_spread=$row['team1_spread'];
$team2_spread=$row['team2_spread'];
$team1_ML=$row['team1_ML'];
$team2_ML=$row['team2_ML'];
$game_total=$row['game_total'];
if($lno=='5' || $lno=='7')
{
$road_side=$team1_ML;
$home_side=$team2_ML;
$over_disp=$game_total;
}
else
{
$road_side=$team1_spread;
$home_side=$team2_spread;
$over_disp=$game_total;
}
}
if($league=='MLB')
{
$rteamqry=mysqli_query($link,"select alias_teamname from mlb_teams where team_id='$roadteamid' ");
list($rteam)=mysqli_fetch_array($rteamqry);
$hteamqry=mysqli_query($link,"select alias_teamname from mlb_teams where team_id='$hometeamid' ");
list($hteam)=mysqli_fetch_array($hteamqry);
}
else
{
$rteam=$roadteam;
$hteam=$hometeam;
}
?>
LEAGUE: |
O/U:
Pitcher : ()}?>
|
Vs.
Date: Time: |
O/U:
Pitcher :()}?>
|
Star System : 35% or lower = 60%-79%= 80%-100%= |
You Are Here SMART STATS REPORT |
$newteam1_id=$roadteamid;$newteam1_gameno=$roadgameno;
#-----query to check ROAD TEAM TRENDS
//echo "select * from ats_smartstats where league_no='$lno' and game_date between '$startdate' and '$enddate' and (team_a='$newteam1_id' and game_number='$newteam1_gameno') order by random_id desc limit 10 ";
$stats_qry1=mysqli_query($link,"select * from ats_smartstats where league_no='$lno' and game_date between '$startdate' and '$enddate' and (team_a='$newteam1_id' and game_number='$newteam1_gameno') order by random_id desc limit 10 ");
$snum1=mysqli_num_rows($stats_qry1);
if(!$snum1)
{
?>
Trends System |
Trends Not Found |
}
else
{
//echo "select * from ats_smartstats where league_no='$lno' and game_date between '$startdate' and '$enddate' and (team_a='$newteam1_id' and game_number='$newteam1_gameno') order by random_id desc limit 10 ";
#-------query to retrieve only team trends as road
$stats_roadqry=mysqli_query($link,"select * from ats_smartstats where league_no='$lno' and game_date between '$startdate' and '$enddate' and (team_a='$newteam1_id' and game_number='$newteam1_gameno') order by random_id desc limit 10 ");
$s_roadnum=mysqli_num_rows($stats_roadqry);
if(!$s_roadnum)
{
?>
Team Trends |
Team Trends Not Found |
}
else
{
?>
if($league!='MLB'){
?>
Team Trends |
}else{?>
Team Trends |
}?>
|
ATS | }?>
SU |
O/U |
Description |
Win-Loss-Push | }?>
Win-Loss-Push |
Over-Under-Push |
while($stats_row1=mysqli_fetch_array($stats_roadqry))
{
$stats_id1=$stats_row1['random_id'];
$message1=$stats_row1['message'];
if(preg_match('/~/',$message1))
{
$message1=preg_replace('/~/','-',$message1);
}
if(preg_match('/With no Situation/',$message1))
{
$message1=preg_replace('/With no Situation/','',$message1);
}
$ats_count1=$stats_row1['ats_count'];
$su_count1=$stats_row1['su_count'];
$over_under1=$stats_row1['over_under'];
$su_per1=$stats_row1['su_percentage'];
$su_per1=trim($su_per1);
$ats_per1=$stats_row1['ats_percentage'];
$ats_per1=trim($ats_per1);
$ou_per1=$stats_row1['ou_percentage'];
$ou_per1=trim($ou_per1);
/*------This is new code to chk star----------*/
$star_system1=$stats_row1['star_system'];
$star_system1=trim($star_system1);
$stars=explode("~",$star_system1);
$ats_stars=$stars[0];
$su_stars=$stars[1];
$ou_stars=$stars[2];
#----for any
#--for no star=>0
#--for red star=> 1
#--for green star=> 2
#--for blue star=> 3
switch($ats_stars)
{
case '0': $ats_star=""; break;
case '1': $ats_star=$star3; break;
case '2': $ats_star=$star1; break;
case '3': $ats_star=$star2; break;
}
switch($su_stars)
{
case '0': $su_star=""; break;
case '1': $su_star=$star3; break;
case '2': $su_star=$star1; break;
case '3': $su_star=$star2; break;
}
switch($ou_stars)
{
case '0': $ou_star=""; break;
case '1': $ou_star=$star3; break;
case '2': $ou_star=$star1; break;
case '3': $ou_star=$star2; break;
}
/*------End of new code to chk star----------*/
$count_sum1=$stats_row1['count_sum'];
$count_sum1=trim($count_sum1);
$csum1=explode("~",$count_sum1);
$ats_csum1=$csum1[0];
$su_csum1=$csum1[1];
$ou_csum1=$csum1[2];
#-----Check if the sum of w-l-t records is less than 3 then dont show it on userside
if($su_csum1 >=3)
{
?>
|
#-----Check if the sum of w-l-t records is less than 10 then dont show stars on userside
if($league!='MLB')
{
#---ATSwinner
if($ats_csum1 >=10)
{?>
|
}#end if($ats_csum1 >=10)
else
{?>
|
}#end else of if($ats_csum1 >=10)
}#-if($league!='MLB')
#-----SUWinner
if($su_csum1 >=10)
{
?>
|
}#end if($su_csum1 >=10)
else
{
?>
|
}#end else of if($su_csum1 >=10)
#-----Over/Under
if($over_under1=='0-0-0')
{
?>
|
}
else
{
if($ou_csum1 >=10)
{
?>
|
}#end if($ou_csum1 >=10)
else
{
?>
|
}#end else of if($ou_csum1 >=10)
}
?>
}#end if($su_csum1 >=3)
}#end while
?>
}#end else
}
?>
$newteam2_id=$hometeamid;$newteam2_gameno=$homegameno;
#---chk for home team trends
$stats_qry2=mysqli_query($link,"select * from ats_smartstats where league_no='$lno' and game_date between '$startdate' and '$enddate' and (team_a='$newteam2_id' and game_number='$newteam2_gameno') order by random_id desc limit 10 ");
$snum2=mysqli_num_rows($stats_qry2);
if(!$snum2)
{
?>
Trends System |
Trends Not Found |
}
else
{
#----query to retrieve team trends as home
$stats_homeqry=mysqli_query($link,"select * from ats_smartstats where league_no='$lno' and game_date between '$startdate' and '$enddate' and (team_a='$newteam2_id' and game_number='$newteam2_gameno') order by random_id desc limit 10 ");
$s_homenum=mysqli_num_rows($stats_homeqry);
if(!$s_homenum)
{
?>
Team Trends |
Team Trends Not Found |
}
else
{
?>
Team Trends |
}else{?>
Team Trends |
}?>
|
ATS |
}?>
SU |
O/U |
Description |
Win-Loss-Push |
}?>
Win-Loss-Push |
Over-Under-Push |
while($stats_row2=mysqli_fetch_array($stats_homeqry))
{
$stats_id2=$stats_row2['random_id'];
$message2=$stats_row2['message'];
if(preg_match('/~/',$message2))
{
$message2=preg_replace('/~/','-',$message2);
}
if(preg_match('/With no Situation/',$message2))
{
$message2=preg_replace('/With no Situation/','',$message2);
}
$ats_count2=$stats_row2['ats_count'];
$su_count2=$stats_row2['su_count'];
$over_under2=$stats_row2['over_under'];
$su_per2=$stats_row2['su_percentage'];
$su_per2=trim($su_per2);
$ats_per2=$stats_row2['ats_percentage'];
$ats_per2=trim($ats_per2);
$ou_per2=$stats_row2['ou_percentage'];
$ou_per2=trim($ou_per2);
/*------This is new code to chk star----------*/
$star_system2=$stats_row2['star_system'];
$star_system2=trim($star_system2);
$stars2=explode("~",$star_system2);
$ats_stars2=$stars2[0];
$su_stars2=$stars2[1];
$ou_stars2=$stars2[2];
#----for any
#--for no star=>0
#--for red star=> 1
#--for green star=> 2
#--for blue star=> 3
switch($ats_stars2)
{
case '0': $ats_star2=""; break;
case '1': $ats_star2=$star3; break;
case '2': $ats_star2=$star1; break;
case '3': $ats_star2=$star2; break;
}
switch($su_stars2)
{
case '0': $su_star2=""; break;
case '1': $su_star2=$star3; break;
case '2': $su_star2=$star1; break;
case '3': $su_star2=$star2; break;
}
switch($ou_stars2)
{
case '0': $ou_star2=""; break;
case '1': $ou_star2=$star3; break;
case '2': $ou_star2=$star1; break;
case '3': $ou_star2=$star2; break;
}
/*------End of new code to chk star----------*/
$count_sum2=$stats_row2['count_sum'];
$count_sum2=trim($count_sum2);
$csum2=explode("~",$count_sum2);
$ats_csum2=$csum2[0];
$su_csum2=$csum2[1];
$ou_csum2=$csum2[2];
#-----Check if the sum of w-l-t records is less than 3 then dont show it on userside
if($su_csum2 >=3)
{
?>
|
#-----Check if the sum of w-l-t records is less than 10 then dont show stars on userside
if($league!='MLB')
{
#---ATSwinner
if($ats_csum2 >=10)
{
?>
|
}#end if($ats_csum11 >=10)
else
{
?>
|
}#end else of if($ats_csum2 >=10)
}#if($league!='MLB')
#-----SUWinner
if($su_csum2 >=10)
{
?>
|
}#end if($su_csum2 >=10)
else
{
?>
|
}#end else of if($su_csum2 >=10)
#-----Over/Under
if($over_under2=='0-0-0')
{
?>
|
}
else
{
if($ou_csum2 >=10)
{
?>
|
}#end if($ou_csum2 >=10)
else
{
?>
|
}#end else of if($ou_csum2 >=10)
}
?>
}#end if($su_csum2 >=3)
}#end while
?>
}#end if $s_homenum
}
?>
|