<?php


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

$pagename = "Cerca Cloni";

if($do == "jackstart" && isset($key)){
$query = $key;
}

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

	$get_users = mysql_query("SELECT id,username,mail,ipaddress_last,hbirth FROM users WHERE ipaddress_last = '" . FilterText($_POST['query']) . "' ORDER BY username ASC") or die(mysql_error());
	$results = mysql_num_rows($get_users);

	if($results > 0){
		$msg = "Risultati:";
	} else {
		$msg = "Nessun indiritto ip Trovato.";
	}

	$query = FilterText($_POST['query']);

}

@include('subheader.php');
@include('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 @include('usermenu.php'); ?>
 <!-- / LEFT CONTEXT SENSITIVE MENU -->
 </div>
 </td>
 <td width='78%' valign='top' id='rightblock'>
 <div><!-- RIGHT CONTENT BLOCK -->
 
<?php if(isset($msg)){ ?><p><strong><?php echo $msg; ?></p></strong><?php } ?>
 
<form action='index.php?p=clonechecker&do=search' method='post' name='theAdminForm' id='theAdminForm'>
<div class='tableborder'>
<div class='tableheaderalt'>Cerca clone utente</div>

<table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>
<tr> 
</tr>
<strong> Inserisci alla tua destra l'Indirizzo IP dell'utente</strong>
<tr><td class='tablerow1'  width='40%'  valign='middle'><strong></strong>
<div class='graytext'>L'indirizzo IP  utente lo trovi <a href='index.php?p=ip'>CLICCANDO QUI !</a></div></td>
<td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='query' value="<?php echo $query; ?>" size='30' class='textinput'></td>
</tr>

<tr>
<tr><td align='center' class='tablesubheader' colspan='2' ><input type='submit' value=' CERCA ' class='realbutton' accesskey='s'></td></tr>
</form></table></div><br />

<?php if($results > 0){ ?>
 <div class='tableborder'>
 <div class='tableheaderalt'>Cerca risultati</div>
 <table cellpadding='4' cellspacing='0' width='100%'>
 <tr>
  <td class='tablesubheader' width='1%' align='center'><font face="Visitor TT1 BRK" color="#660000">ID</font></td>
  <td class='tablesubheader' width='29%'><font face="Visitor TT1 BRK" color="#660000">Nome</font></td>
  <td class='tablesubheader' width='30%' align='center'><font face="Visitor TT1 BRK" color="#660000">Email</font></td>
  <td class='tablesubheader' width='30%' align='center'><font face="Visitor TT1 BRK" color="#660000">Data</font></td>
  <td class='tablesubheader' width='10%' align='center'><font face="Visitor TT1 BRK" color="#660000">Modifica</font></td>
 </tr>
<?php

while($row = mysql_fetch_assoc($get_users)){
	printf(" <tr>
  <td class='tablerow1' align='center'>%s</td>
  <td class='tablerow2'><strong>%s</strong><div class='desctext'>%s [<a href='http://who.is/whois-ip/ip-address/%s/' target='_blank'>CHI È</a>]</div></td>
  <td class='tablerow2' align='center'><a href='mailto:%s'>%s</a></td>
  <td class='tablerow2' align='center'>%s</td>
  <td class='tablerow2' align='center'><a href='index.php?p=edituser&key=%s'><img src='./images/edit.gif' alt='Edit User Data'></a></td>
</tr>", $row['id'], $row['username'], $row['ipaddress_last'], $row['ipaddress_last'], $row['mail'], $row['mail'], $row['hbirth'], $row['id']);
}
?>
 
 </table>
</div>
<?php } ?>
	 </div><!-- / RIGHT CONTENT BLOCK -->
	 </td></tr>
</table>
</div><!-- / OUTERDIV -->
<div align='center'><br />
<?php
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
printf('Ore: %.3f', $totaltime);
?>
</div>