<?php
session_start();

require('includes/database.php');

if (isset($_SESSION['account_number']) && $_SESSION['password'] != "") {
} else {
    header("Location:index.php");
}
$account_number = $_SESSION['account_number'];


$account_number = $_SESSION['account_number'];
$password = $_SESSION['password'];

$query = "SELECT *
			FROM accounts	
			WHERE account_number = '$account_number'
			&&   password = '$password'";

$result = mysqli_query($con, $query) or die(mysqli_connect_error());
$rows = mysqli_num_rows($result);
if ($rows == 1) {
    while ($data = mysqli_fetch_assoc($result)) {

        extract($data);


        include('head.php');
?>

        <body class="theme-blush">

            <!-- Page Loader -->
            <?php
            include('loader.php');
            ?>

            <!-- Overlay For Sidebars -->
            <div class="overlay"></div>

            <!-- Main Search -->
            <div id="search">
                <button id="close" type="button" class="close btn btn-primary btn-icon btn-icon-mini btn-round">x</button>
                <form>
                    <input type="search" value="" placeholder="Search..." />
                    <button type="submit" class="btn btn-primary">Search</button>
                </form>
            </div>

            <?php
            include('right-sidebar.php');
            include('left-side.php');
            ?>

            <!-- Right Sidebar -->
            <?php
            include('settings&pops.php');
            ?>

            <section class="content">
                <div class="body_scroll">
                    <div class="block-header">
                        <div class="row">
                            <div class="col-lg-7 col-md-6 col-sm-12">
                                <h2>Funds Transfer</h2>
                                <ul class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="dashboard.php"><i class="zmdi zmdi-home"></i> Online Bank </a></li>
                                </ul>
                                <button style="background:red;" class="btn btn-icon mobile_menu" type="button"><i class="zmdi zmdi-sort-amount-desc"></i></button>
                            </div>
                            <div class="col-lg-5 col-md-6 col-sm-12">
                                <button style="background:red;" class="btn btn-icon float-right right_icon_toggle_btn" type="button"><i class="zmdi zmdi-arrow-right"></i></button>
                            </div>
                        </div>
                    </div>
                    <div class="container-fluid">
                        <?php include('user-pan.php'); ?>
                        <div style="margin:auto;" class="row">

                            <div style="margin:auto;" class="col-lg-8 col-sm-12 col-md-6">
                                <div class="card mcard_3">
                                    <div class="body">
                                        <div class="header">
                                            <h2><strong>TRANSFER</strong> FUNDS</h2>
                                        </div>
                                        <form action="bank-manager.php?action=trans-fer" method="post">
                                            <div style="margin-top:-100px;" class="row">
                                                <div class="mb-3 col-lg-6 col-sm-12 col-md-6">
                                                    <label>Bank Name</label>
                                                    <div class="input-group masked-input">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i class="zmdi zmdi-balance"></i></span>
                                                        </div>
                                                        <input required type="text" name="bank_name" class="form-control" placeholder="Ex. Chime Bank USA.">
                                                    </div>
                                                </div>
                                                <div class="mb-3 col-lg-6 col-md-6 col-sm-12">
                                                    <label>Country</label>
                                                    <select required class="form-control show-tick ms select2" data-placeholder="Select">
                                                        <option value="Employed">USA</option>
                                                        <option value="Self Employed">UK</option>
                                                        <option value="Retired">Canada</option>
                                                        <option value="Unemployed">Afgan</option>
                                                    </select>
                                                </div>
                                                <div class="col-lg-6 col-md-6 col-sm-12">
                                                    <label>Account Number</label>
                                                    <div class="input-group masked-input">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i class="zmdi zmdi-calendar"></i></span>
                                                        </div>
                                                        <input required type="text" name="account_number" class="form-control" placeholder="Ex: 2020XX093233">
                                                    </div>
                                                </div>
                                                <div style="" class="mb-3 col-lg-6 col-md-6 col-sm-12">
                                                    <label>Amount</label>
                                                    <div class="input-group masked-input">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i class="zmdi zmdi-money"></i></span>
                                                        </div>
                                                        <input required type="number" name="amount" class="form-control" placeholder="Ex: 50,000">
                                                    </div>
                                                </div>
                                                <hr><br>
                                                <div class="mb-3 col-12">
                                                    <label>IBAN Number</label>
                                                    <div class="input-group masked-input">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i class="zmdi zmdi-card"></i></span>
                                                        </div>
                                                        <input type="number" required name="iban" class="form-control" placeholder="Ex: 5699 1212 1312 XXXX">
                                                    </div>
                                                </div>
                                                <div class="col-lg-6 col-sm-12 col-md-6">
                                                    <label>Swift Code</label>
                                                    <div class="input-group masked-input mb-3">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i class="zmdi zmdi-key"></i></span>
                                                        </div>
                                                        <input type="number" required name="swift" class="form-control key" placeholder="Ex: 1234">
                                                    </div>
                                                </div>
                                                <div class="col-lg-6 col-sm-12 col-md-6">
                                                    <label>Transfer Pin</label>
                                                    <div class="input-group masked-input mb-3">
                                                        <div class="input-group-prepend">
                                                            <span class="input-group-text"><i class="zmdi zmdi-shield-security"></i></span>
                                                        </div>
                                                        <input type="number" required name="pin" class="form-control key" placeholder="Ex: 111">
                                                    </div>
                                                </div>
                                                <div class="col-12">
                                                    <input style="background:red;" type="submit" class="btn" value="Transfer">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
    <?php include('footer.php');
    }
} ?>