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

?>


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

?>
<?php
if(isset($_POST['bankd']))
  {
$bank=$_POST['bank'];

   $sql = "INSERT INTO bank (id, email, details)
              VALUES ('', '$user_email', '$bank')";
              if (mysqli_query($conn, $sql)) 
              {
                  $msg="Profile Updated Successfully";
              }else{
                  $msg="Error occur"; 
              }


}

?>

<!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> acc details </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="page-content">
				<!--breadcrumb-->
				<div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
					<div class="breadcrumb-title pe-3">User Profile</div>
					<div class="ps-3">
						<nav aria-label="breadcrumb">
							<ol class="breadcrumb mb-0 p-0">
								<li class="breadcrumb-item"><a href="javascript:;"><i class="bx bx-home-alt"></i></a>
								</li>
								<li class="breadcrumb-item active" aria-current="page">Bank Profile</li>
							</ol>
						</nav>
					</div>
					
				</div>
				<!--end breadcrumb-->
				<div class="container">
					<div class="main-body">
						<div class="row">
							<!--<div class="col-lg-4">-->
							<!--	<div class="card">-->
							<!--		<div class="card-body">-->


								

							<!--			<div class="d-flex flex-column align-items-center text-center">-->
							<!--				<img src="assets/images/avatars/avatar-2.png" alt="Admin" class="rounded-circle p-1 bg-primary" width="110">-->
							<!--				<div class="mt-3">-->
							<!--					<h4><?php echo $full_name;?></h4>-->
							<!--					<p class="text-secondary mb-1"><?php echo $email;?></p>-->
							<!--					<p class="text-muted font-size-sm"><?php echo $username;?></p>-->
							<!--					<button class="btn btn-primary"><?php echo $reg_date;?></button>-->
							<!--					<button class="btn btn-outline-primary"><?php echo $phone_number;?></button>-->
							<!--				</div>-->
							<!--			</div>-->
							<!--			<hr class="my-4" />-->
										
							<!--		</div>-->
							<!--	</div>-->
							<!--</div>-->
							<div class="col-lg-8">
								<div class="card">
									<div class="card-body">
									<?php  
         								if($msg){?>
									<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">Success </h6>
											<div class="text-white"><?php echo htmlentities($msg); ?>!</div>
										</div>
									</div>
									<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
								</div>
								<?php }?>
									
									
									
									
									<?php
                         $sql = "SELECT * FROM bank where email='$email'";
                           $result = mysqli_query($conn, $sql);
                            if (mysqli_num_rows($result) > 0) {
                                // output data of each row
									 while($row = mysqli_fetch_assoc($result)) {
        
         ?>
                <h5 ><?php
        
        echo $row["details"];
									 }
   ?>
							</h5>
									
									<?php }else{ ?>
          						<form action='' method="post">
										<div class="row mb-3">
											<div class="col-sm-3">
												<h6 class="mb-0">Your Full Bank detail</h6>
											</div>
											<div class="col-sm-9 text-secondary">
												<textarea name="bank" type="text" class="form-control" value="" rows="5" cols="30" >Fill in your bank details.. note that it can not be change once filled
												    </textarea>
										<div class="row">
											<div class="col-sm-3"></div>
											<div class="col-sm-9 text-secondary">
												<input type="submit" class="btn btn-primary px-4" name="bankd" value="Save Changes" />
											</div>
										</div>
											</div>
										</div>
									
									</form>
									<?php } ?>
									</div>
								</div>
								
							</div>
						</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>
