<?php
#######################################################|#
#|                    HabboMCMS - TheRox
#|                    Powered by HoloCMS 
#|            Copyright 2011-2012 ALL RIGHTS RESERVED
#######################################################|#



require_once('../global.php');
if($hkzone !== true){ header("Location: index.php?throwBack=true"); exit; }
if(!session_is_registered(acp)){ header("Location: index.php?p=login"); exit; }

$pagename = "Rechercher l'IP";

if(isset($_POST['query'])){

	$check = mysql_query("SELECT username,ip_last,id FROM users WHERE username LIKE '" . Filter($_POST['query']) . "' LIMIT 1") or die(mysql_error());
	$result = mysql_num_rows($check);

	if($result > 0){
		$row = mysql_fetch_assoc($check);
		$msg = "<div class='alert success'><b>L'adresse IP troouvé est:</b><br />&nbsp;&nbsp;&nbsp;&nbsp;";
		$msg = $msg . $row['username'] . " (ID: " . $row['id'] . ") - IP Address: " . $row['ip_last'];
		$msg = $msg . "<br /><br />[<a href='http://who.is/whois-ip/ip-address/".$row['ip_last']."/' target='_blank'>Whois</a> | <a href='index.php?p=clonechecker&do=jackstart&key=".$row['ip_last']."'>Vérifiez les clones</a>]</div>";
	} else {
		$msg = "<div class='alert'>Désolé, cet utilisateur n'a pas été trouvé ou n'existe pas. S'il vous plaît vérifier votre orthographe et essayez à nouveau</div>";
	}

}

require_once('subheader.php');
require_once('header.php');
?>
<table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'>
<tr> <td width='22%' valign='top' id='leftblock'>
 <div>
 <!-- LEFT CONTEXT SENSITIVE MENU -->
<?php require_once('usermenu.php'); ?>
 <!-- / LEFT CONTEXT SENSITIVE MENU -->
 </div>
 </td>
 <td width='78%' valign='top' id='rightblock'>
 <div><!-- RIGHT CONTENT BLOCK -->
 
 
<form action='index.php?p=ip&do=search' method='post' name='theAdminForm' id='theAdminForm'>
<div class='tableborder'>
<div class='tableheaderalt'>Rechercher Utilisateur - retrouver son adresse IP</div>

<table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>
<tr>
<td class='tablerow1'  width='40%'  valign='middle'><strong>Pseudo</strong></td>
<td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='query' value="" size='30' class='textinput'></td>
</tr>

<tr>
<tr><td align='center' class='tablesubheader' colspan='2' ><input type='submit' value='Trouver l&#39;IP' class='realbutton' accesskey='s'></td></tr>
</form></table></div><br />	 </div><!-- / RIGHT CONTENT BLOCK -->
	 </td></tr>
</table>
</div><!-- / OUTERDIV -->
<div align='center'><br />
<?php
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
printf('Time: %.3f', $totaltime);
?>
</div>