include('funciones.php');
$enla = conecta();
$tipo = $_REQUEST['tipo'];
$week = $_REQUEST['week'];
if($tipo=='')
{
$consulta = "SELECT tipo FROM schedules WHERE fecgame>=curdate() limit 0,1";
$result = @mysql_query($consulta);
while($row = mysql_fetch_assoc($result))
{
$tipo = $row['tipo'];
}
//$tipo = "RS";
}
if($week =='')
{
$consulta = "SELECT IF(fecgame>curdate(),1,2) as indicador FROM schedules WHERE tipo='$tipo' order by fecgame desc limit 0,1";
$result = @mysql_query($consulta);
while($row = mysql_fetch_assoc($result))
{
$ind = $row['indicador'];
}
//echo $ind."hola";
if($ind==1)
{
$consulta = "SELECT week FROM schedules WHERE fecgame>=curdate() and tipo='$tipo' limit 0,1";
$result = @mysql_query($consulta);
while($row = mysql_fetch_assoc($result))
{
$week = $row['week'];
}
}
else
{
$consulta = "SELECT week FROM schedules WHERE tipo='$tipo' order by fecgame desc limit 0,1";
$result = @mysql_query($consulta);
while($row = mysql_fetch_assoc($result))
{
$week = $row['week'];
}
}
}
/*
if($tipo=='PS')
{
$titulo = 'Pre-Temporada ';
if($week =='')
$week = 0;
}
else if ($tipo == 'RS')
{
$titulo = 'Temporada';
if($week =='')
$week = 1;
}
*/
?>
$consulta = "select distinct week from schedules WHERE tipo = '$tipo' and year=year(curdate()) order by week";
$result = @mysql_query($consulta);
while($row = mysql_fetch_assoc($result))
{
if($row['week']==0&&$tipo=='PS')
{
$titulo = 'Salon de la Fama';
}
else if($row['week']==1&&$tipo=='PO')
{
$titulo = 'Juegos de Comodines';
}
else
{
$titulo = $row['week'];
}
if($row['week']==$week)
{
?>
|
}
else
{
?>
|
}
}
?>
Semana
Fecha |
Hora |
Visitante |
|
|
|
Local |
|
$consulta = "select year,tipo,week,lower(idteam1) as idteam1,score1,lower(idteam2) as idteam2,score2,date_format(fecgame,'%d/%m/%Y') as fecha,fecgame,time_format( horgame, '%I:%i %p') as horaj from schedules WHERE tipo = '$tipo' and year=year(curdate()) order by fecgame , horgame";
$result = @mysql_query($consulta);
$wk = "";
while($row = mysql_fetch_assoc($result))
{
if($row['week']==$week)
{
?>
|
}
if($row['week']==$week)
{
if($row['score1']==0&&$row['score2']==0)
{
$score1="";
$score2="";
}
else
{
$score1=$row["score1"];
$score2=$row["score2"];
}
?>
|
|
|
|
@ |
|
|
|
}
$wk=$row['week'];
}
?>
|
if($tipo=='RS')
{
?>
$consulta = "select lcase(idteam) as idteam from team where idteam not in
(Select idteam1 from schedules where tipo ='$tipo' and week=$week and year=year(curdate())
union
Select idteam2 from schedules where tipo ='$tipo' and week=$week and year=year(curdate())) ";
$result = @mysql_query($consulta);
$texto = "";
while($row = mysql_fetch_assoc($result))
{
if ($texto=="")
{
$texto= "Descansan:";
?>
|
}
?>
|
}
?>
}
?>