<div class="side-panel mt-5">
	<div class="panel-bg">
		<div class="panel-title">
			<span><?php print $lang['guilds']; ?></span>
		</div>
		<p class="panel-subtitle">Guild Ranking of <span class="highlight">Metin2Top</span></p>

		<table class="table top10-table table-sm table-hover">
		<tbody>
		<?php
		if(!$offline) {
			$top = array();
			$top = top10guilds();

			$i=1;

			foreach($top as $guild)
			{
				if($i == 1){ $i++;?>
				<div class="first-player mb-3">
					<div class="row px-2">
						<div class="col-3">
							<div class="player-icon">
								<img src="<?php print $site_url; ?>images/pos.png" alt="Player Icon">
							</div>
						</div>
						<div class="col-8 player-stats">
							<div class="stats">
								<p class="mb-0"><?php print $guild['name']; ?> <span class="empire-<?php print $empire = $empire=get_guild_empire($guild['master']); ?>">[<?php print emire_name($empire); ?>]</span></p>
								<p class="mb-0 text-center"><span class="highlight">Lvl.</span><?php print $guild['level']; ?></p>
							</div>
						</div>
					</div>
				</div>
				<?php } else { ?>
				<tr>
					<td></td>
					<th scope="row"><strong><?php print $i++; ?></strong></th>
					<td><?php print $guild['name']; ?></td>
					<td>
						<span class="empire-<?php print $empire = $empire=get_guild_empire($guild['master']); ?>"><?php print emire_name($empire); ?></span>
					</td>
					<td><span class="empire-">Lvl.</span><?php print $guild['level']; ?></td>
				</tr>
			<?php } }
		} else print $offline_guilds;
		?>
		</tbody>
	</table>

	<center>
		<?php if(!$offline) { ?>
			<a href="<?php print $site_url; ?>ranking/guilds" class="btn-image" >Top 100 &raquo;</a>
		<?php } else print '<span class="tag tag-danger">'.$lang['server-offline'].'</span></br><span class="tag tag-danger">'.$lang['last-update'].': '.$offline_date.'</span>'; ?>
	</center></br>
</div>
</div>
