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

require_once('../global.php');
require_once('../INC/class.session.php');

$query = Filter($_GET['query']);
$scope = Filter($_GET['scope']);
?>
	<ul>
		<li>Cliquez sur le lien ci-dessous pour l'insérer dans le document</li>
<?php

if($scope == 1){
$i = 0;
$getem = mysql_query("SELECT * FROM users WHERE caption LIKE '%".$query."%' LIMIT 10");

while ($row = mysql_fetch_assoc($getem)) {
	$i++;
	printf("<li><a href=\"#\" class=\"linktool-result\" type=\"habbo\"
	    	value=\"%s\" title=\"%s\">%s</a></li>", $row['id'], $row['caption'], $row['caption']);
}
} elseif($scope == 2){
$i = 0;
$getem = mysql_query("SELECT * FROM rooms WHERE caption LIKE '%".$query."%' LIMIT 10");

while ($row = mysql_fetch_assoc($getem)) {
	$i++;
	printf("<li><a href=\"#\" class=\"linktool-result\" type=\"room\"
	    	value=\"%s\" title=\"%s\">%s</a></li>", $row['id'], $row['caption'], $row['caption']);
}
} elseif($scope == 3){
$i = 0;
$getem = mysql_query("SELECT * FROM groups_details WHERE name LIKE '%".$query."%' LIMIT 10");

while ($row = mysql_fetch_assoc($getem)) {
	$i++;
	printf("<li><a href=\"#\" class=\"linktool-result\" type=\"group\"
	    	value=\"%s\" title=\"%s\">%s</a></li>", $row['id'], $row['name'], $row['name']);
}
}
?>
</ul>