<?php
session_start();

require('../includes/database.php');

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


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

$query = "SELECT *
			FROM admin	
			WHERE username = '$username'
			&&   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>Deposit Account</h2>
                                <ul class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="dashboard.php"><i class="zmdi zmdi-home"></i> Online Bank</a></li>
                                    <li class="breadcrumb-item">Pages</li>
                                    <li class="breadcrumb-item">Account</li>
                                    <li class="breadcrumb-item active">Deposit</li>
                                </ul>
                                <button class="btn btn-primary 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 class="btn btn-primary btn-icon float-right right_icon_toggle_btn" type="button"><i class="zmdi zmdi-arrow-right"></i></button>
                                <a href="profile.php" class="btn btn-info btn-icon float-right"><i class="zmdi zmdi-check"></i></a>
                            </div>
                        </div>
                    </div>

                    <div class="container-fluid">
                        <div class="row clearfix">
                            <div style="margin:auto;" class="col-sm-12 col-md-12 col-lg-7">
                                <div class="card">
                                    <div class="header">
                                        <h2><strong>Fund</strong> Account</h2>
                                    </div>
                                    <div class="body">
                                        <form action="../bank-manager.php?action=credit-user" method="post">
                                            <div class="row">
                                                <div class="col-lg-12 col-sm-12">
                                                    <div class="form-group">
                                                        <label for="currency" class="">Username of Receiver<span class="text-danger">* </span><i class="fa fa-user"></i></label>
                                                        <select required class="form-control show-tick ms select2" name="username">
                                                            <?php
                                                            require('../includes/database.php');
                                                            $sql = "SELECT username FROM accounts ";
                                                            $cons_list = mysqli_query($con, $sql) or die(mysqli_connect_error());
                                                            while ($user = mysqli_fetch_assoc($cons_list)) {
                                                            ?>
                                                                <option value="<?php echo $user['username'] ?>"><?php echo $user['username'] ?></option>
                                                            <?php } ?>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-12 col-sm-12">
                                                    <div class="form-group">
                                                        <label for="currency" class="">Currency<span class="text-danger">* </span><i class="fa fa-credit-card"></i></label>
                                                        <select required class="form-control show-tick ms select2" name="currency">
                                                            <option value="&dollar;">($) Dollar</option>
                                                            <option value="&euro;">(€) Euros </option>
                                                            <option value="&pound;">(£) Pounds</option>
                                                            <option value="&#20803;"> (元)Yuan </option>
                                                            <option value="&yen;">(¥) Yen</option>
                                                            <option value="&#8361;">(₩) Won</option>
                                                            <option value="&#8358;">(₦) Naira</option>
                                                            <option value="&#8377;">(₹) Indian Rupee</option>
                                                            <option value="&#8369;">(₱) Pesos</option>
                                                        </select>
                                                    </div>
                                                </div>

                                                <div class="col-lg-12 col-md-12">
                                                    <div class="form-group">
                                                        <label for="">Amount</label>
                                                        <input required name="amount" type="number" class="form-control" placeholder="Amount">
                                                    </div>
                                                </div>
                                                <div class="col-lg-12 col-md-12">
                                                    <div class="form-group">
                                                        <label for="">Narration</label>
                                                        <input required name="narration" type="text" class="form-control" placeholder="Give Deposit Narration">
                                                    </div>
                                                </div>
                                                <div class="col-12">
                                                    <button class="btn btn-success">Deposit</button>
                                                </div>
                                        </form>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                </div>
                </div>
            </section>
    <?php include('footer.php');
    }
} ?>