<nav>
<ul class="collapsible accordion">	
	<li <?php if($page == "Dashboard") 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=="Profile" || $page=="Tuition" || $page=="Gurdian") 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=="Profile") echo 'class="current"'; ?> ><a href="profile.php"><span class="icon icon-user"></span>Profile</a></li>
			<li <?php if($page=="Tuition") echo 'class="current"'; ?> ><a href="tuition.php"><span class="icon icon-shopping-cart"></span>Tuition</a></li>
			<li <?php if($page=="Gurdian") echo 'class="current"'; ?> ><a href="gurdian.php"><span class="icon icon-user-md"></span>Gurdian</a></li>
		</ul>
	</li>

	<li>
		<a <?php if($page=="Tests" || $page=="Exam") 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=="Tests") echo 'class="current"'; ?> ><a href="tests.php"><span class="icon icon-table"></span>Tests</a></li>
			<li <?php if($page=="Exam") echo 'class="current"'; ?> ><a href="results.php"><span class="icon icon-table"></span>Exam</a></li>
		</ul>
	</li>
	
	<li>
		<a <?php if($page=="My Modules" || $page=="Register" || $page=="Deregister" || $page=="My Lectures") 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=="My Modules") echo 'class="current"'; ?> ><a href="modules.php"><span class="icon icon-book"></span>My Modules</a></li>
			<li <?php if($page=="Register") echo 'class="current"'; ?> ><a href="module_register.php"><span class="icon icon-plus"></span>Register</a></li>
			<li <?php if($page=="Deregister") echo 'class="current"'; ?> ><a href="module_deregister.php"><span class="icon icon-minus"></span>Deregister</a></li>
			<li <?php if($page=="My Lectures") echo 'class="current"'; ?> ><a href="lectures.php"><span class="icon icon-group"></span>My Lectures</a></li>
		</ul>
	</li>
	
	<li>
		<a <?php if($page=="Class Schedule" || $page=="Exam Schedule" || $page=="Test Schedule") echo 'class="open"'; ?> href="javascript:void(0);"><img src="img/icons/packs/fugue/16x16/table.png" alt="" height=16 width=16>Time Table</a>
		<ul>
			<li <?php if($page=="Class Schedule") echo 'class="current"'; ?> ><a href="timetable.php"><span class="icon icon-calendar"></span>Class Schedule</a></li>
			<li <?php if($page=="Exam Schedule") echo 'class="current"'; ?> ><a href="exam.php"><span class="icon icon-table"></span>Exam Schedule</a></li>
			<li <?php if($page=="Test Schedule") echo 'class="current"'; ?> ><a href="test_schedule.php"><span class="icon icon-table"></span>Test Schedule</a></li>
		</ul>
	</li>
	
	<li <?php if($page == "System Use") echo 'class="current"'; ?> >
		<a href="use.php"><img src="img/icons/packs/fugue/16x16/balance.png" alt="" height=16 width=16>System Use</a>
	</li>
	
	<li>
		<a <?php if($page=="Support" || $page=="Tickets") echo 'class="open"'; ?> href="javascript:void(0);"><img src="img/icons/packs/fugue/16x16/bell--exclamation.png" alt="" height=16 width=16>Support Ticket</a>
		<ul>
			<li <?php if($page=="Support") echo 'class="current"'; ?> ><a href="support.php"><span class="icon icon-warning-sign"></span>Support</a></li>
			<li <?php if($page=="Tickets") echo 'class="current"'; ?> ><a href="tickets.php"><span class="icon icon-envelope-alt"></span>Tickets</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 == "Announcements") 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 == "School Calendar") 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 == "Change Password") echo 'class="current"'; ?> >
		<a href="change_password.php"><img src="img/edit.png" alt="" height=16 width=16>Change Password </a>
	</li>
	
</ul></nav>