for ($i = $rounds ; $i>1 ; $i--)
{
$x = (-$i+1)*2;
$lastt[$x-1] = $tourney[start]+($tourney[roundtime]+$tourney[pausetime])*$tourney[matchrounds]*($i-0.5)*2;
$lastt[$x] = $tourney[start]+($tourney[roundtime]+$tourney[pausetime])*$tourney[matchrounds]*($i-1)*2;
?>
>=date("G:i",$tourney[start]+($tourney[roundtime]+$tourney[pausetime])*$tourney[matchrounds]*($i-1)*2)?> - =date("G:i",$lastt[$x-1])?> |
>=date("G:i",$tourney[start]+($tourney[roundtime]+$tourney[pausetime])*$tourney[matchrounds]*($i-1.5)*2)?> - =date("G:i",$lastt[$x])?> |
}
$lastt[0] = $tourney[start]+($tourney[roundtime]+$tourney[pausetime])*$tourney[matchrounds];
?>
>=date("G:i",$tourney[start])?> - =date("G:i",$lastt[0])?> |
for ($i = 2; $i<= $rounds; $i++)
{
$x = $i -1 ;
$lastt[$x] = $tourney[start]+($tourney[roundtime]+$tourney[pausetime])*$tourney[matchrounds]*($i-1)*2;
?>
>=date("G:i",$tourney[start]+($tourney[roundtime]+$tourney[pausetime])*$tourney[matchrounds]*($i-1.5)*2)?> - =date("G:i",$lastt[$x])?> |
}
?>
// status table Y loop
for ($y=1; $y<=$tourney["maxstarter"]*2-2; $y++)
{
?>
// status table X loop
// looser baket
for ($x = -$rounds+0.5; $x <= -1; $x+=0.5)
{
$spacecount = (($fields/2)/(pow(2,$rounds+round($x+0.5)-1)/2)-1)*2;
if ($addsp[$x*2]>=1)
{
if ($y/2 != round($y/2))
{
if ($x == round($x))
{
$cs = 3;
} else {
$cs = 2;
}
if ($type[$x*2]==1 && $x != round($x) && abs($x)<$rounds-1)
{
?>
 |
} else {
?>
|
}
}
}
if ($addsp[$x*2]<=0)
{
if ($space[$x*2]==0)
{
$cnum[$x*2]++;
$num = $cnum[$x*2];
$pos = round($num/2);
if ($field[$x*2][$num]['sid'] ==0)
{
$dolink = FALSE;
$name = '-';
}
elseif($field[$x*2][$num]['sid'] == -1)
{
$dolink = FALSE;
$name = get_starter($tourney,$field[$x*2][$num]['sid']);
} else {
$dolink = TRUE;
$name = get_starter($tourney,$field[$x*2][$num]['sid']);
}
if (time()>$lastt[$x*2] && $tourney['fixed_times']=='y' && $field[$x*2][$num]['sc1']==0 && $field[$x*2][$num+1]['sc1']==0)
{
switch(rand(0,1))
{
case 0:
sql_delete($db['tourney_data'],"WHERE `tid`='$tid' AND `x`='$x' AND `y`='$pos'");
sql_insert($db['tourney_data'],"'$tid','$x','$pos','1','0','1','0','-','FORCED RESULT CAUSE OF TIME LIMIT'");
break;
case 1:
sql_delete($db['tourney_data'],"WHERE `tid`='$tid' AND `x`='$x' AND `y`='$pos'");
sql_insert($db['tourney_data'],"'$tid','$x','$pos','0','1','0','1','-','FORCED RESULT CAUSE OF TIME LIMIT'");
break;
}
}
if ($y/2 != round($y/2))
{
if ($x == round($x))
{
?>
 |
}
?>
>=$dolink?plink("$PHP_SELF?module=$mod&amode=$amode&action=matchinfo&tid=$tid&x=".($x*2)."&y=$pos",$name):$name?> |
>=$field[$x*2][$num]['sc1']?$field[$x*2][$num]['sc1']:'-'?> |
} else {
?>
>=$dolink?plink("$PHP_SELF?module=$mod&amode=$amode&action=matchinfo&tid=$tid&x=".($x*2)."&y=$pos",$name):$name?> |
>=$field[$x*2][$num]['sc1']?$field[$x*2][$num]['sc1']:'-'?> |
$space[$x*2] = 1;
if($type[$x*2] == 0)
{
$type[$x*2] = 1;
} else {
$type[$x*2] = 0;
}
}
} else {
if ($y/2 != round($y/2))
{
if ($x != round($x))
{
if ($type[$x*2]==1)
{
?>
 |
} else {
?>
|
}
} else {
?>
|
}
} else {
$space[$x*2] = 0;
}
}
}
$addsp[$x*2]--;
if ($addsp[$x*2]<-1)
{
$addsp[$x*2] = $spacecount;
}
}
// starter list in center
$x = 0;
if (round(($y+1)/4)-(($y+1)/4)>0)
{
$num = round(($y+1)/4*2);
if ($tourney['status']<3)
{
$score = 0;
$name = $_s_starter.' '.$num;
} else {
$name = get_starter($tourney,$num);
$pos = round($num/2);
if ($field[$x][$num]['sid'] <=0)
{
$dolink = FALSE;
$name = get_starter($tourney,$field[$x][$num]['sid']);
} else {
$dolink = TRUE;
$name = get_starter($tourney,$field[$x][$num]['sid']);
}
}
if ($y/2 != round($y/2))
{
if (time()>$lastt[$x] && $tourney['fixed_times']=='y' && $field[$x][$num]['sc1']==0 && $field[$x][$num+1]['sc1']==0)
{
switch(rand(0,1))
{
case 0:
sql_delete($db['tourney_data'],"WHERE `tid`='$tid' AND `x`='$x' AND `y`='$pos'");
sql_insert($db['tourney_data'],"'$tid','$x','$pos','1','0','1','0','-','FORCED RESULT CAUSE OF TIME LIMIT'");
break;
case 1:
sql_delete($db['tourney_data'],"WHERE `tid`='$tid' AND `x`='$x' AND `y`='$pos'");
sql_insert($db['tourney_data'],"'$tid','$x','$pos','0','1','0','1','-','FORCED RESULT CAUSE OF TIME LIMIT'");
break;
}
}
?>
>=$dolink?plink("$PHP_SELF?module=$mod&amode=$amode&action=matchinfo&tid=$tid&x=$x&y=$pos",$name):$name?> |
>=$field[$x][$num]['sc1']?$field[$x][$num]['sc1']:'-'?> |
} else {
?>
>=$dolink?plink("$PHP_SELF?module=$mod&amode=$amode&action=matchinfo&tid=$tid&x=$x&y=$pos",$name):$name?> |
>=$field[$x][$num]['sc1']?$field[$x][$num]['sc1']:'-'?> |
}
}
elseif(round(($y+1)/4)==(($y+1)/4))
{
if (round(($y+1)/8)==(($y+1)/8))
{
$st = round(($y+1)/4*2);
?>
|
} else {
?>
 |
 |
}
}
// winner baket
for ($x = 1; $x < $rounds; $x++)
{
$spacecount = ((($fields/2)/(pow(2,$rounds-$x-1)/2))-1)*2;
if($addsp[$x]>0)
{
if ($y/2 != round($y/2))
{
if ($space[$x] == 0 || $x == $rounds-1)
{
?>
|
} else {
?>
 |
}
}
} else {
if($type[$x] == 0)
{
$cnum[$x]++;
$num = $cnum[$x];
$pos = round($num/2);
if ($field[$x][$num]['sid'] ==0)
{
$dolink = FALSE;
$name = '-';
}
elseif($field[$x][$num]['sid'] == -1)
{
$dolink = FALSE;
$name = get_starter($tourney,$field[$x][$num]['sid']);
} else {
$dolink = TRUE;
$name = get_starter($tourney,$field[$x][$num]['sid']);
}
if ($y/2 != round($y/2))
{
if (time()>$lastt[$x] && $tourney['fixed_times']=='y' && $field[$x][$num]['sc1']==0 && $field[$x][$num+1]['sc1']==0)
{
switch(rand(0,1))
{
case 0:
sql_delete($db['tourney_data'],"WHERE `tid`='$tid' AND `x`='$x' AND `y`='$pos'");
sql_insert($db['tourney_data'],"'$tid','$x','$pos','1','0','1','0','-','FORCED RESULT CAUSE OF TIME LIMIT'");
break;
case 1:
sql_delete($db['tourney_data'],"WHERE `tid`='$tid' AND `x`='$x' AND `y`='$pos'");
sql_insert($db['tourney_data'],"'$tid','$x','$pos','0','1','0','1','-','FORCED RESULT CAUSE OF TIME LIMIT'");
break;
}
}
?>
>=$dolink?plink("$PHP_SELF?module=$mod&amode=$amode&action=matchinfo&tid=$tid&x=$x&y=$pos",$name):$name?> |
>=$field[$x][$num]['sc1']?$field[$x][$num]['sc1']:'-'?> |
} else {
$type[$x] = 1;
?>
>=$dolink?plink("$PHP_SELF?module=$mod&amode=$amode&action=matchinfo&tid=$tid&x=$x&y=$pos",$name):$name?> |
>=$field[$x][$num]['sc1']?$field[$x][$num]['sc1']:'-'?> |
if ($space[$x] == 0)
{
$space[$x] = 1;
} else {
$space[$x] = 0;
}
}
} else {
if ($y/2 != round($y/2))
{
if ($space[$x] == 0)
{
?>
|
} else {
?>
 |
}
} else {
$type[$x] = 0;
}
}
}
$addsp[$x]--;
if ($addsp[$x]<-1)
{
$addsp[$x] = $spacecount;
}
}
?>
}
?>