<?php 
include('config.php');

?>
<?php
include('includes/user_data.php');

?>
<?php
if(isset($_POST['res']))
  {
$_SESSION['name']=$_POST['name'];
$_SESSION['ad_no']=$_POST['ad_no'];
$_SESSION['classes']=$_POST['classes'];
$_SESSION['session']=$_POST['session'];
$_SESSION['term']=$_POST['term'];
//echo "<script type='text/javascript'> document.location = 'candidate_mid_report.php'; </script>";

$extra="candidate_terminal_report.php";
			$host  = $_SERVER['HTTP_HOST'];
			$uri  = rtrim(dirname($_SERVER['PHP_SELF']),'/\\');
			echo "<script type='text/javascript'> document.location = 'https://$host$uri/$extra'; </script>";
				

			//$_SESSION['errmsg']="Your username field is empty";
				exit();
}

?>


<!doctype html>
<html lang="en">


<!-- Mirrored from codervent.com/rocker/demo/vertical/user-profile.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 26 Aug 2022 06:47:36 GMT -->
<head>
	<!-- Required meta tags -->
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!--favicon-->
	<link rel="icon" href="assets/images/favicon-32x32.png" type="image/png" />
	<!--plugins-->
	<link href="assets/plugins/simplebar/css/simplebar.css" rel="stylesheet" />
	<link href="assets/plugins/perfect-scrollbar/css/perfect-scrollbar.css" rel="stylesheet" />
	<link href="assets/plugins/metismenu/css/metisMenu.min.css" rel="stylesheet" />
	<!-- loader-->
	<link href="assets/css/pace.min.css" rel="stylesheet" />
	<script src="assets/js/pace.min.js"></script>
	<!-- Bootstrap CSS -->
	<link href="assets/css/bootstrap.min.css" rel="stylesheet">
	<link href="assets/css/bootstrap-extended.css" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&amp;display=swap" rel="stylesheet">
	<link href="assets/css/app.css" rel="stylesheet">
	<link href="assets/css/icons.css" rel="stylesheet">
	<!-- Theme Style CSS -->
	<link rel="stylesheet" href="assets/css/dark-theme.css" />
	<link rel="stylesheet" href="assets/css/semi-dark.css" />
	<link rel="stylesheet" href="assets/css/header-colors.css" />
	<title> End term Report</title>
	<style>
	    label{
	        margin:20px;
	    }
	</style>
</head>

<body>
	<!--wrapper-->
	<div class="wrapper">
		<!--sidebar wrapper -->
		<?php include 'includes/side.php'; ?>
		<!--end sidebar wrapper -->
		<!--start header -->
		<?php include 'includes/head.php'; ?>
		<!--end header -->
		<!--start page wrapper -->
		<div class="page-wrapper">
			<div class="page-content">
				<!--breadcrumb-->
				    <div class="row">
					<div class="col-xl-9 mx-auto">
						<h6 class="mb-0 text-uppercase"> Terminal Result</h6>
						<hr/>
						<div class="card">
							<div class="card-body">
								<div class="p-4 border rounded">
									<form action="" method="POST" class="row g-3 needs-validation" novalidate>
										<div class="col-md-4">
											<label for="validationCustom01" class="form-label">Admission Number</label>
											<input type="text" class="form-control" id="validationCustom01" value="<?php echo $user_email;?>" name="ad_no" readonly >
											<div class="valid-feedback">Looks good!</div>
										</div>
									<div class="col-md-4">
    <label for="validationCustom02" class="form-label">Class</label>
    <select class="form-select"  id="validationCustom02" name="classes" required>
        <?php
        $stmt = $dbh->prepare("SELECT id, name FROM classes");
        $stmt->execute();
        $classes = $stmt->fetchAll(PDO::FETCH_ASSOC);
        
        foreach ($classes as $class) {
            $selected = ($class['id'] == $class_id) ? 'selected' : '';
            echo "<option value='{$class['id']}' $selected>{$class['name']}</option>";
        }
        ?>
    </select>
    <div class="valid-feedback">Looks good!</div>
</div>
										<div class="col-md-4">
											<label for="validationCustomUsername" class="form-label">Name</label>
											<div class="input-group has-validation"> 
												<input type="text" class="form-control" value="<?php echo $full_name;?>" name="name" aria-describedby="inputGroupPrepend" readonly >
												
											</div>
										</div>
										<div class="col-md-6">
											<label for="validationCustom03" class="form-label">Session</label>
										<select class="form-select" id="inputSelectCountry" aria-label="Default select example" name="session">  
					<?php $sql = "SELECT * from sessions"; 
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{				?>
												 <option value="<?php echo htmlentities($result->id);?>"><?php echo htmlentities($result->session_year);?></option>
												 
												 
										<?php $cnt=$cnt+1; }} ?>
										
										
                                    
												</select>
										</div>
										<div class="col-md-6">
											<label for="validationCustom04" class="form-label">Term</label>
											<select class="form-select" id="inputSelectCountry" aria-label="Default select example" name="term">  
					<?php $sql = "SELECT * from terms"; 
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{				?>
												 <option value="<?php echo htmlentities($result->id);?>"><?php echo htmlentities($result->term_name);?></option>
												 
												 
										<?php $cnt=$cnt+1; }} ?>
										
										
                                    
												</select>
										
										</div>
									
									
										<div class="col-12">
											<button class="btn btn-primary" type="submit" name="res">Check Result</button>
										</div>
									</form>
								</div>
							</div>
						</div>
					
					</div>
				</div>
				<!--end breadcrumb-->
				<div class="container">
					
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--end page wrapper -->
		<!--start overlay-->
		<div class="overlay toggle-icon"></div>
		<!--end overlay-->
		<!--Start Back To Top Button--> <a href="javaScript:;" class="back-to-top"><i class='bx bxs-up-arrow-alt'></i></a>
		<!--End Back To Top Button-->
		<footer class="page-footer">
			<p class="mb-0">Copyright © 2024. All right reserved.</p>
		</footer>
	</div>
	<!--end wrapper-->
	<!--start switcher-->
	<?php include 'includes/customiser.php'; ?>

	<!--end switcher-->
	<!-- Bootstrap JS -->
	<script src="assets/js/bootstrap.bundle.min.js"></script>
	<!--plugins-->
	<script src="assets/js/jquery.min.js"></script>
	<script src="assets/plugins/simplebar/js/simplebar.min.js"></script>
	<script src="assets/plugins/metismenu/js/metisMenu.min.js"></script>
	<script src="assets/plugins/perfect-scrollbar/js/perfect-scrollbar.js"></script>
	<!--app JS-->
	<script src="assets/js/app.js"></script>
</body>


<!-- Mirrored from codervent.com/rocker/demo/vertical/user-profile.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 26 Aug 2022 06:47:36 GMT -->
</html>