Файл: style/adm.php
Строк: 35
<?
# ALL author: XxxDIABLOxxX
# Nefest module
# pfofiwn.com
require_once 'core/system.php';
echo only_reg();
$header = 'Админ Панель!';
require_once 'core/head.php';
if($user[access] < 3) {
header('Location: /index.php');
$_SESSION['err'] = 'Доступ закрыт!';
}
switch($_GET['act'])
{
default:
?>
<div class='listing-information-two'>
<div class='mt5 small'>
<a href='/adm/news'><img src='/images/1.gif'> Создать новость</a></div></div>
<?
break;
case 'wall_news':
if(isset($_POST['title']) && isset($_POST['msg'])) {
$title = $_POST['title'];
$msg = $_POST['msg'];
$time = time();
$id_user = $user[id];
if(strlen($title) < 3 or strlen($name) > 30) $err = 'Длина названия должна быть в пределах 3 - 30 символов';
if(!isset($err)) {
mysql_query("INSERT INTO `news` SET `title` = '$title', `msg` = '$msg', `time` = '$time', `id_user` = '$id_user'");
mysql_query("update `user` set `news_read` = '1'");
header('Location: /news');
$_SESSION['message'] = 'Новость добавлена';
exit();
}else{
header('Location: ?');
$_SESSION['err'] = $err;
exit();
}
}else{
header('Location: ?');
$_SESSION['err'] = 'Введите данные';
exit();
}
break;
case 'news':
?>
<div class='listing-information-two'>
<div class='mt5 small'>
<form method="post" action="/adm?act=wall_news">
Введите заголовок:<br />
<input type="select" name="title" /><br />
Введите сообщение:<br />
<textarea name="msg" class = "select" rows="4" cols="30"></textarea>
<input class="label" type="submit" value="Создать"></form></div></div>
<div class='listing-information-two'>
<div class='mt5 small'>
<a href='/adm'><img src='/images/1.gif'> Назад</a></div></div>
<?
# Конец
break;
}
require_once 'core/foot.php';
?>