<?php

	
include("../config.php");
session_start();

if(isset($_SESSION["user_login"])){
	$userid = $_SESSION["user_login"];
}else{
		header("location: ../register-login.php");
	}

			
			
		//get user info //Check Pass Code if matched
		$stmt=$pdo->prepare("SELECT * FROM users WHERE userid = :userid");
		$stmt->bindParam(":userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$row=$stmt->fetch();
		
			
			//check if locked is on
			if(empty($row["withdrawalPassCode"])){
				header("location:account.php");
			}
			elseif(isset($_SESSION["e_code"]) && $_SESSION["e_code"] == $row["withdrawalPassCode"]){
				header("location:withdrawal.php");
			}
			
			
			if(isset($_POST["submit"])){
			
			//if form was submitted, check if passCode match the one in db
			
			if($_POST["passCode"] == $row["withdrawalPassCode"]){
			
				session_start();
				$_SESSION["e_code"] = $_POST["passCode"];
				
				header("location:withdrawal.php");
				
			}else{
				
				echo "<script>alert('Invalid  e-Code. Check Code and try again')</script>";
			}
			
			}
	?>
	
	
	
	
	
	
	<!DOCTYPE html>
<html lang="en">
<head>
    <!-- basic -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- mobile metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- site metas -->
    <title>Site Under Maintainace | Six Digital Assets</title>
    <meta name="keywords" content="trade, trading, forex, investing, invest, investment, investor, money, chart, bitcoin, ethereum, USDT, coins, cryptocurrencies, crypto, profit, market, online money, money online,">
    <meta name="description" content="Six Digital Assets provides a full investment service focused on the Bitcoin and cryptocurrency trading market. A certified legal investment company incorporated and headquartered in Australia.">
    <meta name="author" content="Six Digital Assets">
    <!-- bootstrap css -->
    <link rel="stylesheet" href="../css/bootstrap.min.css">
	
	<!-- Flaticons -->
    <link href="../css/flaticon7eda.css" rel="stylesheet">
	
	<link href="../css/style7eda3860.css" rel="stylesheet">
	
    <!-- awesome fontfamily -->
    <link rel="stylesheet" href="../css/font-awesome.min.css">
	
</head>
<!-- body -->






<body>




		
		<div style="margin:20px;">
				<center>
				<div style="font-size:16px;font-weight:550;padding:10px; background:#ef5a5a; max-width:500px;border-radius:10px; color:#fff">
				<i class="fa fa-exclamation"></i> &nbsp;e-Code Required</div>
				
				<br><br><br><p>
				
				<div style="font-size:16px; color:#8ba3b5">
				Six(6) digits e-code required to enable process your withdrawal!
				</div>
				
				<div class="dropdown-divider"></div>
				
				
			<br>
			<form method="post" action="">
			<div class="col-md-6">
			<label for="passCode" style="color: #405972;font-size:17px;margin-top:10px;"><b>Enter e-Code</b></label>
			<div class="form-group charge" style="margin:-2px auto 10px auto">
			<input type="text" name="passCode" id="passCode" class="form-control" placeholder="e.g 987086">
			</div>
			
			<button type="submit" name="submit" id="lock" class="btnss btn btn-block" style="cursor:pointer;color:#fff;border-radius:0px;">
			Continue &nbsp; <i class="fa fa-angle-right"></i></button>
			</div>
			</form>
			
			<p><br>
			<a href="account.php" class="text-muted"><i class="fa fa-angle-left"></i> &nbsp; Back To Dashboard</a></p>
			<a href="inbox.php" class="text-muted"><b><i class="fa fa-envelope"></i>&nbsp;Support</b></a></p>
				
				</center>
				
                    <!-- Start Content-->

                    <div class="container-fluid" >

                        <div id="google_translate_element"></div>

                         <div class="row">

                            <div class="col-md-12" style="padding-left:0px; padding-right:0px">
                            
						
						
				<div class="col-md-7" style="margin-top:20px!important;margin: auto;">
                <div class="card-box">
				
				
				
				
				
	
				</div>
				</div>
				
				
				</div>
				</div>
				</div>
				</div>


</body>

</html>	
				
				
				
				
				
				
				
				