<title>Staff - <?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">Staff</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 `users` WHERE `Admin` > 0 AND `Status` = 1");
	$q->execute();
	$s = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Admin` > 0");
	$s->execute();
	?>
<h4>Admins (<?php echo $q->rowCount(); ?>/<?php echo $s->rowCount(); ?>)</h4>
<table class="table table-condensed">
<tr class="success">
<td>Status</td>
<td>Name</td>
<td>Admin level</td>
<td>Info</td>
<?php if(Config::getData('users','Admin',$_SESSION['user']) >= 5) {	?>
	<td>Reports</td> <?php } ?>
<td>Last online</td>
</tr>
	<?php
	$q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `Admin` > 0 ORDER BY `Admin` DESC, `Age` DESC ');
	$q->execute();
	while($row = $q->fetch(PDO::FETCH_OBJ)) {
		echo "<tr>
			<td>" . ($row->Status ? "<span class='badge badge-success'>online</span>" : "<span class='badge badge-warning'>offline</span>") . " </td>
			<td><a href='".Config::$_PAGE_URL.'profile/'.$row->id."'>{$row->name}</a></td>
			<td>{$row->Admin}</td>
			<td>";
			if($row->Admin >= 6)
			echo"<span class='label label-pink arrowed-in-right white'><i class='icon-gear white'></i> owner </span>";
			if($row->Support == 1)
			echo"<span class='label label-info arrowed-in-right white'><i class='icon-gear white'></i> support</span>";
			if($row->ManagerLideri == 1)
			echo"<span class='label label-purple arrowed-in-right white'><i class='icon-sitemap white'></i> manager lideri</span>";
			if($row->ManagerStaff == 1)
			echo"<span class='label label-purple arrowed-in-right white'><i class='icon-comments white'></i> manager staff</span>";
			if($row->ManagerDepartamente == 1)
			echo"<span class='label label-purple arrowed-in-right white'><i class='icon-comments white'></i> manager departamente</span>";
			if($row->ManagerTaxi == 1)
			echo"<span class='label label-purple arrowed-in-right white'><i class='icon-comments white'></i> manager taxi</span>";
			if($row->ManagerInstructori == 1)
			echo"<span class='label label-purple arrowed-in-right white'><i class='icon-comments white'></i> manager instructori</span>";
			if($row->ManagerMedici == 1)
			echo"<span class='label label-purple arrowed-in-right white'><i class='icon-comments white'></i> manager medici</span>";
			if($row->ManagerHitman == 1)
			echo"<span class='label label-purple arrowed-in-right white'><i class='icon-comments white'></i> manager hitman</span>";
			if($row->Beta == 1)
			echo"<span class='label label-info arrowed-in-right white'><i class='icon-gear white'></i> beta tester </span>";
			echo"</td>";
			if(Config::getData('users','Admin',$_SESSION['user']) >= 5)
			echo "<td>{$row->CrPlayers}</td>";
			echo "<td>{$row->lastOn}</td></tr>";
	} ?>
</table>

	<?php
	$q = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Helper` > 0 AND `Status` = 1");
	$q->execute();
	$s = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Helper` > 0");
	$s->execute();
	?>
<h4>Helpers (<?php echo $q->rowCount(); ?>/<?php echo $s->rowCount(); ?>)</h4>
<table class="table table-condensed">
<tr class="success">
<td>Status</td>
<td>Name</td>
<td>Helper level</td>
<?php if(Config::getData('users','Admin',$_SESSION['user']) >= 5) {	?>
	<td>Questions</td> <?php } ?>
<td>Last online</td>
</tr>
 <?php
	$q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `Helper` > 0 ORDER BY `Helper` DESC, `Age` DESC ');
	$q->execute();
	while($row = $q->fetch(PDO::FETCH_OBJ)) {
		echo "<tr>
			<td>" . ($row->Status ? "<span class='badge badge-success'>online</span>" : "<span class='badge badge-warning'>offline</span>") . " </td>
			<td><a href='".Config::$_PAGE_URL.'profile/'.$row->id."'>{$row->name}</a></td>
			<td>{$row->Helper}</td>
   			";
			echo"";
			if(Config::getData('users','Admin',$_SESSION['user']) >= 5)
			echo "<td>{$row->HelpedPlayers}</td>";
			echo "<td>{$row->lastOn}</td></tr>";
	} ?>
</table>

	<?php
	$q = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Leader` > 0 AND `Status` = 1");
	$q->execute();
	$s = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Leader` > 0");
	$s->execute();
	?>
<h4>Leaders (<?php echo $q->rowCount(); ?>/<?php echo $s->rowCount(); ?>)</h4>
<table class="table table-condensed">
<tr class="success">
<td>Status</td>
<td>Name</td>
<td>Faction</td>
<td>Faction members</td>
<td>Last online</td>
</tr>
	<?php
	$q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `Leader` > 0 ORDER BY `Leader` ASC, `Age` DESC ');
	$q->execute();
	while($row = $q->fetch(PDO::FETCH_OBJ)) {

		echo "<tr>
			<td>" . ($row->Status ? "<span class='badge badge-success'>online</span>" : "<span class='badge badge-warning'>offline</span>") . " </td>
			<td><a href='".Config::$_PAGE_URL.'profile/'.$row->id."'>{$row->name}</a></td>
			<td>".Config::$factions[$row->Leader]."</td>";
		$fac = Config::$g_con->prepare("SELECT * FROM `users` WHERE `Member` = ? ");
		$fac->execute(array($row->Member));
		$facm = Config::$g_con->prepare("SELECT * FROM `factions` WHERE `ID` = ? ");
		$facm->execute(array($row->Member));
		$datam = $facm->fetch(PDO::FETCH_OBJ);
		echo"<td>". $fac->rowCount() ." / ". $datam->MaxMembers ."</td>
			<td>{$row->lastOn}</td></tr>";
	} ?>
</table>
<?php
	$ccl7d = Config::$g_con->prepare("SELECT * FROM `complaints` WHERE time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND time < CURDATE() ");
	$ccl7d->execute();
	$ccl24h = Config::$g_con->prepare("SELECT * FROM `complaints` WHERE time >= CURDATE() ");
	$ccl24h->execute();
?>
Complaints created last 7 days: <b><?php echo $ccl7d->rowCount(); ?></b><br/>
Complaints created last 24h: <b><?php echo $ccl24h->rowCount(); ?></b><br>
<!--Newbie questions asked in the last 7 days: <b>- -</b>-->
