View file admin_list/ban_p.php

File size: 2.15Kb
<?
define('SHCMS', true);
if($_GET['id']){$id_list = $_GET['id'];}
include_once'../system/inc/basic_settings.php';
$users = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$id_list'"));
$shcmsengine['title'] = 'Все нарушение пользователя '.$users['login'].'';
include_once'../template/head.php';
registrat();
$adminka ->admin();

$user4 = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$user_id'"));
if($user4['team'] < 6)
{
echo 'Ошибка';
header('Refresh: 1; url=/index.php?'.$conservation.'&');
	include_once'../template/foot.php';
exit();
}
include_once'secu.php';
if(!$id_list)
{echo '<div class="errors">Нет данных о пользователе</div>';
include_once'../template/foot.php';
exit();}

$ban_us = mysql_query("SELECT * FROM `ban_users` WHERE `user_id`='$id_list' ORDER BY `id` DESC");
$ban_list = mysql_fetch_array($ban_us); 
$admin_pol = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$ban_list[id_admin]'"));

/*
Удаление бана пользователя
*/
switch($act):
case'delete':
if(isset($_GET['id_ban'])){$id_ban = $_GET['id_ban'];}
$ok_ban = mysql_query("DELETE FROM `ban_users` WHERE `id`='$id_ban'");
if($ok_ban == true){
echo '<div class="actshcms">Нарушение пользователя удалено</div>';
header("Refresh: 1; url=ban_p.php?id=$id");
}else{
echo '<div class="errors">Возникла ошибка при удаление нарушения.</div>';
header("Refresh: 1; url=ban_p.php?id=$id");
}
break;
endswitch;
do{
echo '<div class="posts">';
echo '<a style="float:right" href="?act=delete&id='.$id_list.'&id_ban='.$ban_list['id'].'">Удалить</a>';
echo 'Забанил: '.$admin_pol['login'].'<br/>';
echo 'Нарушение: '.$ban_list['prichina'].'<br/>';
echo 'Причина бана: '.$ban_list['text'].'<br/>';
echo 'Начала бана: '.$timedate->when($ban_list['time_2']).'<br/>';
echo 'Окончание бана: '.$timedate->when($ban_list['time_1']).'';

echo '</div>';}
while($ban_list = mysql_fetch_array($ban_us));
include_once'../template/foot.php';
?>