<?php
session_start();
$user = "educateb_bof-engla";
$pass = "bof-engla.com";
$dbname = "educateb_bof-engla";
$conn = mysqli_connect("localhost", $user, $pass, $dbname);
$sql = "SELECT * FROM site_details";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
            $email = $row["email"];
            $sitename = $row["site_name"];
            $location = $row["location"];
            $phone = $row["phone"];
        }
}
if (!isset($_SESSION["online_id"])){
    header("Location: login.php");
}
else{
    $online_id = $_SESSION["online_id"];
    $sql = "SELECT online_id, status FROM accounts WHERE online_id='$online_id'";
    $result = mysqli_query($conn, $sql);
    
    if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
            $chk_id = $row["online_id"];
            $status = $row["status"];
        }
        
    }
    $user = "educateb_bof-engla";
    $pass = "bof-engla.com";
    $dbname = "educateb_bof-engla";
    
    $online_id = $_SESSION["online_id"];
    $conn = mysqli_connect("localhost", $user, $pass, $dbname);
    if (!$conn) {
        die("Connection failed: " . mysqli_connect_error());
    }
    $sql = "SELECT * FROM accounts WHERE online_id='$online_id'";
    $result = mysqli_query($conn, $sql);
    
    if (mysqli_num_rows($result) > 0) {
        while($row = mysqli_fetch_assoc($result)) {
            $online_id = $row["online_id"];
            $balance = $row["balance"];
            $reg_firstname = $row["reg_firstname"];
            $reg_middlename = $row["reg_middlename"];
            $reg_lastname = $row["reg_lastname"];
            $reg_acc_type = $row["reg_acc_type"];
            $account_no = $row["account_no"];
            $reg_phone1 = $row["reg_phone1"];
            $passport = $row["passport"];
            $reg_nos_firstname = $row["reg_nos_firstname"];
            $reg_nos_middlename = $row["reg_nos_middlename"];
            $reg_nos_lastname = $row["reg_nos_lastname"];
            
        }
    }
    $mcontent = "<div class=\"container mt-5\" >
            
            <h4 class='text-success1'>Transfer Funds</h4>
                
              
            <div id=\"home\" class=\"container \" >
                
                
                <form action=\"confirm-btc.php\" method=\"post\"  class=\"mt-3\">
                    
    
                    <label class='mt-3'>Beneficiary Wallet Address</label>
                    
                    <input type=\"text\" class=\"form-control form-control-lg\" name=\"wallet\">
                    
                    
    
                    <label class='mt-3' for=\"loc_amount\">Amount to be transfered</label>
                    
                    <input  type=\"text\" class=\"form-control form-control-lg\" name=\"amount\"><br>
                    
                    <input type=\"submit\" value=\"Transfer\" id=\"transfer_submit\"  name=\"transfer_submit\" class=\"btn btn-lg mt-3 bg-success text-light\">
                </form>
            </div>
            
            
            
           

        </div>";
        
    
}

?>

<?php
include("accountheader.php");
?>
<div class="header-bg" style="width:100%;overflow:hidden">
    <div class="row">
        <div class="col-sm-3 mob2 shadow bg-light" style="">
            <?php
            include("accountsidebar.php");
            ?>
        </div>
        <div class="col-sm-9 pb-5" style="padding:0px;margin:0px">
            <?php
            include("dashhome.php");
            ?>
            
            <div class="container mt-5">
                <div class="">
                    <? echo $mcontent; ?>
                </div>
            </div>
            
        </div>
    </div>
</div>
<script>
    $(document).ready(function(){
        $(".nav-tabs a").click(function(){
            $(this).tab('show');
            });
    });
</script>
<?php
include("footer1.php");
?>