|
<?php
/*
-----------------------------------------
Автор: -=КотЭ=-(-=MTV=-) и Shot(Robber)
Бесплатный WAP движок: Strongcms
Контакты: 0664452670(МТС) ибо ICQ(7296000)
Файл: index.php
-------------------------------------------
*/
require_once ('../system/function.php');
//-----Подключаем вверх-----//
$id = abs(intval($_GET['id']));
$forum_t = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_tema` WHERE `id` = '".$id."'"));
$forum_r = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id` = '".$forum_t['razdel']."'"));
$forum_k = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_kat` WHERE `id` = '".$forum_t['kat']."'"));
$forum_zaklad = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_zaklad` WHERE `tema` = '".$id."' and `us` = '".$user['id']."' "));
if($forum_t == 0 or $forum_k == 0 or $forum_r == 0 or $user['level'] < 1 && $user['id'] != $forum_t['us']){
header('Location: /forum'); exit;
}
$title=''.$forum_t['name'].'';
if(!isset($user['id'])) {
echo err($title, '
Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь.
Мы рекомендуем Вам зарегистрироваться либо войти на сайт под своим именем.
');
require_once ('../system/footer.php');
exit;
}
require_once ('../system/header.php');
$forum_vote = mysql_fetch_array(mysql_query('select * from `forum_vote` where `t` = "'.$id.'" limit 1'));
if($forum_vote != 0){
mysql_query("DELETE FROM `forum_vote` WHERE `id` = '".$forum_vote['id']."'");
header('Location: /forum/t'.$id.'');
}else{
}
if(isset($_POST['submit'])){
$quest = strong($_POST['quest']);
$select_1 = strong($_POST['select_1']);
$select_2 = strong($_POST['select_2']);
$select_3 = strong($_POST['select_3']);
$select_4 = strong($_POST['select_4']);
$select_5 = strong($_POST['select_5']);
mysql_query("INSERT INTO `forum_vote` SET `t` = '".$id."', `quest` = '".$quest."', `select_1` = '".$select_1."', `select_2` = '".$select_2."', `select_3` = '".$select_3."', `select_4` = '".$select_4."', `select_5` = '".$select_5."'");
echo '<div class="podmenu"><b><center>Опрос добавлен!</center></b></div>';
require_once ('../system/footer.php'); exit;
}
echo '<div class="podmenu">
<form action="" method="post">
Вопрос:<br><input name="quest"/><br>
Вариант 1:<br><input name="select_1"/><br>
Вариант 2:<br><input name="select_2"/><br>
Вариант 3:<br><input name="select_3"/><br>
Вариант 4:<br><input name="select_4"/><br>
Вариант 5:<br><input name="select_5"/><br>
<input type="submit" value="Добавить" name="submit"/>
</form></div>';
require_once ('../system/footer.php');
?>