<title>Online users - <?php echo Config::$_SITE_NAME; ?></title>
<?php
if(!defined('panel'))
	die('Nope.');
?>

</div>
	<div class="main-content">
		<div class="main-content-inner">
			<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">Online Players</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 $q = Config::$g_con->prepare('SELECT * FROM `factions` WHERE `MinLevel` > 0 ORDER BY `ID` ASC');
			$q->execute();
			while($row = $q->fetch(PDO::FETCH_OBJ)) 
		{ 
			$qss = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Member` = ? AND `Status` > 0");
			$qss->execute(array($row->ID));
		?>		
			<div class="span12">
				<h4 class="groupcolor g<?php echo $row->ID ?>"><?php echo Config::$factions[$row->ID] ?> (<?php echo $qss->rowCount() ?> online)</h4>
				<?php $qrr = Config::$g_con->prepare('SELECT * FROM `users` WHERE `Member` = ? AND `Status` > 0');
					$qrr->execute(array($row->ID));
					while($row22 = $qrr->fetch(PDO::FETCH_OBJ)) 
				{ ?>
				<div class="span2 center">
					<a href="<?php echo Config::$_PAGE_URL; ?>profile/<?php echo $row22->id ?>"><img src="<?php echo Config::$_PAGE_URL; ?>assets/images/avatars/<?php echo $row22->Model ?>.png" alt="<?php echo $row22->name ?> - level <?php echo $row22->Level ?>" title="<?php echo $row22->name ?> - level <?php echo $row22->Level ?>"/></a><br/>
					<?php echo $row22->name ?>
				</div>	
				<?php } ?>				
			</div>
			<span class="clearfix"/>	
		<?php } ?>
		


		<?php
				$qs = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Member` = 0 AND `Status` > 0");
				$qs->execute();
				$total2 = $qs->rowCount();
			?>		
	<p><b class="groupcolor g0">Civilian (<?php echo $total2 ?> online)</b>:<br/>
		<table class="table">
			<tr>
				<td>Name</td>
				<td>Level</td>
				<td>Hours played</td>
				<td>Respect points</td>
			</tr>

			<?php $qs = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Member` = 0 AND `Status` > 0");
				$qs->execute();
				while($row1 = $qs->fetch(PDO::FETCH_OBJ)) 
			{ ?>
			<tr>
				<td><a href="<?php echo Config::$_PAGE_URL; ?>profile/<?php echo $row1->id ?>"><?php echo $row1->name ?></a></td>
				<td><?php echo $row1->Level ?></td>
				<td><?php echo $row1->ConnectedTime ?></td>
				<td><?php echo $row1->Respect ?></td>
			</tr>
			<?php } ?>
	</table>
</p>
		
