<?php 

if(isset($_GET['sid'],$_GET['pid']))
{
	$sid = $_GET['sid'];
  //$did = $_GET['did'];
  $pid = $_GET['pid'];

  //get department id from programme id supplied
  //$did = get_department_using_programme_id($pid);


  $did = get_department_comb_using_programme_id($pid);
	
}

$mid = get_user_department($user_id); 


?>

<div class="well">

      <ul class="tabs"> 
      	<li><a href="#view1">Assessment</a></li>
        <!--<li><a href="gateway.php?act=view_course_assessments">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']; ?>
                                        </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="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                 
                                                                   
                                                                      <div class="panel panel-warning">
                                                                        <div class="panel-heading" role="tab" id="prence_heading">
                                                                          <h4 class="panel-title">
                                                                            <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#prence" aria-expanded="false" aria-controls="prence">PRE NCE</a>
                                                                          </h4>
                                                                        </div>
                                                                        <div id="prence" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="prence_heading">
                                                                          <div class="panel-body">
                                                                          
                                                                          		
                                      
                                                                                
                                                                                <div class="col-lg-6">
                                                            
                                                            					<h4>FIRST SEMESTER</h4>
																				<?php 
                                                                                        //show first semester courses assigned to staff
                                                                                        
                                                                                           echo view_courses_by_programme_prence($session,$sid,$did, $pid,$semester = '1', $level = 'PRE'); //$user_id
                                                                                
                                                                                 ?>
                                                                                    
                                                                                 </div>
                                                                                 
                                                                                 
                                                                                 <div class="col-lg-6">
                                                       
                                                                                <h4>SECOND SEMESTER</h4>
																				  <?php 
                                                                                          //get second semester courses assigned to staff
                                                                                        echo view_courses_by_programme_prence($session,$sid,$did, $pid,$semester = '2', $level = 'PRE');
                                                                                  
                                                                                   ?>
                                                                                
                                                                                </div>
                                                       
                                                                          
                                                                          
                                                                          
                                                                          </div>
                                                                        </div>
                                                                      </div>
                                                                      
                                                                      
                                                               
                                                                     
                                                              
                                                             </div> <!-- /.panel group --> 
                                                    
                                                     
                                                        
                                                        
                                                       
                                                        
                                                        
                             						
                             
                          					</ul>
										</div>
							</div>
							<!--First accordion panel container Ends here -->
			<?php
						
						$a++; //increment the loop for the control
						}
					}
			?>				
							
							</div>
							
							
						
				</div>
        
        
              

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

</form>