Размер файла: 3.46Kb
<?php
require_once('includes/db.php');
require_once('includes/config.php');
require_once('includes/auth.php');
if(isset($_POST['cancel']))
{
header('Location: sites.php');
exit;
}
$error = '';
$message = '';
if(isset($_POST['edit']))
{
if($_POST['name'] != '')
{
mysql_query('UPDATE users SET name = "' . $_POST['name'] . '", surname = "' . $_POST['surname'] . '", email = "' . $_POST['email'] . '", banner = "' . $_POST['banner'] . '", active = "' . $_POST['active'] . '", block_date = CURRENT_TIMESTAMP WHERE id = "' . $_POST['id'] . '"');
if($_POST['password'] != '')
mysql_query('UPDATE users SET password = "' . md5($_POST['password']) . '" WHERE id = "' . $_POST['id'] . '"');
$message = SECTION_WAS_SUCCESSFULLY;
header('Location: sites.php');
exit;
}
else
{
$error = EMPTY_NAME_FIELD;
}
}
require_once('includes/header.php');
?>
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="addbg"><td align="center" background="images/t5.gif"><font color="#FFFFFF"></font>
<font class="header">
<?php echo EDIT_SECTION; ?>
</font></td>
</tr></table><br>
<div align="center">
<font class="succ">
<?php echo $message; ?>
</font><br>
</div>
<div align="center">
<font class="error">
<?php echo $error; ?>
</font><br>
</div>
<?php
$categories = mysql_query('SELECT id, login, active, name, surname, email, banner FROM users WHERE id = "' . $_GET['id'] . '"');
$i = 1;
$category = mysql_fetch_array($categories, MYSQL_ASSOC);
?>
<br>
<table align="center" width="99%" border="0" cellspacing="1" cellpadding="3">
<form action="" method="post">
<tr class="addbg"><td width="20%">
Домен:
</td><td width="80%">
<?php echo $category['login']; ?>
</td>
</tr>
<tr><td width="20%">
Имя:
</td><td width="80%">
<input type="text" name="name" value="<?php echo $category['name']; ?>" style="width:100%;">
</td>
</tr>
<tr class="addbg"><td>
Фамилия:
</td><td>
<input type="text" name="surname" value="<?php echo $category['surname']; ?>" style="width:100%;">
</td>
</tr>
<tr><td>
Пароль:
</td><td>
<input type="text" name="password" value="" style="width:100%;">
</td>
</tr>
<tr class="addbg"><td>
E-mail:
</td><td>
<input type="text" name="email" value="<?php echo $category['email']; ?>" style="width:100%;">
</td>
</tr>
<tr><td>
Баннер:
</td><td>
<select name="banner" id="banner" >
<option value="top"<?php if($category['banner'] == 'top') echo ' selected'; ?>>Вверху</option>
<option value="bottom"<?php if($category['banner'] == 'bottom') echo ' selected'; ?>>Внизу</option>
<option value="none"<?php if($category['banner'] == 'none') echo ' selected'; ?>>Нет</option>
</select>
</td>
</tr>
<tr class="addbg"><td>
Блокирован:
</td><td>
<select name="active" id="active" >
<option value="1"<?php if($category['active'] == '1') echo ' selected'; ?>>Нет</option>
<option value="0"<?php if($category['active'] == '0') echo ' selected'; ?>>Да</option>
</select>
</td>
</tr>
<tr><td colspan="2" align="center">
<br>
<input type="hidden" name="id" value="<?php echo $category['id']; ?>">
<input type="hidden" value="" name="pg">
<input type="submit" name="edit" value="<?php echo EDIT; ?>">
<input type="submit" name="cancel" value="<?php echo CANCEL; ?>">
</td></tr>
</form>
</table>
<?php
require_once('includes/footer.php');
?>