Файл: vkollektive2014/search_ip.php
Строк: 76
<?php
include 'connect.php';
if($u['id']){
if($u['admin'] == 1){
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"><img src="ico/settings.gif"> Админка / Поиск по IP</div>';
echo '<div class="cred">';
echo '<a href = "adminka.php">Главная админки </a>';
echo '</div>';
$all = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` $where $ipq"), 0);
echo '<div class = "nav">Найдено: <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 $i % 2 ? '<div class="div">' : '<div class="div">';
if(ban($user['id'])){
echo ''.ico($user['sex'],$user['admin']).' <a href = "/page.php?id='.$user['id'].'"><del>'.$user['login'].'</del></a> '.online($user['online']).' ';
} else {
echo ''.ico($user['sex'],$user['admin']).' <a href = "/page.php?id='.$user['id'].'">'.$user['login'].'</a> '.online($user['online']).' ';
}
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
$vip = mysql_fetch_array(mysql_query("SELECT * FROM `vip_users` WHERE `id_user` = '".$user['id']."'"));
if((int)$vip['id'] > 0){ echo " <img src='/style/vip_icons/{$vip['icon']}.gif' />n"; }
echo '<br/>';
echo '<br/>';
echo '</div>';
echo '<div class="zona"><small>';
if($user['admin'] == 1) {
echo ' IP: 66.666.66.666';
echo ' Браузер: Opera ';
} else {
$ip = $user[ip];
echo ' IP: '.$ip.'';
$ua = $user[ua];
echo ' Браузер: '.$ua.'';
}
echo '</small></div>';
$i++;
}
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 || $user['id'] == 2) {
include 'head.php';
echo '<div class="div"><table><tr><td VALIGN=top><img src = "ico/close.png"></td><td VALIGN=center> <b>
Ошибка!</b>
отказано в доступе
</table></div>';
include 'foot.php';
exit;
}
$ip = $title.' | Поиск по IP';
include 'head.php';
echo '<div class="title"><img src="ico/settings.gif"> Админка / Поиск по IP</div>';
echo '<div class="cred">';
echo '<a href = "adminka.php">Главная админки </a>';
echo '</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"><img src="ico/error.gif" alt="Ошибка" /> Вам сюда нельзя!</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';
}
?>