Вход Регистрация
Файл: iwup.biz/total/admin/totalizm.php
Строк: 78
<?php
$mt
=microtime(1);
include(
'../../db.php');
include(
'../../ses.php');
include(
'../../auth.php');
include(
'../../nast.php');
include(
'../../shapka.php');
$format='d/m/Y H:i';

if(!
$_SESSION['auth'])
    {
    print 
'Авторизация не удалась.Возможго вы ввели неверный логин или пароль, либо истекло время жизни сессии<br /><a href="../../index.php">повторить ввод</a><br />';
    }
else
    {
    
$info=mysql_fetch_assoc(mysql_query("SELECT * from user WHERE uid='$_SESSION[uid]'"));
    if(
$info['status']<4)
        {
        echo 
'Нет доступа<br />';
        exit;
        }
    else
        {
        
$id=intval(@$_GET['id']);
        
$result=mysql_query("SELECT * from total WHERE tid='$id'");
        if(!
mysql_num_rows($result))
            {
            echo 
'Указанного тиража не существует<br />';
            }
        elseif(!isset(
$_GET['act']))
            {
            
$tir=mysql_fetch_assoc($result);
            
$opis=unserialize($tir['opis']);
            echo 
'</div><form id="FormName" action="totalizm.php?ses='.$ses.'&amp;act=do&amp;id='.$id.'" method="post" name="FormName"><div>
            Дата начала приема ставок: <br />
            <input name="timestart" maxlength="100" value="'
.date('d/m/Y H:i:s',$tir['timestart']).'"/><br/>
            Дата окончания приема ставок: <br />
            <input name="timeend" maxlength="100" value="'
.date('d/m/Y H:i:s',$tir['timeend']).'"/><br/>
            Возможные события: <br />'
;
            for(
$i=1$i<16$i++)
                {
                
$date=date('d/m/Y H:i:s'$tir['t'.$i]);
                print 
"Заголовок/разделитель $i: <input name="r$i" maxlength="100" value="$opis[$i]"/><br/>";
                print 
"Событие $i: <input name="s[$i]" maxlength="100" value="".$tir['s'.$i].""/><br/>";
                print 
"Время события $i: <input name="k[$i]" maxlength="100" value="$date"/><br/>";
                }
            echo 
'<input type="submit" name="submitButtonName" value="Изменить"></div></form><div>';
            }
        else
            {
            
$err='';
            
$err='';
            
$timestart=$_POST['timestart'];
            
//Обрабатываю дату<br />
            
$split=explode(' '$timestart);
            
$j=explode('/',$split[0]);
            
$dst=intval($j[0]);
            
$mst=intval($j[1]);
            
$yst=intval($j[2]);
            
$j=explode(':',$split[1]);
            
$Hst=intval($j[0]);
            
$ist=intval($j[1]);
            
$sst=intval($j[2]);
            
$timest=mktime($Hst$ist$sst$mst$dst$yst);
            
//
            
$timeend=$_POST['timeend'];
            
//Обрабатываю дату<br />
            
$split=explode(' '$timeend);
            
$j=explode('/',$split[0]);
            
$dst=intval($j[0]);
            
$mst=intval($j[1]);
            
$yst=intval($j[2]);
            
$j=explode(':',$split[1]);
            
$Hst=intval($j[0]);
            
$ist=intval($j[1]);
            
$sst=intval($j[2]);
            
$timeend=mktime($Hst$ist$sst$mst$dst$yst);
            
//
            
if($timeend<=$timest)
            
$err.="Ошибка!Дата окончания приема ставок должна быть раньше даты тиража <br />";
            for(
$i=1$i<16$i++)
                {
                
//echo $_POST['r'][$i];
                //$razd[$i]=$_POST['r'][$i];
                //echo $razd[$i];
                
$a[$i]=mysql_real_escape_string(htmlspecialchars($_POST['r'.$i]));
                
//echo $a[$i].'<br />';
                
$sob[$i]=mysql_escape_string(htmlspecialchars(trim($_POST['s'][$i])));
                
$times=mysql_real_escape_string($_POST['k'][$i]);
                if(!
$sob[$i])
                
$err.='Не указано событие #'.$i.'<br />';
                
$split=explode(' '$times);
                
$j=explode('/',$split[0]);
                
$dst=intval($j[0]);
                
$mst=intval($j[1]);
                
$yst=intval($j[2]);
                
$j=explode(':',$split[1]);
                
$Hst=intval($j[0]);
                
$ist=intval($j[1]);
                
$sst=intval($j[2]);
                
$tm[$i]=mktime($Hst$ist$sst$mst$dst$yst);
                if(!
$tm[$i])
                    {
                    
$err.='Неверно указано время события #'.$i.'<br />';
                    }
                }
            
            if(
$err)
                {
                echo 
$err;
                }
            else
                {
                echo 
'Тираж изменен<br />';
                
$opis=serialize($a);
                
mysql_query("UPDATE total SET `timestart`='$timest',
                `timeend`='
$timeend',
                s1='
$sob[1]',
                s2='
$sob[2]',
                s3='
$sob[3]',
                s4='
$sob[4]',
                s5='
$sob[5]',
                s6='
$sob[6]',
                s7='
$sob[7]',
                s8='
$sob[8]',
                s9='
$sob[9]',
                s10='
$sob[10]',
                s11='
$sob[11]',
                s12='
$sob[12]',
                s13='
$sob[13]',
                s14='
$sob[14]',
                s15='
$sob[15]',
                t1='
$tm[1]',
                t2='
$tm[2]',
                t3='
$tm[3]',
                t4='
$tm[4]',
                t5='
$tm[5]',
                t6='
$tm[6]',
                t7='
$tm[7]',
                t8='
$tm[8]',
                t9='
$tm[9]',
                t10='
$tm[10]',
                t11='
$tm[11]',
                t12='
$tm[12]',
                t13='
$tm[13]',
                t14='
$tm[14]',
                t15='
$tm[15]',
                `opis`='
$opis' WHERE tid='$id'")or die(mysql_error());

                }
            }
        echo 
$razd;
        echo 
'</div><div class="down"><a href="index.php?ses='.$ses.'">Управление тотализатором</a><br /></div><div>';
    if(
$info['status']>4)
        print 
'</div><div class="down"><a href="../../admin.php?ses='.$ses.'">Админ-панель</a><br /></div><div>';
        else
        print 
'</div><div class="down"><a href="../../bukmod.php?ses='.$ses.'">Букмекер-панель</a><br /></div><div>';
        }
    echo 
$razd;
    echo 
'</div><div class="down"><a href="../../enter.php?ses='.$ses.'">Личный кабинет</a><br /></div><div>';
    }

include(
'../../foot.php');
echo 
'<!--'.(microtime(1)-$mt).'-->';
?>
Онлайн: 2
Реклама