<?php
	require_once('source/session.php');
	require_once('source/error.php');
	require_once('source/dbconfig.php');
	require_once('source/function.php');
	require_once('source/restrict_admin.php');
	
	if($_GET['msg'] == "refered"){
		$msg = "<h5 class='alert alert-success'>Refered successfully</h5>";
	}else if($_GET['msg'] == "failed"){
		$msg = "<h5 class='alert alert-warning'>Something went wrong, please try again</h5>";
	}
	
	if($_SESSION['msg'] == "update")
	{
		$msg = "<h5 class='alert alert-success text-center'>Order Update Succesful. Customer will receive email.<a 
		class='btn-sm' href='new_order.php'>Refresh</a></h5>";
	}       
	          
	      
                    $rows1 = sql($DBH, "SELECT * FROM tbl_student_results where csv_no = ?", 
            	array($_GET['val']), "rows");
		foreach($rows1 as $row1)
		{	
			$u_name	 		= $row1['name'];
			$u_registration_no 		= $row1['registration_no'];
			$u_test1 			= $row1['test1'];
			$u_test2 			= $row1['test2'];
			$u_project 			= $row1['project'];
			$u_exam			= $row1['exam'];
			
			$total = ($u_test1 + $u_test2 + $u_project+ $u_exam);


			sql($DBH, "UPDATE tbl_student_results set total = ?, teacher_no = ? WHERE registration_no = ? AND year = ? AND term = ? AND class = ?", array($total,$SESS_HASH_USER,$u_registration_no,$u_test));
			
			
                    $rows2 = sql($DBH, "SELECT * FROM tbl_student_results where csv_no = ? ORDER by (total) desc", 
            	array($_GET['val']), "rows");
            	$sno = 0;
		foreach($rows2 as $row2)
		{	
			$sno++;
			$us_name	 		= $row2['name'];
			$us_registration_no 		= $row2['registration_no'];
			$us_test1 			= $row2['test1'];
			$us_test2 			= $row2['test2'];
			$us_project 			= $row2['project'];
			$us_exam			= $row2['exam'];
			$us_total			= $row2['total'];
			$us_class			= $row2['class'];
			$us_year			= $row2['year'];
			$us_term			= $row2['term'];
			
			if($us_total <=44){
			$grade = "Fail";
			}
			else if ($us_total >44 && $us_total<= 49)
			{
			$grade = "Poor Pass";
			}
			else if ($us_total >49 && $us_total<= 59)
			{
			$grade = "Pass";
			}
			else if ($us_total >59 && $us_total<= 69)
			{
			$grade = "Good";
			}
			else if ($us_total >69 && $us_total<= 89)
			{
			$grade = "Very Good";
			}
			else if ($us_total >89)
			{
			$grade = "Excellent";
			}
			
			sql($DBH, "UPDATE tbl_student_results set grade = ?, position = ? WHERE registration_no = ? AND test = ?", array($grade,$sno,$us_registration_no,$us_test));
			}
			}
			
			//Overall
			
		$STH 			= $DBH->prepare("SELECT count(*) FROM tbl_overall WHERE class = ? AND year = ? AND term = ?");
        	$result 	   	= $STH->execute(array($_GET['myclass'],$_GET['examyear'],$_GET['term']));
        	$cnt_overall	  	= $STH->fetchColumn();
        	if($cnt_overall == 0){
        	
			
                    $rows1 = sql($DBH, "SELECT * FROM tbl_overall WHERE class = ? AND year = ? AND term = ?", array($_GET['stclass'],$_GET['examyear'],$_GET['term']), "rows");
		foreach($rows1 as $row1)
		{	
			$st_registration_no	=	$row1['reg_no'];
			$st_class	=	$row1['class'];
			$st_name	=	$row1['name'];
			
		                                 
		$b_in_s = sql($DBH, "SELECT SUM(total) FROM tbl_overall WHERE class = ? AND year = ? AND term = ? AND registration_no = ?", array($_GET['stclass'],$_GET['year'],$_GET['stterm'],$st_registration_no), "rows");			
		foreach($b_in_s as $b_in_row){	
			$b_ins	=	$b_in_row[0];
		}
			
		
		sql($DBH, "insert into  tbl_overall (name , reg_no , class , year , term, overall)values (?,?,?,?,?,?)", array($st_name,$st_registration_no,$_GET['stclass'],$_GET['year'],$_GET['stterm'],$b_ins));	
		
		
                    $rows2 = sql($DBH, "SELECT * FROM tbl_overall WHERE class = ? AND year = ? AND term = ? ORDER by (overall) desc", 
            	array($_GET['stclass'],$_GET['year'],$_GET['stterm']), "rows");
            	$snum = 0;
		foreach($rows2 as $row2)
		{	
			$snum++;
			$ust_name	 		= $row2['name'];
			$ust_reg_no 		= $row2['reg_no'];
			$ust_test 			= $row2['test'];	
		
			$rows1 = sql($DBH, "SELECT * FROM tbl_user where registration_no = ?", array($ust_reg_no), "rows");							
			foreach($rows1 as $row1)
			{	
				$dob   		= $row1['age'];
				
				//date in mm/dd/yyyy format; or it can be in other formats as well
  $birthDate = "$dob";
  //explode the date to get month, day and year
  $birthDate = explode("/", $birthDate);
  //get age from date or birthdate
  $age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md")
    ? ((date("Y") - $birthDate[2]) - 1)
    : (date("Y") - $birthDate[2]));
    }
			sql($DBH, "UPDATE tbl_overall set position = ?, age = ? WHERE class = ? AND year = ? AND term = ? AND reg_no = ?", array($snum,$age,$_GET['stclass'],$_GET['year'],$_GET['stterm'],$ust_reg_no), "rows");
		}
	}	
}else if($cnt_overall > 0){
                    $rows2 = sql($DBH, "SELECT * FROM tbl_overall WHERE class = ? AND year = ? AND term = ? ORDER by (overall) desc", 
            	array($_GET['stclass'],$_GET['year'],$_GET['stterm']), "rows");
            	$snum = 0;
		foreach($rows2 as $row2)
		{	
			$snum++;
			$ust_name	 		= $row2['name'];
			$ust_reg_no 		= $row2['reg_no'];
			$ust_test 			= $row2['test'];	
			
			                                 
		$b_in_s = sql($DBH, "SELECT SUM(total) FROM tbl_student_results WHERE class = ? AND year = ? AND term = ? AND registration_no = ?", array($_GET['stclass'],$_GET['year'],$_GET['stterm'],$ust_reg_no), "rows");			
		foreach($b_in_s as $b_in_row){	
			$b_ins	=	$b_in_row[0];
          $STH 				= $DBH->prepare( "SELECT AVG(total) FROM tbl_student_results WHERE registration_no = ? AND class =? AND term = ? AND year = ?");
			$result 	   		= $STH->execute(array($_GET['myreg'],$_GET['myclass'],$_GET['term'],$_GET['examyear']));
			$AverageScore	  	= $STH->fetchColumn();   
		}
			
			
	sql($DBH, "UPDATE tbl_overall set overall = ? WHERE class = ? AND year = ? AND term = ? AND reg_no = ?", array($b_ins,$_GET['stclass'],$_GET['year'],$_GET['stterm'],$ust_reg_no), "rows");
			sql($DBH, "UPDATE tbl_overall set position = ? WHERE class = ? AND year = ? AND term = ? AND reg_no = ?", array($snum,$_GET['stclass'],$_GET['year'],$_GET['stterm'],$ust_reg_no), "rows");
			
			sql($DBH, "UPDATE tbl_CummClass set overall = ? WHERE class = ? AND year = ? AND term = ? AND reg_no = ?", array($b_ins,$_GET['stclass'],$_GET['year'],$_GET['stterm'],$ust_reg_no), "rows");
			sql($DBH, "UPDATE tbl_overall set position = ? WHERE class = ? AND year = ? AND term = ? AND reg_no = ?", array($snum,$_GET['stclass'],$_GET['year'],$_GET['stterm'],$ust_reg_no), "rows");
			
	sql($DBH, "UPDATE tbl_overall set AverageScore = ? WHERE class = ? AND year = ? AND term = ? AND reg_no = ?", array($AverageScore,$_GET['stclass'],$_GET['year'],$_GET['stterm'],$ust_reg_no), "rows");
	}
}

