
<div class="well">

      <ul class="tabs"> 
      	<li><a href="gateway.php?act=view_courses">Teaching</a></li>
        <li><a href="#view1">Assessments</a></li>
      </ul> 
      <div class="tabcontents"> 
        <div id="view1">
        
        
        
                       
             <div id="accordion" class="panel-group">
        
        <?php $q = "SELECT * FROM sessions  WHERE status = 0 ORDER BY title DESC";
			  		$r = mysqli_query($dbc, $q);
					
					if(mysqli_num_rows($r)>0)
					{
						$a=0; //initialise counter 
						while($row = mysqli_fetch_array($r,MYSQLI_ASSOC))
						{
	    ?>	
							<div class="panel panel-success">
								<div class="panel-heading">
									<p class="panel-title">
                                   		<a id="<?php echo $a + 1; ?>" data-toggle="collapse" data-parent="#accordion" href="#collapse<?php echo $a + 1; ?>">
                                        <span class="glyphicon glyphicon-plus"></span>
											<?php echo $row['title'].' SESSION'; ?>
                                        </a>
                                        
                                    <span class="label label-success" style="font-size:15px;float:right;">
									<?php //echo get_total_votes_per_post($row['id']); //parameter is post id?></span>
                                    
                                    
                                    </p>
								</div>
										<div id="collapse<?php echo $a + 1; ?>" class="panel-collapse collapse<?php //echo $a + 1; ?>  <?php if($a + 1 =='1'){ echo 'in';} //hide the collapse ?>">
                                        	<div class="panel-body">
                          						<ul class="list-group">
                              						
                                                    
                                                    
                                                    
                                                    <?php
														//collect the post id 
														$session = $row['id'];
													
													
													?>
                                                    
                                                     		<div class="col-lg-6">
                                                            
                                                            <h4>FIRST SEMESTER</h4>
													<?php 
															//show first semester courses assigned to staff
															echo view_courses($session,$user_id, $semester = '1'); 
													
													 ?>
                                                        
                                                        </div>
                                                        
                                                        
                                                       <div class="col-lg-6">
                                                       
                                                        <h4>SECOND SEMESTER</h4>
													<?php 
															//get second semester courses assigned to staff
															echo view_courses($session,$user_id, $semester = '2'); 
													
													 ?>
                                                        
                                                        </div>
                                                       
                                                        
                                                        
                             						
                             
                          					</ul>
										</div>
							</div>
							<!--First accordion panel container Ends here -->
			<?php
						
						$a++; //increment the loop for the control
						}
					}
			?>				
							
							</div>
							
							
						
				
        
        
              

        
        </div> <!-- /view1 -->
         
 
      </div>
</div>

</form>