<?php
include ('header.inc.php');

//Search result
if(isset($_GET["pseudo_rech"]))
{
 	$res=mysql_query("select * from users where username LIKE '%".$_GET["pseudo_rech"]."%' order by username");
	if(mysql_num_rows($res)>0)
	{
		?><br><center><i class="accstyle"><b>- Votre recherche pour &quot;<?php echo $_GET["pseudo_rech"];?>&quot; :</b></i>
		<table>
		<?php
		
		while($ligne=mysql_fetch_array($res))
		{
			?><tr><td><img src="images/icons/li.png" alt=""/>&nbsp;<a href="player-stats.php?pid=<?php echo $ligne["user_id"];?>" class="accstyle" ><?php echo $ligne["username"];?></a></td></tr><?php
		}
		?></table></center><?php
	}
	else
	{
		?><br><center><font class="accstyle"><b>- Aucun joueur trouvé</b></font></center><?php
	}
	?><br><center><a href="player-search.php" class="accstyle" >[  Nouvelle recherche ? ]</a></center><br><?php
}
//Search form
else
{
	?>
	<center><br>
	<form action="player-search.php" method="get" class="smofr">
	Rechercher un joueur :<br><br>
	<table><tr><td>
	<input type="text" id="pseudo_rech" name="pseudo_rech" class="smofr"></td><td><input type="submit" value="Rechercher"class="buttons">
	</td></tr></table>
	</form>
	</center>
	<?php
}

include ('footer.inc.php');
?>