?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <title>BRITISH LEARNER'S COLLEGE: ADMIN Dashboard</title>
  <!-- Bootstrap core CSS-->
  <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <!-- Custom fonts for this template-->
  <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  <!-- Page level plugin CSS-->
  <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
  <!-- Custom styles for this template-->
  <link href="css/sb-admin.css" rel="stylesheet">
  <link href="css/folder.css" rel="stylesheet">
  <link href="css/user_profile.css" rel="stylesheet">
  
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <!-- select-->
  <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
  
 
<style> 
div.a {
    white-space: nowrap; 
    width: 100px; 
    overflow: hidden;
    text-overflow:ellipsis;
    border: 0px solid #000000;
    padding-left: 25px;
}

div.a:hover {
    overflow: visible;
}
.style1 {color: #FFFFFF}
.Psychomotor {
	color: #F00;
}
.Psychomotor {
	color: #F00;
}
Assessment Title {
	color: #F00;
}
Assessment Title {
	color: #F00;
}
#page-top .content-wrapper .container-fluid .row .col-lg-12 div b center {
	color: #F00;
}
</style>
</head>

<body class="fixed-nav sticky-footer bg-dark" id="page-top">
  <!-- Navigation-->
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
  
<?php
            	
            	$rows = sql($DBH, "SELECT * FROM tbl_admin where status = ?", 
            	array("Active"), "rows");							
            	foreach($rows as $row)
            	{
            		$admin_name 		= $row['username'];
            	}
		
      if (isset($_SESSION['SESS_HASH_ADMIN'])) {
		$user_true 			 = "<h4 style='color: LIME'><b>BRITISH LEARNER'S COLLEGE: ADMIN Dashboard</b></h4>";
		
}
		echo "$user_true ";
