<form id="" name="" class="form-horizontal" method="post" action="dashboard.php" enctype="multipart/form-data">

<?php
	
$student_id = $user_id;
$school_id = get_user_school_id($user_id);
$dept_id = get_user_department_id($user_id);
$programme_id = get_user_programme_id($user_id); //get course if for a suer
$level = get_user_level($user_id); //get user level 

$current_session = get_current_session($id = '1'); //current session is always
$current_semester = get_current_semester($id = '1'); //current session is always

$session_t = get_session_title($current_session); //semster title

$semester_t = get_semester_title($current_semester); //semster title

$image = get_user_image($user_id);




?>

    <div style="height:20px; displat:block;"></div>
    
    <ul class="breadcrumb">
    
        <li><a href="">Exam Card</a> <span class="divider"></span> </li>
      
    </ul>

<div class="well">
    
   <?php if(has_paid_school_fee($user_id, $current_session, $current_semester )) //check if the user has paid this session fee
   { ?>
    
    	<?php 
		
		 if(!has_done_registration($user_id, $current_session, $current_semester)) //check if user done registration before
		 { 
		
		?>
        
            <div class="alert alert-info in" >
                 <button class="close" data-dismiss="alert" type="button">
                    X
    
                 </button>
                    <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;Please Register your courses for the semester before you can print Exam Card. If you need help,  click on support to call  / text our support-line stating your matric no..
        	</div>
<!--    		<a href="dashboard.php?act=course_registration&qlk=<?php echo md5(3); ?>"  class="pull-right"><img src="images/add_icon.png" data-toggle="tooltip" data-placement="top"  title="Click here to register new courses" />   </a> <br/><br/>
-->     
     <?php
		 }
	  ?>
     
     
 
 
   
   <div style="height:20px; displat:block;"></div>
     
     
     
     
     <!--First accordion panel container tat accomodates all courses -->
				
    <div class="panel panel-success">
        <div class="panel-heading">
            <p class="panel-title">
                <a id="Me" data-toggle="collapse" data-parent="#accordion" href="#collapseMe"> <span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;<?php echo $session_t; ?> ACADEMIC SESSION - <?php //echo $semester_t; ?> EXAM CARD</a>
                 <span class="label label-primary" style="font-size:15px;float:right;"></span>
            </p>
        </div>
                <div id="collapseMe" class="panel-collapse collapse in ">
                    <div class="panel-body">
                        <ul class="list-group">
                            
                            
                            
                            <?php
																							
																							
						  //view the temporary table and show the preview for first semester
						  $q3 = "SELECT id, student_id, programme_id, course_id, course_unit,session_id,  level, semester
								 FROM  students_courses_nce 
								 WHERE  student_id ='$user_id'
								 AND session_id = '$current_session' 
								 ORDER BY date_added"; //semester = '$current_semester' AND
							  
							  $r3 = mysqli_query(dbc(),$q3);
							  $sn = 0 ;
							  if(mysqli_num_rows($r3) > 0)
							  {//show table
								  
							  
								 // $output .= '<h5 id="list" class="btn btn-success">First Semester</h5> <br>';
								  
								  $output .= 
									'<table class="table user display table-bordered table-hover table-striped" cellspacing="0" width="100%" style="font-size:12px;">
									  <thead>
												  <th>S/N</th>
												  <th>Code</th>
												  <th>Title</th>
												
												  
									   </thead>
									  <tbody>';
							  
								  while($row = mysqli_fetch_array($r3, MYSQLI_ASSOC))
								  {
									  
									  
									  $output .= "<tr>";
									  $output .= "<td>".$sn = $sn+1 ."</td>";
									  $output .= "<td> ".get_course_code($row['course_id'])."</td>";
									  $output .= "<td> ".strtoupper(get_course_name($row['course_id']))."</td>";
									
									  $output .= "</tr>";
									  
									  ////add total unit carried
//																										$total_units = 0;
//																										$total_unit = $total_units + get_course_unit($row['course_id']);
//																										$t +=  $total_unit;
									  
									  
									  
									  
								  }
									  $output .= "<tr>";
									  $output .= "<td ></td>";
									  
									  
									
									  if($image != '')
									  {
										  
										  
										  $output .= '<td colspan="2"><a target="_blank" href="create_exc_slip2.php?qlk='.md5(8).'&me='.sha1($user_id).md5('examcard').'&u='.$user_id.'&enc='.sha1(8).'" class="btn btn-info" data-toggle="tooltip" data-placement="top" title="Click here to Print / Download Exam Card"><i class="glyphicon glyphicon-print"> </i> Print / Download Receipt</a>
 </td>';
									  
									  }
									  else
									  {
										  $output .= '<td colspan="2"><a  href="#" class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="Please Upload Your Passport Before You Can Print"> P l e a s e  U p l o a d  Y o u r  P a s s p o r t</a>
 </td>';
									  
									  
										  
									  }

									  
									  $output .= "</tr>";
							  }
							  else
							  {//show the msg 
							  
									  $output .='<div class="alert alert-danger alert-dismissable"> 
											  <button class="close" aria-hidden="true" data-dismiss="alert" type="button">x</button>
											  <img src="images/info.png" />&nbsp;&nbsp; No record found.
											 </div>';
								  
								  
							  }
							  
							  
							  
							  $output .=
							  '</tbody>
							  </table>';
							  
							  
							  
							  
							  
							  echo $output;
						  
						  
						  
						  
						  
						  
						  
				  ?>		
																			
                                
                            
     
                    </ul><!-- end of list group --->
                </div><!-- end o panel body -->
    </div>
    <!--First accordion panel container Ends here -->
    
    
    </div>
    <!-- payment history -->
    
            
							
                            
                            
     <?php 
   
   }
   else
   {
	   
	   echo
	   
   '<div class="alert alert-danger in" >
                 <button class="close" data-dismiss="alert" type="button">
                    X
    
                 </button>
                    <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;Please make registration payments before you can be able to Print Exam Card.
            </div>';
       
       
 
   }
  ?>

</div><!-- /well -->

</form>
