Вход Регистрация
Файл: adminka.php
Строк: 88
<?php
    
include('common.php');
    
$do getarg('do''');
    if(
islogged()){
        if(
checkadmin()){
            echo 
theader();
            if(
$do){
                if(
$do=='lang'){
                    if(isset(
$_POST['name']) && isset($_POST['file'])){
                        
$name=clean($_POST['name']);
                        
$file=clean($_POST['file']);
                        
mysql_query("insert into `language` set `name`='$name', `file`='$file'");
                        echo
'<div class="list2"><a href="/adminka.php">'.$lang['continue'].'</a></div>';
                    }else{
                        echo
'<div class="list2">
                        <form action="" method="post">
                        '
.$lang['admin']['lang_name'].':<br /><input type="text" name="name"/><br />
                        '
.$lang['admin']['lang_file'].':<br /><input type="text" name="file"/><br />
                        <input type="submit" value="'
.$lang['continue'].'"/></form></div>';
                    }
                }
                if(
$do=='set'){
                    if(isset(
$_POST['copy']) && isset($_POST['lang']) && isset($_POST['name'])){
                        
$copys=clean($_POST['copy']);
                        
$langs=clean($_POST['lang']);
                        
$names=clean($_POST['name']);
                        
mysql_query("update `settings` set `copy`='$copys', `lang`='$langs', `sitename`='$names' where `id`='1'");
                        echo
'<div class="list2"><a href="/">'.$lang['continue'].'</a></div>';
                    }else{
                        echo
'<div class="list2">
                        <form action="" method="post">
                        '
.$lang['sitename'].':<br /><input type="text" name="name"/><br/>
                        '
.$lang['admin']['set_copy'].':<br/><input type="text" name="copy" value="'.$set['copy'].'"/><br/>';
                        
$num=mysql_num_rows(mysql_query("select * from `language`"));
                        if(
$num){
                            
$query=mysql_query("select * from `language` order by `id`");
                            echo 
$lang['admin']['set_lang'].':<br/><select name="lang">';
                            while(
$res=mysql_fetch_assoc($query)){
                                echo
'<option value="'.$res['id'].'">'.$res['name'].'</option>';
                            }
                            echo
'</select>';
                        }
                        echo
'<input type="submit" value="'.$lang['continue'].'"/></form></div>';
                    }
                }
            }else{
                echo
'<div class="list2">
                <a href="?do=set">'
.$lang['admin']['sets'].'</a><br />
                <a href="?do=lang">'
.$lang['admin']['lang'].'</a></div>';
            }
        }else{echo
'<div class="list2">'.$lang['error'].'</div>';}
    }else{echo
'<div class="list2">'.$lang['error'].'</div>';}
    echo 
tfooter();
    exit();
?>
Онлайн: 2
Реклама