Файл: breach.php
Строк: 44
<?php
require 'system/sid.php';
require 'system/config.php';
include 'system/user.php';
include 'system/head.php';
include 'system/navigator.php';
whorm(0, 'breach');
$nk = my_int($_GET['nk']);
if (!user_inf($nk))
{
header('Location: index.php');
die();
}
if (isset($_GET['x']))
{
if ($user['level'] < 4)
{
header('location: breachus-' . $nk);
die();
}
$x = my_int($_GET['x']);
$t = mysql_query("SELECT id FROM breach WHERE id = '$x' LIMIT 1");
if (mysql_num_rows($t) == false)
{
err('Запись не найдена!');
}
else
{
mysql_query("DELETE FROM breach WHERE id = '$x' LIMIT 1");
header('location: breachus-' . $nk);
}
}
if (isset($_GET['clear']))
{
if ($user['level'] < 4)
{
header('Location: breachus-' . $nk);
die();
}
mysql_query("DELETE FROM breach WHERE user = '$nk'");
header('Location: breachus-' . $nk);
}
echo $div_title . 'Нарушения/' . us($nk) . $div_end;
$count = mysql_result(mysql_query("SELECT COUNT(id) FROM `breach` WHERE user = '$nk'"), 0);
if ($count != FALSE) {
$n = new navigator($count, 10, 'breachus-'.$nk.'&');
$select = mysql_query("SELECT * FROM `breach` WHERE user = '$nk' ORDER BY id DESC {$n->limit}");
$i = 0;
while($a = mysql_fetch_assoc($select))
{
if ($user['level'] == 4 || $user['level'] == 5) $d = '<a href="breachx-'.$nk.'-'.$a['id'].'"><img src="ico/delete.png" alt=""/></a> ';
echo ($i ++ % 2) ? $div_tworazdel : $div_razdel;
echo $d . $a['text'] . $div_end;
}
echo $n->navi();
} else {
echo 'Нарушений не найдено!<br/>';
}
echo '« <a href="/id'.$nk.'">В анкету</a><br/>';
if ($user['level'] == 4 || $user['level'] == 5)
{
echo '<a href="breachus-'.$nk.'&clear">Очистить все</a><br/>';
}
include 'system/foot.php';
?>