<?
include '../../config.php';
include '../../func.php';
head();
aut();
ban();

echo head ."Редактирование пользователя".div;

if (isset($_GET['id'])) {
    $id = num($_GET['id']);
    $user = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$id."'"));
    if ( isset($user['id']) ) {
        $_SESSION['panel_user'] = $user['id']; 
        header('Location: edit.php');
    } else {
        echo 'Пользователь не найден<br/>';
    }
} else {
if ( empty($_POST['submit']) ) {
    
    echo katalog . '<form action="index.php" method="post" name="form">
    <b>ID юзера:</b><br/>
    <input name="id" type="text" maxlength="15"/><br/>';
    echo '<input name="submit" class="submit" type="submit" value="Далее" /></form>' . div;
    
} else {
    
    $id = num($_POST['id']);
    $user = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$id."'"));
    if ( isset($user['id']) ) {
        
        $_SESSION['panel_user'] = $user['id']; 
        header('Location: edit.php');
    }
    
}

}

navig();
foot();
?>