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

?>


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

?>
<?php
//error_reporting(0);
if(isset($_POST['reg']))
{
$class_id =$_POST['class_id'];
$Admission_num=$_POST['Admission_num']; 
$name=$_POST['name']; 
$sex=$_POST['sex'];
$dob=$_POST['dob']; 
$religion=$_POST['religion'];
$address=$_POST['address']; 
$parent_name=$_POST['parent_name'];
$parent_phone=$_POST['parent_phone'];


$id=intval($_GET['id']);

$sql = "UPDATE students SET class_id='$class_id', Admission_num='$Admission_num',name='$name',sex='$sex',dob='$dob',religion='$religion',address='$address',parent_name='$parent_name',parent_phone='$parent_phone' WHERE id='$id'";

if (mysqli_query($conn, $sql)) {
   $msg="succesfully updated";
//   	$extra="list_student.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']="succesfully updated";
// 				exit();
} else {
    $error="something is  wrong"; 
}
  
}  
          ?>
<!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> PENUEL  COLLEGE</title>
</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="row">
		<div class="row">
      <div class="col-md-3 col-sm-0">
        
      </div>
      
      <div class="col-md-6 col-sm-8">
        <div class="profile_wrap" style="  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
 border-radius: 20px; padding: 10px; margin-top:5%; ">
<!--<form name="chngpwd" method="post" >-->
        
            <div class="gray-bg field-title">
              <h6 class="text-center">     Edit Student</h6>
            </div>


								<div class="alert alert-success border-0 bg-success alert-dismissible fade show py-2">
									<div class="d-flex align-items-center">
										<div class="font-35 text-white"><i class='bx bxs-check-circle'></i>
										</div>
										<div class="ms-3">
											<h6 class="mb-0 text-white"> Info</h6>
											<div class="text-white"><?php if($error){?><div class="errorWrap" style="color:red;"><strong>ERROR</strong>:<?php echo htmlentities($error); ?> </div><?php } 
        else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo htmlentities($msg); ?> </div><?php }?></div>
										</div>
									</div>
									<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
								</div>






             
           	<div class="form-body">
           	    <?php 
$id=intval($_GET['id']);
$sql ="SELECT * from students where id=:id";
$query = $dbh -> prepare($sql);
$query-> bindParam(':id', $id, PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{	?>



                
                
                
                
                <form class="row g-3" action="" method="post" enctype="multipart/form-data">
										    
										  
											<div class="col-6">
												<label for="inputSelectCountry" class="form-label">Admission No</label>
													<input type="text" name="wk_test" value="<?php echo htmlentities($result->image);?>" readonly class="form-control">
											</div>
											
											
											<div class="col-6">
												<label for="inputSelectCountry" class="form-label">Class</label>
													<input type="text" name="wk_test" value="<?php echo htmlentities($result->image);?>" readonly class="form-control">
											</div>
											
											
											<div class="col-6">
												<label for="inputSelectCountry" class="form-label">Session</label>
												<input type="text" name="wk_test" value="<?php echo htmlentities($result->image);?>" readonly class="form-control">
											</div>
											
											
											<div class="col-6">
												<label for="inputSelectCountry" class="form-label">Term</label>
													<input type="text" name="wk_test" value="<?php echo htmlentities($result->image);?>" readonly class="form-control">
											</div>
											
											
											<div class="col-12">
												<label for="inputSelectCountry" class="form-label">Subject</label>
													<input type="text" name="wk_test" value="<?php echo htmlentities($result->image);?>" readonly class="form-control">
											</div>
											
											
										
											
											
											
											<div class="col-6">
												<label for="inputEmailAddress" class="form-label">Weekly Test (10) </label>
												<input type="text" name="wk_test" value="<?php echo htmlentities($result->image);?>"  class="form-control">
											</div>
											
												<div class="col-6">
												<label for="inputEmailAddress" class="form-label">Mid Term Test (20) </label>
												<input type="text" name="mid_test" value="<?php echo htmlentities($result->image);?>"  " class="form-control">
											</div>
											
											
											<div class="col-12">
												<label for="inputEmailAddress" class="form-label">Teachers Comment </label>
												<input type="text" name="comment" value="<?php echo htmlentities($result->image);?>"class="form-control">
											</div>
									
											<div class="col-12">
												<div class="form-check form-switch">
													<input class="form-check-input" type="checkbox" id="flexSwitchCheckChecked">
													<label class="form-check-label" for="flexSwitchCheckChecked">I read and agree to Terms & Conditions</label>
												</div>
											</div>
											<div class="col-12">
												<div class="d-grid">
													<button type="submit" name='store' class="btn btn-primary"><i class='bx bx-user'></i>Store</button>
												</div>
											</div>
										</form>
                
                
                
                
                
                
                
										
								 <?php }} ?>
									</div>
        </div>
      </div>
    </div>
				</div>
				<!--end row-->
		</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 © 2021. 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>