<?php include("auth.php");?>
<?php include("header.php");?>

        <div class="content-body">
            <!-- row -->
			<div class="container-fluid">
            <h3>Withdraw Funds</h3>

            <?php 
               error_reporting(~E_NOTICE);
include("dbcon.php");
 $sql="SELECT * FROM user WHERE email='".$_SESSION['email']."'";
                 $result = mysqli_query($db,$sql);
                while ($row = mysqli_fetch_array($result)) 
{
 
    ?>

                          
                          
                          
                         
                          <span class="header-title m-t-0" style="float: right; color: #5cb85c;" id="avail_with">
                          <b>Current Balance: $<?php echo $row["currentbalance"];?></b></span><br>

    <?php
    include('dbcon.php');
    error_reporting(~E_NOTICE);
if(isset($_POST["btn-sub"])){
   
    
     if($row["currentbalance"]<=4000){
        $msg ="";
        echo $msg ="<p style ='background-color:#c63939;color:white;padding:15px;'>Withdraw a minimum of $5000</p>";
    }else if ($row["currentbalance"]>=4000) {
        $msg="";
        echo $msg =" <p style ='background-color:#c63939;color:white;padding:15px;'>Kindly Upgrade your account to the premium plan to enable your minimum withdrawal. If you need our assistance, contact our support service.</p>";
    } 
     if (!empty($row["message"])) {
        
       echo'<script>window.location.href = "hmessage.php"</script>';
    }

}

?>
	   

            <form method="POST" action="">
        
 
<div class="card-body">
                                <div class="basic-form">
                                   
                                        <div class="input-group input-group-sm mb-3">
											<span class="input-group-text">Amount</span>
                                            <input type="number" class="form-control">
                                            
                                        </div>

                                        <div class="input-group input-group-sm mb-3">
											<span class="input-group-text">Wallet Address</span>
                                            <input type="text" class="form-control">
                                            
                                        </div>

                                        <div class="input-group input-group-sm mb-3">
											<span class="input-group-text">Account Number</span>
                                            <input type="number" class="form-control">
                                            
                                        </div>

                                        <div class="input-group input-group-sm mb-3">
											<span class="input-group-text">Bank Name</span>
                                            <input type="text" class="form-control">
                                            
                                        </div>
                                        <button class="btn btn-primary" type="submit" name="btn-sub">Withdraw Funds</button>

</div>
</form>
<?php
}
?>
</div>
</div>
<?php include("footer.php");?>