</div><div class="main-content">
<?php
if(!defined('panel'))
	die('Nope.');
if(!isset(Config::$_url[1])) header('Location: ' . $_PAGE_URL . 'factionslist');

$q = Config::$g_con->prepare('SELECT * FROM `factions` WHERE `ID` = ?');
$q->execute(array(Config::$_url[1]));
if(!$q->rowCount()) {
	echo '
<title>Error! Invalid faction ID</title>
<div class="breadcrumbs" id="breadcrumbs">
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="../">Home</a>
</li>
<li>
<a href="../factionslist">Factions</a>
</li>
<li class="active">Invalid faction ID.</li>
</ul>

		<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="alert alert-danger">Error! Invalid faction ID.</div></div>';
	echo '<meta http-equiv="refresh" content="0;URL=\''.Config::$_PAGE_URL.'factionslist\'/>';
	return;
}
?>

<title>Factions Log - <?php echo Config::$_SITE_NAME; ?></title>

			<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>
						<a href="<?php echo Config::$_PAGE_URL; ?>factionslist">Factions</a>
					</li>					
					<li class="active">Factions Log</li>
				</ul><!-- /.breadcrumb -->

				<div class="nav-search" id="nav-search">
					<form method="POST" action="<?php echo Config::$_PAGE_URL; ?>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">

<div class="tabbable tabs-right">
<ul class="nav nav-tabs">
		<?php
			foreach(Config::$factions as $id=>$faction) {
				if(!$id) continue;
				echo '<li><a href="'.Config::$_PAGE_URL.'logs/'.$id.'">'.$faction.'</a></li>';
			}
		?>
</ul>
<div class="tab-content">
<div class="tab-pane active">
<h4><?php echo Config::$factions[Config::$_url[1]] ?></h4>
<table class="table info">
		<?php
			$q = Config::$g_con->prepare('SELECT * FROM `factionlog` WHERE `factionid` = ? ORDER BY `ID` DESC');
			$q->execute(array(Config::$_url[1]));
			while($row = $q->fetch(PDO::FETCH_OBJ)) {
		?>
<tr>
<td><?php echo $row->time; ?></td>
<td><?php echo $row->action; ?></td>
</tr>
		<?php } ?>
</table>
</div>
</div>
</div>
