Файл: iwup.biz/total/index.php
Строк: 47
<?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 />";
echo "<a href="totalall.php?ses=$ses">Все тиражи</a><br />";
if(!isset($_SESSION['kod777']))
$_SESSION['kod777']=rand(1,10000);
elseif(!$_SESSION['kod777'])
$_SESSION['kod777']=rand(1,10000);
$result=mysql_query("SELECT * from total WHERE timestart<$time and timeend>$time AND status=2 ORDER by tid ASC Limit 1");
if(!mysql_num_rows($result))
{
echo 'В данный момент нет доступного для ставок тиража<br />';
}
else
{
$total=mysql_fetch_assoc($result);
$dateend=date($format, $total['timeend']);
$res_sum=mysql_query("SELECT SUM(`summa`),count(*) from stav WHERE tid='$total[tid]'");
$sum=mysql_fetch_row($res_sum);
echo '<a href="total.php?ses='.$ses.'&id='.$total['tid'].'">На что ставят</a><br />';
echo "Тираж #$total[tid]<br />";
echo 'Ставки принимаются до:'.$dateend.'<br />';
if($total['djpot'])
echo 'Джек пот: '.$total['djpot'].' р. / '.$total['djpotsl'].'<br />';
echo 'Всего ставок: '.$sum[1].'/'.$sum[0].' р.<br />';
$opis=unserialize($total['opis']);
//echo "<a href="totalstav.php?ses=$ses&id=$total[tid]">Посмотреть ставки</a><br />";
echo '</div><form id="nf" action="stavadd.php?ses='.$ses.'&id='.$total['tid'].'&kd='.$_SESSION['kod777'].'" method="post" name="etre">';
echo $razd;
for($i=1; $i<16; $i++)
{
$date=date($format, $total['t'.$i]);
if(trim($opis[$i]))
echo '</div><div class="top">'.$opis[$i].'</div><div>';
echo '<b>'.$i.'.</b> '.$date.'<br />'.$total['s'.$i].'<br />';
$st[$i.'1']=intval(@$_POST['s'.$i.'1']);
$st[$i.'2']=intval(@$_POST['s'.$i.'2']);
$st[$i.'3']=intval(@$_POST['s'.$i.'3']);
if(!$st[$i.'1'])
echo '1. <input type="checkbox" name="s'.$i.'1" value="1" />';
else
echo '1. <input type="checkbox" name="s'.$i.'1" value="1" checked/>';
if(!$st[$i.'2'])
echo ' X. <input type="checkbox" name="s'.$i.'2" value="1" />';
else
echo ' X. <input type="checkbox" name="s'.$i.'2" value="1" checked/>';
if(!$st[$i.'3'])
echo ' 2. <input type="checkbox" name="s'.$i.'3" value="1" /><br />';
else
echo ' 2. <input type="checkbox" name="s'.$i.'3" value="1" checked/><br />';
echo $razd;
}
echo '<input type="submit" name="send" value="Сделать ставку">';
echo '</div></form><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).' -->';
?>