Вход Регистрация
Файл: vxas.ru/adm_panel/spam.php
Строк: 224
<?
include_once '../sys/inc/start.php';
include_once 
'../sys/inc/compress.php';
include_once 
'../sys/inc/sess.php';
include_once 
'../sys/inc/home.php';
include_once 
'../sys/inc/settings.php';
$temp_set=$set;
include_once 
'../sys/inc/db_connect.php';
include_once 
'../sys/inc/ipua.php';
include_once 
'../sys/inc/fnc.php';
include_once 
'../sys/inc/adm_check.php';
include_once 
'../sys/inc/user.php';
user_access('adm_set_sys',null,'index.php?'.SID);
adm_check();

$set['title']='АнтиСпам';
include_once 
'../sys/inc/thead.php';
title();
if(!isset(
$_GET['edit'])){
if(isset(
$_GET['del']))
{
$id_message = ( int ) $_GET ['id'];
$q mysql_query "SELECT * FROM `spam` WHERE `id` = '".mysql_real_escape_string($id_message)."' LIMIT 1" );

if (! 
mysql_num_rows $q )) {
        
header 'Refresh: 1; url=?' );
    echo 
'<div class="err">Антиспам-замена не найдена</div>';
    include_once 
'../sys/inc/tfoot.php';
    exit ();
}
else
{
mysql_query "DELETE FROM `spam` WHERE `id` = '".mysql_real_escape_string($id_message)."' LIMIT 1" );
echo  
'<div class="msg">Успешно</div>';
}
}


if(isset(
$_POST['eto']) || isset($_POST['na']))
{

$eto esc($_POST ['eto']);
$a esc($_POST ['a']);
$act mysql_real_escape_string($_POST ['act']);
$ban mysql_real_escape_string($_POST ['ban']);
$ban_time mysql_real_escape_string($_POST ['ban_time']);
$spam_level mysql_real_escape_string($_POST ['spam_level']);
if(
$ban=='0')$ban_time='0';
$q mysql_query "SELECT * FROM `spam` WHERE `na` = '".mysql_real_escape_string($a)."' AND `eto` = '".mysql_real_escape_string($eto)."' LIMIT 1" );
$q mysql_query "SELECT * FROM `spam` WHERE `eto` = '".mysql_real_escape_string($eto)."' LIMIT 1" );

if (
mysql_num_rows $q ) != || mysql_num_rows $q ) != ) {
        
header 'Refresh: 1; url=?' );
    echo 
'<div class="err">Ошибка! Такая запись уже есть в базе!</div>';
    include_once 
'../sys/inc/tfoot.php';
    exit ();
}
if(
$eto == '' || $a == '' || $ban_time == ''){echo '<div class="err">Заполните все поля</div>';

header 'Refresh: 1; url=?');
include_once 
'../sys/inc/tfoot.php';exit;
}
mysql_query("INSERT INTO `spam` (`eto`,`na`,`ban`,`ban_time`,`act`,`spam_level`) VALUES ('".mysql_real_escape_string($eto)."','".mysql_real_escape_string($a)."','".mysql_real_escape_string($ban)."','".mysql_real_escape_string($ban_time)."','".mysql_real_escape_string($act)."','".mysql_real_escape_string($spam_level)."')");
echo 
'<div class="msg">Успешно</div>';

}
echo 
"<center><form method='post' action='?$passgen'>n";
echo 
"Адрес:<br /><input type='text' name='eto' maxlength='320' /><br />n";
echo 
"Заменяем на:<br /><textarea name='a'></textarea><br />n";
echo 
"<label><input type='checkbox' checked='checked' name='act' value='1' />Запись активна</label><br />n";
echo 
"<label><input type='checkbox' name='ban' value='1' />АвтоБАН</label><br />n";
echo 
"Банить на(в минутах):<br /><input type='text' name='ban_time' value='0' maxlength='320' /><br />n";
echo 
"Уровень спама увеличивается на:<br /><input type='text' name='spam_level' value='0' maxlength='320' /><br />n";
echo 
"<input type='submit' value='Добавить' />n";
echo 
"</form><br /></center>n";
}

else
{

$id_message = ( int ) $_GET ['id'];
$q mysql_fetch_assoc(mysql_query "SELECT * FROM `spam` WHERE `id` = '".mysql_real_escape_string($id_message)."' LIMIT 1" ));

