Файл: iwup.biz/total/totalall.php
Строк: 30
<?php
$mt=microtime(1);
include('../db.php');
include('../ses.php');
include('../auth.php');
include('../nast.php');
include('../shapka.php');
echo '</div><div class="top">Тотализатор</div><div>';
$result=mysql_query("SELECT * from total ORDER by tid DESC");
$page=intval(@$_GET['page']);
$start=$page*$tirstr;
$end=$page+$tirstr;
if(!@mysql_data_seek($result, $start))
$page=0;
if($_SESSION['auth'])
echo "<a href="stav.php?ses=$ses">Ваши ставки</a><br />";
$res_t=mysql_query("SELECT * from total WHERE timestart<$time and timeend>$time AND status=2 ORDER by tid ASC Limit 1");
$tnow=mysql_fetch_assoc($res_t);
while($total=mysql_fetch_assoc($result))
{
$nolook=0;
switch($total['status'])
{
case 1: $status='отменен'; break;
case 2:
if($total['timestart']>$time)
{
$status='объявлен';
continue;
}
elseif($total['timeend']>$time and $tnow['tid']==$total['tid'])
$status='прием ставок';
else
$status='идет розыгрыш';
break;
case 3: $status='завершен';
}
echo "<a href="total.php?ses=$ses&id=$total[tid]">Тираж #$total[tid] ($status)</a><br />";
$start++;
if($start>=$end)
break;
}
echo $razd;
if($page>0)
echo '<a href="totalall.php?ses='.$ses.'&page='.($page-1).'">Назад</a><br />';
if(mysql_num_rows($result)>$end)
echo '<a href="totalall.php?ses='.$ses.'&page='.($page+1).'">Далее</a><br />';
echo '</div><div class="down"><a href="index.php?ses='.$ses.'">Тотализатор</a><br /></div><div>';
if(@$_SESSION['auth'])
print '</div><div class="down"><a href="../enter.php?ses='.$ses.'">Личный кабинет</a><br /></div><div>';
else
print '</div><div class="down"><a href="../index.php">Игровой клуб</a><br /></div><div>';
include('../foot.php');
echo '<!-- '.(microtime(1)-$mt).' -->';
?>