<?php SESSION_START();
if(!isset($_SESSION['admin_id'])){
	header("location: ../index.php");
}
?>
<?php include("../config/config.php");?>

<?php include("head.php"); ?>
<body>
<div class="wrapper">
<header>
<?php include("navigation.php"); 

?>
</header>

<div class="col-main">
<content>
<div class="demo_jui">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
		<thead>
			<tr>
				<td>Section</td>
				<td>Number of Learning Resources</td>
			</tr>
		</thead>
		<tbody>
	<?php $stat = mysql_query("SELECT COUNT(books.title),books.section FROM books GROUP BY section") or die(mysql_error());
	WHILE($status = mysql_fetch_array($stat)){
	?>
	<tr>
		<td><?php if($status['section'] == ""){ echo "Unassigned"; }else{ echo  $status['section'];} ?></td>
		<td><?php echo  $status['COUNT(books.title)']; ?></td>
	</tr>
	
	<?php }
	?>
	</tbody>
</table>
</div>
</content>
<?php include("left.php"); ?>
</div>

<?php include("footer.php"); ?>
</div>
</body>
</html>