if (
$q['id']==0) {
        
header 'Refresh: 1; url=?' );
    echo 
'<div class="err">Антиспам-замена не найдена</div>';
    include_once 
'../sys/inc/tfoot.php';
    exit ();
}
if(isset(
$_POST['eto']) && isset($_POST['na']))
{
$na=esc($_POST['na']);
$eto=esc($_POST['eto']);
$act mysql_real_escape_string($_POST ['act']);
$ban mysql_real_escape_string($_POST ['ban']);
$ban_time mysql_real_escape_string($_POST ['ban_time']);
$spam_level mysql_real_escape_string($_POST ['spam_level']);
if(
$ban=='0')$ban_time='0';
mysql_query("UPDATE `spam` SET `eto`='".mysql_real_escape_string($eto)."',`na`='".mysql_real_escape_string($na)."',`act`='".mysql_real_escape_string($act)."',`ban`='".mysql_real_escape_string($ban)."',`ban_time`='".mysql_real_escape_string($ban_time)."',`spam_level`='".mysql_real_escape_string($spam_level)."' WHERE `id`='".mysql_real_escape_string($q['id'])."'");
msg('Успешно');
header 'Refresh: 1; url=?' );
    include_once 
'../sys/inc/tfoot.php';
    exit ();
}
echo 
"<center><form method='post' action='?edit&amp;id=".htmlspecialchars($q['id'])."&amp;$passgen'>n";
echo 
"Адрес:<br /><input type='text' name='eto' maxlength='320' value='".htmlspecialchars($q['eto'])."' /><br />n";
echo 
"Заменяем на:<br /><textarea name='na'>".htmlspecialchars($q['na'])."</textarea><br />n";
if(
$q['act']=='1')$act="checked='checked'";
echo 
"<label><input type='checkbox' $act name='act' value='1' />Запись активна</label><br />n";
if(
$q['ban']=='1')$ban="checked='checked'";
echo 
"<label><input type='checkbox' name='ban' $ban value='1' />АвтоБАН</label><br />n";
echo 
"Банить на(в минутах):<br /><input type='text' name='ban_time' value='".htmlspecialchars($q['ban_time'])."' maxlength='320' /><br />n";
echo 
"Уровень спама увеличивается на:<br /><input type='text' name='spam_level' value='".htmlspecialchars($q['spam_level'])."' maxlength='320' /><br />n";
echo 
"<input type='submit' value='Изменить' />n";
echo 
"</form></center>n";


}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `spam`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];

if (
$k_post==0)
{
echo 
"<table class='post'>n";
echo 
"   <tr>n";
echo 
"  <td class='p_t'>n";
echo 
"Нет результатовn";
echo 
"  </td>n";
echo 
"   </tr>n";
echo 
"</table>n";
}
$q=mysql_query("SELECT * FROM `spam` ORDER BY `id` DESC LIMIT $start$set[p_str]");
while (
$s mysql_fetch_assoc($q))
{
echo 
"<table class='post'>n";


echo 
"<tr><td class='icon14'>n";
echo 
"<img src='/style/my_menu/stop.png' alt='' />";
echo 
"  </td>n";

echo 
"<td class='p_t'>n";
echo 
'Спам: <font color="red">'.htmlspecialchars($s['eto']).'</font> заменено на: <font color="green">'.htmlspecialchars($s['na']).'</font></tr><tr>';
if(
$s['act']=='1')$act='<font color="green">Активная запись</font><br />';else $act='<font color="red">Неактивная запись</font><br />';
if(
$s['ban']=='1')$ban='<font color="green">АвтоБАН активен : '.htmlspecialchars($s['ban_time']).' минут</font><br />';else $ban='<font color="red">АвтоБАН неактивен</font><br />';
echo 
'</td><td class="p_m" colspan="2">'.$act.''.$ban.'Уровень спама : '.htmlspecialchars($s['spam_level']).'<center>[<a href="?del&amp;id='.htmlspecialchars($s['id']).'">Удалить</a>][<a href="?edit&amp;id='.htmlspecialchars($s['id']).'">Изменить</a>]</center></td></tr><br />';

echo 
"</table>n";
}

if (
$k_page>1)str("?",$k_page,$page); // Вывод страниц


include_once '../sys/inc/tfoot.php';
?>
Онлайн: 1
Реклама