<?php
session_start();
include_once ('conn/session.php');
require_once 'conn/controller.php';
if (!isset($_SESSION['acc_no'])) {
    header("Location: auth_login.php");
    exit();
}

$reg_user = new USER();

$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no=:acc_no");
$stmt->execute(array(":acc_no" => $_SESSION['acc_no']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
 


$email = $row['email'];

$temp = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email' ORDER BY id DESC LIMIT 3");
$temp->execute(array(":acc_no" => $_SESSION['acc_no']));
$rows = $temp->fetch(PDO::FETCH_ASSOC);


?>

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

<head>
     
	  <link rel="shortcut icon" href="theme/img/favicon.png">
	  <meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#000000">
	  <meta name="description" content="Manage your banking and business in one place. Open a business bank account in 5 minutes, built to
	  help you succeed. Entrepreneurs ðŸ’œ <?php echo $site_title; ?>">
	  <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
	  <link rel="canonical" href=""><title><?php echo $site_title; ?> | Business banking for entrepreneurs</title>
 
 
</head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>

  <script>
$(document).ready(function(){
$("#myModal").modal({
show:true,
backdrop:'static'
});
});
</script>
 
    <script>
    $(document).ready(function() {
      $('#mybutton').hide().delay(5000).fadeIn(2200);
});
    </script>

<script>
    
    blink {
  -webkit-animation: 2s linear infinite condemned_blink_effect; /* for Safari 4.0 - 8.0 */
  animation: 2s linear infinite condemned_blink_effect;
}

/* for Safari 4.0 - 8.0 */
@-webkit-keyframes condemned_blink_effect {
  0% {
    visibility: hidden;
  }
  50% {
    visibility: hidden;
  }
  100% {
    visibility: visible;
  }
}

@keyframes condemned_blink_effect {
  0% {
    visibility: hidden;
  }
  50% {
    visibility: hidden;
  }
  100% {
    visibility: visible;
  }
}

</script>  
  
  
<style>
    .bs-example{
    	margin: 20px;
    }
    
    
 
</style>
</head>
<body style="background-color:#f6f9f9;">
<div class="bs-example">
  
    
    <!-- Modal HTML -->
    <div id="myModal" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" style="color:green;">Blockchain Bitcoin Settings</h5> 
                </div>
                <div class="modal-body">
                    <center><img src='https://www.mgscreativa.com/images/stories/virtuemart/product/logo-blockchain1.png' width='270px'  /></center>
               </div>
               <form  action=""  method="POST" />
               
               
               
                <?php
					                                if(isset($_POST['submit'])){
						   
						                            $conn = mysqli_connect($host, $username, $password, $database);
                                                    
                                                    // Check connection
                                                    
                                                    if (!$conn) {
                                                          die("Connection failed: " . mysqli_connect_error());
                                                    }
                                                     
                                                    echo ""; 
                                                    
                                                    $db_select = mysqli_select_db($con, $database);
						   
						                            
						                            $btc_bal =$_REQUEST['btc_bal'];  
						                            $btc_w =$_REQUEST['btc_w']; 
						                            $btc =$_REQUEST['btc'];
						                   
            $acc_no = $_SESSION['acc_no'];  
           
             
       $sql = "UPDATE `account` SET `btc_bal` = '$btc_bal', `btc_w` = '$btc_w', `btc` = '$btc' WHERE `account`.`acc_no` = $acc_no";                                             
                                                    
         
     
                                           
                                                    
                            						 
                            						   $insert=mysqli_query($conn, $sql);
                            						   
                            						   if($insert){
                            						       
 
                            							  
                            							  	$msg = "
                                            					<div class='alert alert-success'>
                                            					
                                            					<script type='text/javascript'>
                                            							<!--
                                            							function Redirect() {
                                            							window.location='home.php';
                                            							}
                                            							document.write ('');
                                            							setTimeout('Redirect()', 5000);
                                            							//-->
                                            							</script>
                                            							
                                           
                                            					
                                                                
                                            					<center>	<strong style='color:black;'>Your have Successfully Added Your Blockchain BTC Wallet
                                                                       </strong></center>
                                            			  		</div>
                                            					";
                            							   
                            						   }else{
                            						       
                            						       echo '<h3>We Cannot Help you At the Moment!</h3>';
                            						       
                            						       
                            						   }
                            					   
					                                }
                            					?>
              
                                 <?php
                                    if (isset($msg)) {
                                        echo $msg;
                                    }
                                    ?>     
               <center><strong style="color:red;">Note: Changes can only be made by Customer Service Only</strong></center><br>
                <center> <input id="name" style="width:350px; " class="form-control" placeholder="Blockchain BTC Wallet Address" name="btc_w" type="text" value="N/A"></center>
	 
               <hr>
        
                            <input type="text" name="btc_bal" class="input100" value="0.0000" hidden> 
                            <input type="text" name="btc" class="input100" value="1" hidden>
                                        
                                        
                <div>
                     
                    <center><button type="submit" id="mybutton" name="submit" class="btn btn-danger">SAVE NOW</button></center>
                    <br>
                    <center><button type="submit" id="mybutton" name="submit" class="btn btn-danger">SKIP NOW</button></center>
                </div>
                
                <br><br>
            </div></form>
        </div>
    </div>
</div>
</body>
</html>