<div class="container">
	<div class="page-hd" style="background-image: url(<?php print $site_url; ?>images/ranking.png)">
		<div class="bd-c">
			<div id='page_title'><?php print $lang['ranking'].' - '.$lang['guilds']; ?></div>
		</div>
	</div>
	<div id="page_content">
		<article class="RKGuildAlbumWrap">
			<div class="albumImg"></div>
			<ul>
				<li><span style="text-transform: uppercase;">Guild</span><strong><a href="https://rodnia.net/guild/10113">VaFreacaGame</a></strong></li>
				<li><span>LEADER</span><strong><a href="https://rodnia.net/player/15278">iAbby</a></strong></li>
				<li><span>LEVEL</span><strong style="color: #7f5504;">20</strong></li>
				<li><span>POINTS</span><strong style="color: #7f5504;">32538</strong></li>
				<li><span>WIN/DRAW/LOS</span><strong style="color: #7f5504;">42 / 0 / 8</strong></li>
			</ul>
			<div style="height:42px;"></div>
		</article>
		<div class="jumbotron jumbotron-fluid" style="padding: 1rem 2rem;margin-left: 24%;">
			<form action="" method="POST">
				<div class="row">
					<div class="col-lg-7">
						<input type="text" name="search" class="form-control" placeholder="<?php print $lang['guild']; ?>" value="<?php if(isset($search)) print $search; ?>">
					</div>
					<div class="col-lg-5">
						<button style="margin-left: 10px;" type="submit" class="btn btn-primary"><i class="fa fa-search fa-1" aria-hidden="true"></i> <?php print $lang['search']; ?></button>
					</div>
				</div>
			</form>
		</div>
		<ul class="nav nav-tabs" style="margin-left: 33%; margin-bottom: -4px;">
			<li class="nav">
				<a class="nav" href="<?php print $site_url; ?>ranking/players"><img src="<?php print $site_url; ?>images/players.png" alt="Jucători" title="Jucători"> Jucători</a>
			</li>
			<li class="nav open">
				<a class="nav" href="#"><img src="<?php print $site_url; ?>images/guilds.png" alt="Bresle" title="Bresle"> Bresle</a>
			</li>
		</ul>
		<table class="table table-striped table-hover">
			<thead class="thead-inverse">
				<tr>
					<th>#</th>
					<th><?php print $lang['guild']; ?></th>
					<th>Win</th>
					<th>Loss</th>
					<th><?php print $lang['leader']; ?></th>
					<th><?php print $lang['empire']; ?></th>
				</tr>
			</thead>
			<tbody>
				<?php		
					$records_per_page=20;

					if(isset($search))
					{
						$query = "SELECT id, name, master, level, ladder_point, win, loss FROM guild WHERE name NOT LIKE '[%]%' AND name LIKE :search ORDER BY level DESC, ladder_point DESC, exp DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery, $search);
					} else {
						$query = "SELECT id, name, master, level, ladder_point, win, loss FROM guild WHERE name NOT LIKE '[%]%' ORDER BY level DESC, ladder_point DESC, exp DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery);
					}
					
				?>
			</tbody>
		</table>
		<?php
			if(isset($search))
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url,$search);
			else
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url);
		?>
	</div>
</div>