?>
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarResponsive">
      <ul class="navbar-nav navbar-sidenav" id="exampleAccordion" name="exampleAccordion">
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Dashboard">
          <a class="nav-link" href="main.php">
            <i class="fa fa-fw fa-dashboard" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">Admin Centre</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Charts">
          <a class="nav-link" href="post_session.php">
            <i class="fa fa-fw fa-clock-o" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">School Year/Session</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Charts">
          <a class="nav-link" href="post_classes.php">
            <i class="fa fa-fw fa-building" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">Create Classes</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Charts">
          <a class="nav-link" href="add_students.php">
            <i class="fa fa-fw fa-building" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">Register New Student</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Charts">
          <a class="nav-link" href="post_subjects.php">
            <i class="fa fa-fw fa-book" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">Create Subjects</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Charts">
          <a class="nav-link" href="teachers.php">
            <i class="fa fa-fw fa-user-o" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">Manage Teachers</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Charts">
          <a class="nav-link" href="students.php">
            <i class="fa fa-fw fa-user-o" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">Manage Students/Pupils</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Charts">
          <a class="nav-link" href="deactivate_students.php">
            <i class="fa fa-fw fa-user-o" style="color: yellow"></i>
            <span class="nav-link-text" style="color: Green">ACTIVATE</span><span class="nav-link-text" style="color: Orange">/INACTIVATE</span>
          </a>
        </li>
        <li class="nav-item" data-toggle="tooltip" data-placement="right" title="Tables">
          <a class="nav-link" href="logout.php">
            <i class="fa fa-fw fa-money" style="color: #9fda18"></i>
            <span class="nav-link-text" style="color: white">Logout</span>
          </a>
        </li>
      </ul>
      <ul class="navbar-nav ml-auto">
        <li class="nav-item">
          <span class="m-0"><a class="nav-link" data-toggle="modal" href="logout.php" style="color: white; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';">            Logout</a></span>
        </li>
      </ul>
    </div>
  </nav>
  
  <div class="content-wrapper">
    <div class="container-fluid">
      <div align="center" vertical-align= "top" margin-top= "0px"><img src="sch_logo2_LAMS.png" alt="BRITISH LEARNER'S COLLEGE" width="1080" height="122"><br>
        <?php  
          $STH 				= $DBH->prepare("SELECT count(*) FROM tbl_overall WHERE class =? AND term = ? AND year = ?");
			$result 	   		= $STH->execute(array($_GET['myclass'],$_GET['term'],$_GET['examyear']));
			$count_student	  	= $STH->fetchColumn();   
			
			                      
		//$CummAVG = sql($DBH, "SELECT AVG(overall) FROM tbl_overall WHERE reg_no = ? AND class =? AND year = ?", array($_GET['myreg'],$_GET['myclass'],$_GET['examyear']), "rows"); -->							
		//foreach($CummAVG as $b_in_row){	
		//	$CummAVG	= round($b_in_row[0],2);
		//}
		
		$CummAVG = sql($DBH, "SELECT AVG(total) FROM tbl_student_results WHERE registration_no = ? AND class =? AND year = ?", array($_GET['myreg'],$_GET['myclass'],$_GET['examyear']), "rows");							
		foreach($CummAVG as $b_in_row){	
			$CummAVG	= round($b_in_row[0],2);
		}
		
		$AverageScore = sql($DBH, "SELECT AVG(total) FROM tbl_student_results WHERE registration_no = ? AND class =? AND term = ? AND year = ?", array($_GET['myreg'],$_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($AverageScore as $b_in_row){	
			$AverageScore	= round($b_in_row[0],2);
		}
		if($AverageScore <=44){
			$htcomments = "Failure, work extremely hard next time" AND $cgrade = "F" AND $cgradeR = "Fail";
			}
			else if ($AverageScore >44 && $AverageScore<= 49)
			{
			$htcomments = "Poor Pass! Work harder" AND $cgrade = "E" AND $cgradeR = "Pass";
			}
			else if ($AverageScore >49 && $AverageScore<= 59)
			{
			$htcomments = "Pass. Put more effort next term" AND $cgrade = "D" AND $cgradeR = "Pass";
			}
			else if ($AverageScore >59 && $AverageScore<= 69)
			{
			$htcomments = "Good result, put more effort next term" AND $cgrade = "C" AND $cgradeR = "Pass";
			}
			else if ($AverageScore >69 && $AverageScore<= 89)
			{
			$htcomments = "Very Good Result, put more effort" AND $cgrade = "B" AND $cgradeR = "Pass";
			}
			else if ($AverageScore >89)
			{
			$htcomments = "Excellent Result, Keep it up" AND $cgrade = "A" AND $cgradeR = "Pass";
			}

		$b_in_q = sql($DBH, "SELECT AVG(total) FROM tbl_student_results where class =? AND term = ? AND year = ?", array($_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($b_in_q as $b_in_row){	
			$b_in	= round($b_in_row[0],2);
		}	
		                      
		$b_in_qa = sql($DBH, "SELECT AVG(total) FROM tbl_student_results where class =? AND term = ? AND year = ?", array($_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($b_in_qa as $b_in_row){	
			$b_inqa	= $b_in_row[0];
		}
		                         
		$b_in_m = sql($DBH, "SELECT MIN(total) FROM tbl_student_results where  class =? AND term = ? AND year = ?", array($_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($b_in_m as $b_in_row){	
			$b_inm	= $b_in_row[0];
		}
		                         
		$b_in_mx = sql($DBH, "SELECT MAX(total) FROM tbl_student_results where class =? AND term = ? AND year = ?", array($_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($b_in_mx as $b_in_row){	
			$b_inmx	= $b_in_row[0];
		}
		
		$b_in_ag = sql($DBH, "SELECT AVG(age) FROM tbl_overall where class =? AND term = ? AND year = ?", array($_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($b_in_ag as $b_in_row){	
			$b_inag	= $b_in_row[0];
			
			$b_age = round(($b_inag),2);
		}
		
                    $rows1 = sql($DBH, "SELECT * FROM tbl_user where registration_no = ?", 
            	array($_GET['myreg']), "rows");
		foreach($rows1 as $row1)
		{	
			$user_name	 		= $row1['fullname'];
			$user_gender	 		= $row1['gender'];
			$user_age	 		= $row1['age'];
			$user_profile_pic	 	= $row1['profile_pic'];
		}
		
            		if($user_profile_pic == "default"){
            		$profile_pic = "<img width='100px' src='../admin/profile/profile.jpg'>";
			}else{						
			$profile_pic = "<img width='100px' src='../admin/profile_pic/$user_profile_pic'>";
			}
		
                    $rows1 = sql($DBH, "SELECT * FROM tbl_overall where class =? AND term = ? AND year = ? AND reg_no =?", array($_GET['myclass'],$_GET['term'],$_GET['examyear'],$_GET['myreg']), "rows");
		foreach($rows1 as $row1)
		{	
			$user_position	 		= $row1['position'];
			$overall	 		= $row1['overall'];
		}
		
		if($user_position == 1){
		$user_p = "$user_position st";
		} else if($user_position == 2){
		$user_p = "$user_position nd";
		} else if($user_position == 3){
		$user_p = "$user_position rd";
		} else if($user_position == 21){
		$user_p = "$user_position st";
		} else if($user_position == 22){
		$user_p = "$user_position nd";
		} else if($user_position == 23){
		$user_p = "$user_position rd";
		} else if($user_position == 31){
		$user_p = "$user_position st";
		} else if($user_position == 32){
		$user_p = "$user_position nd";
		} else if($user_position == 33){
		$user_p = "$user_position rd";
		} else if($user_position == 41){
		$user_p = "$user_position st";
		} else if($user_position == 42){
		$user_p = "$user_position nd";
		} else if($user_position == 43){
		$user_p = "$user_position rd";
		} else if($user_position == 51){
		$user_p = "$user_position st";
		} else if($user_position == 52){
		$user_p = "$user_position nd";
		} else if($user_position == 53){
		$user_p = "$user_position rd";
		}else{
		$user_p = "$user_position th";
		}
		
	?>
        <?php
$rows = sql($DBH, "SELECT * FROM skills_and_remarksPriColl where registration_no = ? AND class =? AND term =? AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $SchOpen  		= $row['SchOpen'];
                $Present  		= $row['Present'];
                $Absent  		= $row['Absent'];
                $Punctual  		= $row['Punctual'];
                $TermBegins   		= $row['TermBegins'];                
                $DateOfReport  		= $row['DateOfReport'];
                $CoordinatorsComment 		= $row['CoordinatorsComment'];
                $TeachersRemark  		= $row['TeachersRemark'];
                $HandW 			= $row['HandW'];			
			$VerbalF 			= $row['VerbalF'];			
			$Games 			= $row['Games'];			
			$Sports 			= $row['Sports'];			
			$HandlingT 			= $row['HandlingT'];			
			$DrawingP 			= $row['DrawingP'];			
			$MusicalS 			= $row['MusicalS'];			
			$Punctuality 			= $row['Punctuality'];			
			$Neatness 			= $row['Neatness'];			
			$Co_op 			= $row['Co_op'];			
			$EmotionalS 			= $row['EmotionalS'];			
			$Health 			= $row['Health'];			
			$AttitudeW 			= $row['AttitudeW'];			
			$Attentiveness 			= $row['Attentiveness'];			
			$Perseverance 			= $row['Perseverance'];			
			$Speaking 			= $row['Speaking'];			
			$TimesPresent 			= $row['TimesPresent'];			
			$Debt 			= $row['Debt'];			
			$NextFee 			= $row['NextFee'];			
			$EndOfNextT 			= $row['EndOfNextT'];			
			$TeacherN 			= $row['TeacherN'];		

                               }
?>
      </div>
      	  <Center> <div class='col-sm-12' style='font-size: 20px; color: Green'>Student's Name: <b><?php echo $user_name ; ?></b> 
      	  </div></Center><br />

      <div class='row'>
	  <div class='col-sm-4'> 
	    <small><b>Registration No: </b> <u><?php echo $_GET['myreg'] ; ?></u></small><br>
	    <small><b>Sex: </b> <u><?php echo $user_gender ; ?></u></small><br>
	    <small><b>Term: </b> <u><?php echo $_GET['term']; ?></u></small><br>
	    <small><b>Session: </b> <u><?php echo $_GET['examyear']; ?></u></small><br>
	    <small><b>Age : </b>
	    <Big>
	    <?php
			
			$rows1 = sql($DBH, "SELECT * FROM tbl_user where hash = ?", array($SESS_HASH_USER), "rows");							
			foreach($rows1 as $row1)
			{	
				$dob   		= $row1['age'];
				$userst_registration_no   		= $row1['registration_no'];
				
				//date in mm/dd/yyyy format; or it can be in other formats as well
  $birthDate = "$dob";
  //explode the date to get month, day and year
  $birthDate = explode("/", $birthDate);
  //get age from date or birthdate
  $age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md")
    ? ((date("Y") - $birthDate[2]) - 1)
    : (date("Y") - $birthDate[2]));
    }
    
              
		$rows = sql($DBH, "SELECT MIN(id) AS id, class FROM tbl_student_results  WHERE registration_no = ? GROUP BY class", 
            	array($userst_registration_no), "rows");
		foreach($rows as $row)
		{	
			$userst_class	 		= $row['class'];
		}
		
		$rows = sql($DBH, "SELECT MAX(id) AS id, subclass FROM tbl_student_results  WHERE registration_no = ? GROUP BY subclass", 
            	array($userst_registration_no), "rows");
		foreach($rows as $row)
		{	
			$userst_subclass	 		= $row['class'];
		}
		
			 echo $age; ?>
	    </Big>Yr(s)	    </small><br>
      </div>
	  <div class='col-sm-3'> <small><b>Class: </b> <u><?php echo $_GET['myclass'] ; ?></u></small><br>
		  <small><b>No in Class: </b> <u><?php echo $count_student; ?></u></small><br>
	    <!-- <small><b>Position: </b> <u><medium><?php echo $user_p ; ?></medium></u></small><br><br>-->
		  <!--<small><b>Total Score: </b> <u><medium><?php echo $overall ; ?></medium></u></small><br>-->
		  <!--<small><b> Average Score: </b> <u><?php echo $AverageScore ; ?></u></small><br>-->
		  <small><b>Class Average Score: </b> <u><?php echo $b_in ; ?></u></small><br>
		  <Small><b>Term Ending: </b> <u><?php echo $DateOfReport; ?></u></Small><br>
		   <br>
		  <!--<small><b>Position: </b></small> <u><?php echo $user_p ; ?></u> :: <small><b>Grade: </b></small> <u><?php echo $cgrade ; ?></u><br>-->
	  </div><br />
		<div class='col-sm-3'><small><b>Total Sch. Days: </b><small><big><big><u><?php echo $SchOpen; ?></u></big></big></small></small><br>
		  <small><b>Times Present: </b> <u><?php echo $TimesPresent; ?></u></small><br>
		  <!--<small><b>Times Punctual: </b> <u><?php echo $Punctual; ?></u></small><br> -->
		  <small><b>Times Absent: </b> <u><?php echo $Absent; ?></u></small><br>
		  <br>
		  <small><b>Next Term Begins : </b> <?php echo $TermBegins; ?></small><br>
		  <br>
	  </div>
		<div class='col-sm-2'>
			<?php echo $profile_pic ; ?><br/>
	</div>
      </div>
      <div class="row">
      <div class="col-sm-9">
            <b><u><Center>PERFORMANCE & PROGRESS RECORDS For <?php echo $_GET['term']; ?>, <?php echo $_GET['examyear']; ?></Center></u></b>
    </div>
      <div class="row">
      <div class="col-sm-9">
                            <table width="98%" border="1" class='table table-bordered'>
                                <tr style='font-size: 10px'>
                                    <th width="42%" class='text-center' colspan='2' valign="baseline" rowspan='3'>Subject</th>
                                    <th width="4%" colspan='1'  class='text-center'>Test<br />Score</th>
                                      <th width="4%" colspan='1'  class='text-center'>Exam<br />Score</th>
                                    <th width="4%" colspan='1'  class='text-center'>Term<br>
                                    Total</th>
                                    <th  class='text-left' colspan='5'>Summary of <?php echo $_GET['term']; ?> Term's Work</th>
                                </tr>
                                <tr style='font-size: 10px'>
    								
    								<th bgcolor="#C1C1C1"  class='text-center'>40</th>	
    								<th bgcolor="#C1C1C1"  class='text-center'>60</th>	
    								<th bgcolor="#C1C1C1"  class='text-center'>100</th>
   								  <th width="3%" rowspan='2' valign="baseline"  class='text-center'>Class <br/> 
   								  Avg.</th>
   								  <th width="10%" rowspan='2' valign="baseline"  class='text-left'>Grade</th>	
    								<th width="51%" rowspan='2' valign="baseline"  class='text-left'>Comment</th>	
                                </tr>
                                <tr style='font-size: 10px'>

<?php
                                
	$rows = sql($DBH, "SELECT * FROM tbl_student_results where registration_no = ? AND class =? AND term =? AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $subject 	 	= $row['subject'];
                $test1 		= $row['test1'];
                $exam 		= $row['exam'];
                $total 		= $row['total'];
                $position 		= $row['position'];
                $remark 		= $row['grade'];
                $hremark 		= $row['hgrade'];
		if($position == 1){
		$position = "$position st";
		} else if($position == 2){
		$position = "$position nd";
		} else if($position == 3){
		$position = "$position rd";
		} else if($position == 21){
		$position = "$position st";
		} else if($position == 22){
		$position = "$position nd";
		} else if($user_position == 23){
		$position = "$position rd";
		} else if($position == 31){
		$position = "$position st";
		} else if($user_position == 32){
		$position = "$position nd";
		} else if($position == 33){
		$position = "$position rd";
		} else if($position == 41){
		$position = "$position st";
		} else if($position == 42){
		$position = "$position nd";
		} else if($position == 43){
		$position = "$position rd";
		} else if($position == 51){
		$position = "$position st";
		} else if($position == 52){
		$position = "$position nd";
		} else if($user_position == 53){
		$position = "$position rd";
		} else{
		$position = "$position th";
		}
                
                                        
		$b_in_mn = sql($DBH, "SELECT MIN(total) FROM tbl_student_results where class =? AND year = ? AND term =? AND subject =?", array($_GET['myclass'],$_GET['examyear'],$_GET['term'],$subject), "rows");							
		foreach($b_in_mn as $b_in_row){	
			$b_inmn	= $b_in_row[0];
		}
		                            
		$b_in_mnx = sql($DBH, "SELECT MAX(total) FROM tbl_student_results where class =? AND year = ? AND term =? AND subject =?", array($_GET['myclass'],$_GET['examyear'],$_GET['term'],$subject), "rows");							
		foreach($b_in_mnx as $b_in_row){	
			$b_inmnx	= $b_in_row[0];
		}
		                               
		$b_in_mav = sql($DBH, "SELECT AVG(total) FROM tbl_student_results where class =? AND term = ? AND year = ? AND subject =?", array($_GET['myclass'],$_GET['term'],$_GET['examyear'],$subject), "rows");							
		foreach($b_in_mav as $b_in_row){	
			$b_inmav = round($b_in_row[0],2);
		}
		  
			if($total <=49){
			$grade = "E"  AND $remarkk ="Poor";
			}
			else if ($total >49 && $total<= 59)
			{
			$grade = "D"  AND $remarkk ="Fair";
			}
			else if ($total >59 && $total<= 64)
			{
			$grade = "C"  AND $remarkk ="Below Average";
			}
			else if ($total >64 && $total<= 69)
			{
			$grade = "C+"  AND $remarkk ="Average";
			}
			else if ($total >69 && $total<= 74)
			{
			$grade = "B"  AND $remarkk ="Above Average";
			}
			else if ($total >74 && $total<= 79)
			{
			$grade = "B+"  AND $remarkk ="Very Good";
			}
			else if ($total >79 && $total<= 89)
			{
			$grade = "A"  AND $remarkk ="Credit";
			}
			else if ($total >89)
			{
			$grade = "A+"  AND $remarkk ="Distinction";
			}
		
			 
                
                echo"
                                <tr>
                                <td colspan='2' style='font-size: 12px'><B>$subject</B></td>
                                <td>$test1</td>
                                <td>$exam</td>
                                <td>$total</td>
                                <td>$b_inmav</td>
                                <td>$grade</td>
                                <td>$remarkk</td>
                                </tr>";
                               }
?>
	          <?php
	          
	          $rows = sql($DBH, "SELECT * FROM tbl_CummClass where reg_no = ? AND class =? AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $CummPos 	 	= $row['position'];
                if($CummPos == 1){
		$CummPos = $CummPos.st;
		} else if($CummPos == 2){
		$CummPos =$CummPos.nd;
		} else if($CummPos == 3){
		$CummPos = $CummPos.rd;
		} else if($CummPos == 21){
		$CummPos = $CummPos.st;
		} else if($CummPos == 22){
		$CummPos = $CummPos.nd;
		} else if($CummPos == 23){
		$CummPos = $CummPos.rd;
		} else if($CummPos == 31){
		$CummPos = $CummPos.st;
		} else if($CummPos == 32){
		$CummPos = $CummPos.nd;
		} else if($CummPos == 33){
		$CummPos = $CummPos.rd;
		} else if($CummPos == 41){
		$CummPos = $CummPos.st;
		} else if($CummPos == 42){
		$CummPos = $CummPos.nd;
		} else if($CummPos == 43){
		$CummPos = $CummPos.rd;
		} else if($CummPos == 51){
		$CummPos = $CummPos.st;
		} else if($CummPos == 52){
		$CummPos = $CummPos.nd;
		} else if($CummPos == 53){
		$CummPos = $CummPos.rd;
		} else{
		$CummPos = $CummPos.th;
		}
                
		}
    
$rows = sql($DBH, "SELECT * FROM skills_and_remarksPriColl where registration_no = ? AND class =? AND term =? AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $SchOpen  		= $row['SchOpen'];
                $Absent  		= $row['Absent '];
                $TermBegins   		= $row['TermBegins'];                
                $DateOfReport  		= $row['DateOfReport'];
                $HandW 			= $row['HandW'];			
			$VerbalF 			= $row['VerbalF'];			
			$Games 			= $row['Games'];			
			$Sports 			= $row['Sports'];			
			$HandlingT 			= $row['HandlingT'];			
			$DrawingP 			= $row['DrawingP'];			
			$MusicalS 			= $row['MusicalS'];			
			$Punctuality 			= $row['Punctuality'];			
			$Neatness 			= $row['Neatness'];			
			$Co_op 			= $row['Co_op'];			
			$EmotionalS 			= $row['EmotionalS'];			
			$Health 			= $row['Health'];			
			$AttitudeW 			= $row['AttitudeW'];			
			$Attentiveness 			= $row['Attentiveness'];			
			$Perseverance 			= $row['Perseverance'];			
			$Speaking 			= $row['Speaking'];			
			$TimesPresent 			= $row['TimesPresent'];			
			$Debt 			= $row['Debt'];			
			$NextFee 			= $row['NextFee'];			
			$EndOfNextT 			= $row['EndOfNextT'];			
			$TeacherN 			= $row['TeacherN'];		
                $TeachersRemarks   		= $row['TeachersRemarks'];
                $PrincipalsComment   		= $row['PrincipalsComment'];
                $hremark   		= $row['hgrade'];
                //$NextTermFees   		= $row['NextTermFees'];
                //$FeesOwed   		= $row['FeesOwed'];
                //$TotalFees   		= $row['FeesOwed']+$row['NextTermFees'];
                //$Subtotal = number_format($TotalFees, 2, '.', ',');
                               }
?>
</tr></tr>
</table>
<div class="col-sm-12">
    <div class="row">
        <div class="col-sm-3"><b>Grand Total:</b> <u><?php echo $overall ; ?></u></div>
        <div class="col-sm-3"><b>% Average:</b> <u><?php echo $AverageScore ; ?></u></div>
        <div class="col-sm-3"><b>Remarks:</b> <u><?php echo $cgradeR ; ?></u></div>
        <div class="col-sm-3"><b>Grade:</b> <u><?php echo $cgrade ; ?></u></div>
    </div>
</div>
<hr size="10">
<div class="col-sm-12"> <center>CUMMULATIVE RESULTS (Totals) <b>Cumm. Class Position:</b> <u><B>N/A</B><?php //echo $CummPos ; ?></u></center>
                            <table width="98%" border="1" class='table table-bordered'>
    								<th bgcolor="#C1C1C1"  class='text-center'>1st Term Total</th>	
    								<th bgcolor="#C1C1C1"  class='text-center'>2nd Term Total</th>	
    								<th bgcolor="#C1C1C1"  class='text-center'>3rd Term Total</th>	
    								<th bgcolor="#C1C1C1"  class='text-center'>Grand Total <br />(3 Terms)</th>
   								  <th bgcolor="#C1C1C1"  class='text-center'>Cumm. Average</th>
                                <tr style='font-size: 10px'>

<?php
    
    
    $rows = sql($DBH, "SELECT * FROM tbl_overall where reg_no = ? AND class =? AND term ='1st Term' AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $T1 	 	= $row['overall'];
		}
		
		
		$rows = sql($DBH, "SELECT * FROM tbl_overall where reg_no = ? AND class =? AND term ='2nd Term' AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $T2 	 	= $row['overall'];
		}
		
		
		$rows = sql($DBH, "SELECT * FROM tbl_overall where reg_no = ? AND class =? AND term ='3rd Term' AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $T3 	 	= $row['overall'];
		}
           $CummTotal 	 	= $T1+$T2+$T3;
	$rows = sql($DBH, "SELECT * FROM tbl_overall where reg_no = ? AND class =? AND term ='2nd Term' AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $subject 	 	= $row['subject'];
                $test1 		= $row['test1'];
                $exam 		= $row['exam'];
                $total 		= $row['overall'];
                $position 		= $row['position'];
                $remark 		= $row['grade'];
                $hremark 		= $row['hgrade'];
		if($position == 1){
		$position = "$position st";
		} else if($position == 2){
		$position = "$position nd";
		} else if($position == 3){
		$position = "$position rd";
		} else if($position == 21){
		$position = "$position st";
		} else if($position == 22){
		$position = "$position nd";
		} else if($user_position == 23){
		$position = "$position rd";
		} else if($position == 31){
		$position = "$position st";
		} else if($user_position == 32){
		$position = "$position nd";
		} else if($position == 33){
		$position = "$position rd";
		} else if($position == 41){
		$position = "$position st";
		} else if($position == 42){
		$position = "$position nd";
		} else if($position == 43){
		$position = "$position rd";
		} else if($position == 51){
		$position = "$position st";
		} else if($position == 52){
		$position = "$position nd";
		} else if($user_position == 53){
		$position = "$position rd";
		} else{
		$position = "$position";
		}
                
                                        
		$b_in_mn = sql($DBH, "SELECT MIN(total) FROM tbl_student_results where class =? AND year = ? AND term =? AND subject =?", array($_GET['myclass'],$_GET['examyear'],$_GET['term'],$subject), "rows");							
		foreach($b_in_mn as $b_in_row){	
			$b_inmn	= $b_in_row[0];
		}
		                            
		$b_in_mnx = sql($DBH, "SELECT MAX(total) FROM tbl_student_results where class =? AND year = ? AND term =? AND subject =?", array($_GET['myclass'],$_GET['examyear'],$_GET['term'],$subject), "rows");							
		foreach($b_in_mnx as $b_in_row){	
			$b_inmnx	= $b_in_row[0];
		}
		                               
		$b_in_mav = sql($DBH, "SELECT AVG(total) FROM tbl_student_results where class =? AND term = ? AND year = ? AND subject =?", array($_GET['myclass'],$_GET['term'],$_GET['examyear'],$subject), "rows");							
		foreach($b_in_mav as $b_in_row){	
			$b_inmav = round($b_in_row[0],2);
		}
		  
			if($total <=49){
			$grade = "E";
			}
			else if ($total >49 && $total<= 59)
			{
			$grade = "D";
			}
			else if ($total >59 && $total<= 64)
			{
			$grade = "C";
			}
			else if ($total >64 && $total<= 69)
			{
			$grade = "C+";
			}
			else if ($total >69 && $total<= 74)
			{
			$grade = "B";
			}
			else if ($total >74 && $total<= 79)
			{
			$grade = "B+";
			}
			else if ($total >79 && $total<= 89)
			{
			$grade = "A";
			}
			else if ($total >89)
			{
			$grade = "A+";
			}
		
			 
                
                echo"
                                <tr>
                                <td><center>$T1</center></td>
                                <td><center>$T2</center></td>
                                <td><center>$T3</center></td>
                                <td><center>$CummTotal</center></td>
                                <td><center>$CummAVG %</center></td>
                                </tr>";
                               }
?>
	          <?php
$rows = sql($DBH, "SELECT * FROM skills_and_remarksPriColl where registration_no = ? AND class =? AND term =? AND year =?", array($_GET['myreg'],$_GET['myclass'],$_GET['term'],$_GET['examyear']), "rows");							
		foreach($rows as $row)
		{	
                $SchOpen  		= $row['SchOpen'];
                $Absent  		= $row['Absent '];
                $TermBegins   		= $row['TermBegins'];                
                $DateOfReport  		= $row['DateOfReport'];
                $HandW 			= $row['HandW'];			
			$VerbalF 			= $row['VerbalF'];			
			$Games 			= $row['Games'];			
			$Sports 			= $row['Sports'];			
			$HandlingT 			= $row['HandlingT'];			
			$DrawingP 			= $row['DrawingP'];			
			$MusicalS 			= $row['MusicalS'];			
			$Punctuality 			= $row['Punctuality'];			
			$Neatness 			= $row['Neatness'];			
			$Co_op 			= $row['Co_op'];			
			$EmotionalS 			= $row['EmotionalS'];			
			$Health 			= $row['Health'];			
			$AttitudeW 			= $row['AttitudeW'];			
			$Attentiveness 			= $row['Attentiveness'];			
			$Perseverance 			= $row['Perseverance'];			
			$Speaking 			= $row['Speaking'];			
			$TimesPresent 			= $row['TimesPresent'];			
			$Debt 			= $row['Debt'];			
			$NextFee 			= $row['NextFee'];			
			$EndOfNextT 			= $row['EndOfNextT'];			
			$TeacherN 			= $row['TeacherN'];		
                $TeachersRemarks   		= $row['TeachersRemarks'];
                $PrincipalsComment   		= $row['PrincipalsComment'];
                $hremark   		= $row['hgrade'];
                //$NextTermFees   		= $row['NextTermFees'];
                //$FeesOwed   		= $row['FeesOwed'];
                //$TotalFees   		= $row['FeesOwed']+$row['NextTermFees'];
                //$Subtotal = number_format($TotalFees, 2, '.', ',');
                               }
?>
</tr></tr>
</table>

</div>
       <tr>
                      <Center><strong><u>Grade Details:</u></strong>   <small><td height="120" bgcolor="#CCCCFF"><strong>90-100</strong> = Exellent.  <strong>80-89</strong> = Very Good.     <strong>75-79</strong> = Good.  <strong>70-74</strong> = Pass.   <strong>65-69</strong> = Poor Pass.  <strong>60-64</strong> = Poor Pass.  <strong>50-59</strong> = Fair.  <strong style='color: Red'>0-49 = Poor</strong><P></P></small></Center>
        </tr>
        </div>
    <div class="col-sm-3">
	          <table width="98%" height="5%" border="1" cellspacing="5">
	            <STRONG>PSYCHOMOTOR SKILLS</STRONG><tr style='font-size: 16px'>
            <tr style='font-size: 10px'>
	            <tr style='font-size: 12px'>
	              <td width="65%"><small><strong><span class="text-center">Handwriting</span></strong></small></td>
	              <td width="8%"><small><?php echo $HandW; ?></small></td>
                </tr>
	            <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Verbal Fluency</span></strong></small></td>
	              <td><?php echo $VerbalF; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Games</span></strong></small></td>
	              <td><?php echo $Games; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Sports</span></strong></small></td>
	              <td><?php echo $Sports; ?></td>
                </tr>
	            <tr style='font-size: 12px'>
	              <td><small><strong>Handling Tools</strong></small></td>
	              <td><?php echo $HandlingT; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Drawing & Painting</span></strong></small></td>
	              <td><?php echo $DrawingP; ?></td>
                </tr>
	            <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Musical Skills</span></strong></small></td>
	              <td><?php echo $MusicalS; ?></td>
                </tr>
                </table><br />
                    <table width="98%" height="5%" border="1" cellspacing="5">
	            <STRONG>AFFECTIVE AREAS</STRONG><tr style='font-size: 16px'>
            <tr style='font-size: 10px'>
	            <tr style='font-size: 12px'>
	              <td width="65%"><small><strong><span class="text-center">Punctuality</span></strong></small></td>
	              <td width="8%"><small><?php echo $Punctuality; ?></small></td>
                </tr>
	            <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Neatness</span></strong></small></td>
	              <td><?php echo $Neatness; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Co-operation With Others</span></strong></small></td>
	              <td><?php echo $Co_op; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Emotional Stability</span></strong></small></td>
	              <td><?php echo $EmotionalS; ?></td>
                </tr>
	            <tr style='font-size: 12px'>
	              <td><small><strong>Health</strong></small></td>
	              <td><?php echo $Health; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Attitude to Work</span></strong></small></td>
	              <td><?php echo $AttitudeW; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Attentiveness</span></strong></small></td>
	              <td><?php echo $Attentiveness; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Perseverance</span></strong></small></td>
	              <td><?php echo $Perseverance; ?></td>
                </tr>
                <tr style='font-size: 12px'>
	              <td><small><strong><span class="text-center">Speaking</span></strong></small></td>
	              <td><?php echo $Speaking; ?></td>
                </tr>
                </table><br />
	           <tr>
                      <strong><u>Key:</u><br /></strong> <td height="176" bgcolor="#CCCCFF"><strong>D</strong> = Distinction.<br /><strong>E</strong> = Exellent.<br />  <strong>VG</strong> = Very Good.<br />     <strong>G</strong> = Good.<br />  <strong>F</strong> = Fair.<br />   <strong>P</strong> = Poor.<br /><P></P>
                      Next Term Fees: <U><b>₦<?php echo $NextTermFees; ?><br /></b></U>
                      Other Fees Owed: <U><b>₦<?php echo $FeesOwed; ?><br /></b></U>
                      Total Amt. to be Paid:<br /> <U><b>₦<?php echo $Subtotal; ?></b></U>
        </tr>

    </div>
<br />
<br />

	    <br /><P>
	  <div class='col-sm-12'> 
	  <div class='row'>
	      <div class='col-sm-7'><small><b>Class Teacher's Comment : </b></small><medium><u><?php echo $TeachersRemarks; ?></u></medium>
	    <br>
	    <small><b>Head Teacher's Comment : </b></small><medium><u><?php echo $htcomments; ?></u></medium><br></P>
	   </div>
	   	      <div class='col-sm-2' align="left" vertical-align= "top" margin-top= "0px" ><img src="https://lams.com.ng/portal/admin/stam.jpg" alt="School Stamp" width="150" height="90">
	            </div>
	            
	            <div class='col-sm-3' align="left" vertical-align= "top" margin-top= "0px" ><center><button onclick="myFunction()">PRINT THIS RESULT</button></center>
	            </div>
	  </div>
	 </div>
	</div>
<script>
function myFunction() {
    window.print();
}
</script>
    </div>
</div>
          </div>
    <!-- /.container-fluid-->
    <!-- /.content-wrapper-->
    <footer class="sticky-footer" style="background: GRAY">
      <div class="container">
        <div class="text-center"> <small><strong><span class="style1">Copyright © 2021-2024 BRITISH LEARNER'S COLLEGE, OWERRI: All Rights Reserved! 
        <br>| <a href="https://dataswift.com.ng"; color="pink">POWERED BY DATASWIFT PORTALS</a></span></strong></small> </div>
      </div>
    </footer>
    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
      <i class="fa fa-angle-up"></i>
    </a>
    <!-- Logout Modal-->
    <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
            <button class="close" type="button" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">×</span>
            </button>
          </div>
          <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
          <div class="modal-footer">
            <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
            <a class="btn btn-primary" href="Sign_in.php">Logout</a>
          </div>
        </div>
      </div>
    </div>
    <!-- Bootstrap core JavaScript-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- Core plugin JavaScript-->
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>
    <!-- Page level plugin JavaScript-->
    <script src="vendor/chart.js/Chart.min.js"></script>
    <script src="vendor/datatables/jquery.dataTables.js"></script>
    <script src="vendor/datatables/dataTables.bootstrap4.js"></script>
    <!-- Custom scripts for all pages-->
    <script src="js/sb-admin.min.js"></script>
    <!-- Custom scripts for this page-->
    <script src="js/sb-admin-datatables.min.js"></script>
    <script src="js/sb-admin-charts.min.js"></script>
  </div>
</body>

</html>
