<nav>
<ul class="collapsible accordion">	
	<li <?php if($page == 1) echo 'class="current"'; ?> ><a href="dashboard.php"><img src="img/icons/packs/fugue/16x16/dashboard.png" alt="" height=16 width=16 >Dashboard</a></li>
	
	<li>
		<a <?php if($page==2 || $page==3 || $page==4) echo 'class="open"'; ?> href="javascript:void(0);"><img src="img/icons/packs/fugue/16x16/user.png" alt="" height=16 width=16>Student Profile</a>
		<ul>
			<li <?php if($page==2) echo 'class="current"'; ?> ><a href="profile.php"><span class="icon icon-user"></span>Profile</a></li>
			<li <?php if($page==3) echo 'class="current"'; ?> ><a href="tuition.php"><span class="icon icon-shopping-cart"></span>Tuition</a></li>
		</ul>
	</li>

	<li>
		<a <?php if($page==5 || $page==6) echo 'class="open"'; ?> href="javascript:void(0);"><img src="img/icons/packs/fugue/16x16/chart.png" alt="" height=16 width=16>Results</a>
		<ul>
			<li <?php if($page==6) echo 'class="current"'; ?> ><a href="results.php"><span class="icon icon-table"></span>Results</a></li>
		</ul>
	</li>
	
	<li>
		<a <?php if($page==7 || $page==8 || $page==9 || $page==10) echo 'class="open"'; ?> href="javascript:void(0);"><img src="img/icons/packs/fugue/16x16/book--plus.png" alt="" height=16 width=16>Modules</a>
		<ul>
			<li <?php if($page==7) echo 'class="current"'; ?> ><a href="modules.php"><span class="icon icon-book"></span>My Modules</a></li>
		</ul>
	</li>
	
	<?php
		//Check when did the user last check the updates for this module from seen table
		$query = "SELECT COUNT(n.date_posted) as freg FROM news n WHERE EXISTS(SELECT subject FROM seen WHERE stid='$user' AND subject=n.subject AND n.date_posted>date_seen) OR NOT EXISTS(SELECT subject FROM seen WHERE stid='$user' AND subject=n.subject) GROUP BY n.subject ORDER BY n.id desc";
		$subject_set = mysqli_query($connection,$query);
		$row = mysqli_fetch_array($subject_set);

		$freg = $row['freg'];
	?>
	
	<li <?php if($page == 16) echo 'class="current"'; ?> >
		<a href="inbox.php"><img src="img/announcements.png" alt="" height=16 width=16>Announcements 
			<?php
					if($freg != 0)
					{
						?>
							<span class="badge red" style="font-size: 10px;"><?php echo $freg; ?></span>
						<?php
					}
			?>
		</a>
	</li>
	
	<li <?php if($page == 17) echo 'class="current"'; ?> >
		<a href="schoolcalendar.php"><img src="img/calendar.png" alt="" height=16 width=16>School Calendar </a>
	</li>
	
	<li <?php if($page == 18) echo 'class="current"'; ?> >
		<a href="change_password.php"><img src="img/edit.png" alt="" height=16 width=16>Change Password </a>
	</li>
	
</ul></nav>