Файл: iwup.biz/total/stavlook.php
Строк: 69
<?php
$mt=microtime(1);
include('../db.php');
include('../ses.php');
include('../auth.php');
include('../nast.php');
include('../shapka.php');
if(!$_SESSION['auth'])
{
print 'Авторизация не удалась.Возможго вы ввели неверный логин или пароль, либо истекло время жизни сессии<br /><a href="../index.php">повторить ввод</a><br />';
}
else
{
echo '</div><div class="top">Просмотр ставки</div><div>';
$info=mysql_fetch_assoc(mysql_query("SELECT * from user WHERE uid='$_SESSION[uid]'"));
$id=intval(@$_GET['id']);
$result=mysql_query("SELECT * from stav WHERE sid='$id' Limit 1");
if(!mysql_num_rows($result))
{
echo 'Указаной ставки не существует<br />';
}
else
{
$stav=mysql_fetch_assoc($result);
if($stav['uid']!=$_SESSION['uid'])
echo 'Вы не можете просматривать чужие ставки<br />';
else
{
$num=$stav['sid'];
while(strlen($num)<6)
$num='0'."$num";
$num='1'.$num;
$date=date($format, $stav['time']);
echo 'Билет №'.$num.'<br />';
echo '<a href="total.php?ses='.$ses.'&id='.$stav['tid'].'">Тираж №'.$stav['tid'].'</a><br />';
echo 'Дата:'.$date.'<br />';
echo 'Сумма: '.$stav['summa'].' руб. <br />';
echo "Ставок в купоне: $stav[count]<br />";
echo "Каждая ставка по: ".round($stav['summa']/$stav['count'],2)."р. <br />";
$res_total=mysql_query("SELECT * from total WHERE tid='$stav[tid]' Limit 1");
$total=mysql_fetch_assoc($res_total);
$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);
$st=0;
switch($total['status'])
{
case 1: $status='отменен';
$st=1; break;
case 2:
if($total['timestart']>$time)
$status='объявлен';
elseif($total['timeend']>$time and $tnow['tid']==$total['tid'])
$status='прием ставок';
else
{$status='идет розыгрыш';$st=0;}
break;
case 3: $status='завершен'; $st=1;
}
echo "Статус: $status<br />";
$opis=unserialize($total['opis']);
$r=unserialize($total['result']);
//echo $r;
//print_r($r);
for($i=1; $i<16; $i++)
{
$date=date($format, $total['t'.$i]);
if(trim($opis[$i]))
echo '<div class="top">'.$opis[$i].'</div>';
echo '<b>'.$i.'. </b>'.$date.'<br /> '.$total['s'.$i].': ';
$s=0;
if($stav['s'.$i]%2==0)
{
echo '1';
$s++;
}
if($stav['s'.$i]%3==0)
{
echo 'X';
}
if($stav['s'.$i]%5==0)
{
echo '2';
}
if(!isset($r['sob'][$i]))
{
$r['sob'][$i]='? - ?';
$r['res'][$i]=0;
}
if(!$r['sob'][$i])
$r['sob'][$i]='? - ?';
echo '<br /> Счет: '.$r['sob'][$i].'<br />';
echo $razd;
}
if(!$stav['win'])
$stav['win']=0;
if($st and $total['status']!=1)
echo "Выигрышь: $stav[win]<br />";
elseif($st and $total['status']==1)
echo "Выигрышь: $stav[summa]<br />";
else
echo "Выигрышь: ? руб. <br />";
$win=unserialize($stav['totalwin']);
if($stav['win']>0 and $total['status']==3)
echo "15 из 15 $win[p1] ст. ".round($win['ww15'],2)." руб.<br />
14 из 15 $win[p2] ст. ".round($win['ww14'],2)." руб. <br />
13 из 15 $win[p3] ст. ".round($win['ww13'],2)." руб.<br />
12 из 15 $win[p4] ст. ".round($win['ww12'],2)." руб.<br />
11 из 15 $win[p5] ст. ".round($win['ww11'],2)." руб.<br />
10 из 15 $win[p6] ст. ".round($win['ww10'],2)." руб.<br />
9 из 15 $win[p7] ст. ".round($win['ww9'],2)." руб.<br />
";
}
}
echo $razd;
echo '</div><div class="down"><a href="stav.php?ses='.$ses.'">Ваши ставки</a><br /></div><div>';
echo '</div><div class="down"><a href="index.php?ses='.$ses.'">Тотализатор</a><br /></div><div>';
}
echo '</div><div class="down"><a href="../enter.php?ses='.$ses.'">Личный кабинет</a></div><div>';
include('../foot.php');
echo '<!-- '.(microtime(1)-$mt).' -->';
?>