Файл: search_ip.php
Строк: 58
<?php
require_once("core/core.php");
if ($u['id']) {
if ($u['admin'] == 1 || $u['admin'] == 2) {
if (isset($_GET['submit'])) {
$ip = check(substr($_GET['ip'], 0, 100));
header("Location: search_ip.php?act=go&ip=$ip");
}
switch ($_GET['act']) {
case 'go':
if ($u['setting_users_list'])
$count = $u['setting_users_list']; else
$count = 10;
$ip = check(substr($_GET['ip'], 0, 100));
if ($ip)
$ipq = "AND `ip` = '" . $ip . "'"; else
$ipq = "";
if ($ipq)
$where = "WHERE `id` > '0'"; else
$where = "";
$title = $title . ' :: Поиск по IP';
include 'head.php';
echo '<div class="title"><center><a href="adminka.php">Админка</a> :: Поиск по IP</center></div>';
$all = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` $where $ipq"), 0);
echo '<div class = "title">Найдено: <b>' . $all . '</b> пользователей</div>';
if ($all > 0) {
$total = intval(($all - 1) / $count) + 1;
$page = num($_GET['page']);
if (empty($page) or $page < 0)
$page = 1;
if ($page > $total)
$page = $total;
$start = $page * $count - $count;
$result = mysql_query("SELECT * FROM `users` $where $ipq ORDER BY rating DESC LIMIT $start, $count");
while ($user = mysql_fetch_assoc($result)) {
echo '<div class="title">';
if (ban($user['id'])) {
echo '' . ico($user['sex'], $user['admin']) . ' <a href = "/id' . $user['id'] . '"><del>' . $user['login'] . '</del><b><font color="#79358c">' . online($user['online']) . '</font></b></a>';
} else {
echo '' . ico($user['sex'], $user['admin'], $user['online']) . ' <a href = "/id' . $user['id'] . '"><b><font color="#79358c">' . $user['login'] . '</font></b></a>';
}
echo '</div>';
echo '<div class="div"><small>';
if ($user['admin'] == 1) {
echo ' IP: 66.666.66.666';
echo ' Браузер: Opera by Admin';
} else {
$ip = $user[ip];
echo ' IP: ' . $ip . '';
$ua = $user[ua];
echo ' Браузер: ' . $ua . '';
}
echo '</small></div>';
}
navigation($page, $total, 'search_ip.php?act=go&ip=' . $ip . '&');
} else {
echo '<div class="div"> Пользователей с идентичными IP не найдено !</div>';
}
echo '</div>';
include 'foot.php';
break;
default:
if (isset($_GET['id'])) {
$id = num($_GET['id']);
$req = mysql_query("SELECT * FROM `users` WHERE `id` = '$id' LIMIT 1");
if (mysql_num_rows($req)) {
$user = mysql_fetch_assoc($req);
}
}
if (empty($user['id'])) {
$req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
$user = mysql_fetch_assoc($req);
}
if ($user['id'] == 1) {
include 'head.php';
echo '<div class="div"><b>
Ошибка!</b>
отказано в доступе</div>';
include 'foot.php';
exit;
}
$title = $title . ' :: Поиск по IP';
include 'head.php';
echo '<div class="title"><center><a href="adminka.php">Админка</a> :: Поиск по IP</center></div>';
echo '<div class="div">';
echo '<form action="search_ip.php" method=get>';
$ip = check($user[ip]);
echo 'IP: пользователя<br/><input type="text" name="ip" maxlength="50" value=' . $ip . '><br/>';
echo '<input type=submit name="submit" value="Поиск" class="submit white"/></form>';
echo '</div>';
include 'foot.php';
break;
}
} else {
echo '<div class="div">ыыыы лол</div>';
}
} else {
include 'head.php';
header("Refresh: 3; URL=index.php");
echo '<div class="div"><img src="ico/error.gif" alt="Ошибка" /> Ошибка, такой страницы нет!
</br>
Через <b>3 сек</b>. вы будете перенаправлены на новую страницу.
</div>';
include 'foot.php';
}
?>