<title>Search - <?php echo Config::$_SITE_NAME; ?></title>
</div>
	<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<script type="text/javascript">
					try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
				</script>

				<ul class="breadcrumb">
					<li>
						<i class="ace-icon fa fa-home home-icon"></i>
						<a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
					</li>
					<li class="active">Search</li>
				</ul><!-- /.breadcrumb -->

				<div class="nav-search" id="nav-search">
					<form method="POST" action="search">
						<span class="input-icon">
							<input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on"> 
							<i class="ace-icon fa fa-search nav-search-icon"></i>
						</span>
					</form>
				</div> <!-- /.nav-search -->
			</div>	
			
<div class="page-content"><div class="row-fluid"><div class="span12">

<?php
if(!defined('panel'))
	die('Nope.');

if(isset($_POST['sname']) || isset(Config::$_url[2]) != 0) {
	if(isset($_POST['sname'])) $_SESSION['sname'] = $_POST['sname'];
	$q = Config::$g_con->prepare("SELECT * FROM `users` WHERE `name` LIKE ? LIMIT 50");
	$q->execute(array('%'.$_SESSION['sname'].'%'));
	echo '<div class="alert alert-danger">Sunt afisate doar primele 50 rezultate. Daca nu gasesti playerul pe care-l cauti, scrie o parte mai mare din nickname-ul acestuia.</div>';
	while($row = $q->fetch(PDO::FETCH_OBJ)) {
		echo 
			"({$row->id}) <a href='".Config::$_PAGE_URL."profile/{$row->id}'>{$row->name}</a> - level {$row->Level}<br />";
	}
	return;
}
?>
 
<center>
<form method="POST" action="" accept-charset="UTF-8">
<label for="username">Player name:</label><br />
<input name="sname" type="text"><br />
<br/>
<input class="btn btn-info" type="submit" name="submit" value="Search">
</form>
