<?php
    session_start();
    if( !isset($_SESSION['chap']) ){
        header("Location:../index.html#login-area");
        exit();
    }
    else{
        $chap = $_SESSION['chap'];
        include "../connect/db.php";
        $sql = mysqli_query($mysqli,"SELECT * FROM users WHERE email = '$chap' ");
        $row = mysqli_fetch_assoc($sql);
        if( $row['status'] == "suspended" ){
            header("Location:account.php");
            exit();
        }
        else if( $row['status'] == "terminated" ){
            header("Location:terminate.php");
            exit();
        }
    }
    



       if($row['kyc_status'] == "pending" || $row['kyc_status'] == "review" )


{
   header("Location:kyc.php");
   exit();


}
    if($row['code_level'] != "nothing"){

if($row['lock_status'] == "active" )


{
   header("Location:auth.php");
   exit();


}
else{
    
}



}
else{
    
}
    



?>
<!DOCTYPE html>
<html lang="en-US" class="js">

<head>
    <meta charset="utf-8">
    <meta name="author" content="Smart">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description"
        content="Aspire Securities is a trademark of Aspire Financial Corporation. Aspire Securities is a trade name for the corporate and investment banking services of Aspire Financial Corporation and its subsidiaries. All rights reserved. Securities and strategic advisory services are provided by Aspire Securities, Inc., member FINRA, link opens in new tab and SIPC, link opens in new tab. Lending, financial risk management, and treasury management and payment services are offered by Aspire Bank. Deposit products are offered by Aspire Bank.">
    <!-- Fav Icon  -->
    <link rel="shortcut icon" href="../images/favicon.png">
    <!-- Page Title  -->
    <title><?=$row['firstname']?> <?=$row['middlename']?> <?=$row['lastname']?> | <?= htmlspecialchars(getSetting('site_name', 'Deutsche Bank Holdings Delaware')) ?> Online banking</title>
    <!-- StyleSheets  -->
    <link rel="stylesheet" href="../scss/sweetalert.css">
    <link rel="stylesheet" href="assets/css/dashlite.css?ver=2.4.0">
    <link id="skin-default" rel="stylesheet" href="assets/css/theme.css?ver=2.4.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">

    <link href="../css/toastr.css" rel="stylesheet" />
</head>
<link rel="stylesheet"
    href="https://www.jqueryscript.net/demo/jQuery-International-Telephone-Input-With-Flags-Dial-Codes/build/css/intlTelInput.css">
<script type="text/javascript">
    function googleTranslateElementInit() {
        new google.translate.TranslateElement({ pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, 'google_translate_element');
    }
</script>
<script type="text/javascript"
    src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<style>
    .goog-te-gadget-simple {
        border: none;
    }

    .goog-te-gadget-simple a {
        color: #000;
    }
</style>

<body class="nk-body npc-crypto bg-white has-sidebar ">
    <div class="nk-app-root">
        <!-- main @s -->
        <div class="nk-main ">
            <!-- sidebar @s -->
            <div class="nk-sidebar nk-sidebar-fixed " data-content="sidebarMenu">
                <div class="nk-sidebar-element nk-sidebar-head" style="border-bottom: solid #fe473a;">
                    <div class="nk-sidebar-brand">
                        <a href="dashboard" class="logo-link nk-sidebar-logo">
                            <img class="logo-light logo-img" src="../logo.png" srcset="../logo.png 2x" alt="logo">
                            <img class="logo-dark logo-img" src="../logo.png" srcset="../logo.png 2x" alt="logo-dark">

                        </a>
                    </div>
                    <div class="nk-menu-trigger mr-n2">
                        <a href="#" class="nk-nav-toggle nk-quick-nav-icon d-xl-none" data-target="sidebarMenu"><em
                                class="icon ni ni-arrow-left"></em></a>
                    </div>
                </div><!-- .nk-sidebar-element -->
                <?php include 'includes/sidebar.php'?>

                <!-- main header @e -->
                <div class="nk-content">
                    <div class="container-xl wide-lg">
                        <div class="nk-content-body">
                            <div class="nk-block-head">
                                <div class="nk-block-head-sub">
                                </div>
                                <div class="nk-block-between-md g-4 card-bordered">
                                    <div class="nk-block-head-content">
                                        <h4 class="nk-block-title fw-normal">Internet Banking Bill Pay.</h4>
                                        <div class="nk-block-des">
                                            <p>
                                            </p>
                                        </div>
                                    </div>
                                    <div class="nk-block-head-content">
                                        <ul class="nk-block-tools gx-3">
                                            <li><a href="transfer"
                                                    class="btn btn-secondary btn-light text-light"><span>Transfer
                                                        Fund</span><em class="icon ni ni-wallet-out"></em></a></li>
                                        </ul>

                                    </div><!-- .nk-block-head-content -->
                                </div><!-- .nk-block-between -->
                            </div><!-- .nk-block-head -->
                        </div>
                    </div>

                    <div class="card card-bordered">
                        <div class="card-header text-light" style="background-color:#033d75;">
                            <ul class="nav nav-tabs mt-n3">
                                <li class="nav-item ">
                                    <a class="nav-link active text-light" data-toggle="tab" href="#tabItem5"><em
                                            class="icon ni ni-wallet-alt"></em> <span>Pay a Biller</span></a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link text-light" data-toggle="tab" href="#tabItem6"><em
                                            class="icon ni ni-cc-new"></em><span>Add a Payee</span></a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link text-light" data-toggle="tab" href="#tabItem7"><em
                                            class="icon ni ni-exchange"></em><span>History</span></a>
                                </li>
                            </ul>
                        </div>
                        <div class="card-inner">
                            <div class="tab-content">
                                <div class="tab-pane active" id="tabItem5">
                                    <div class="buysell-field form-group">
                                        <div class="form-label-group">
                                            <label class="form-label">Choose payment account</label>
                                        </div>
                                        <input type="hidden" value="btc" name="bs-currency"
                                            id="buysell-choose-currency-modal">
                                        <div class="dropdown buysell-cc-dropdown">
                                            <a href="#" class="buysell-cc-choosen dropdown-indicator"
                                                data-toggle="dropdown">
                                                <div class="coin-item coin-btc">
                                                    <div class="coin-icon">
                                                        <em class="icon ni ni-wallet-out"></em>
                                                    </div>
                                                    <div class="coin-info">
                                                        <span class="coin-name">Checking Account</span>
                                                        <span class="coin-text">Balance(<?=formatCurrency($row['checking_balance'], $row['usercurrency'])?>)</span>
                                                    </div>
                                                </div>
                                            </a>
                                            <div class="dropdown-menu dropdown-menu-auto dropdown-menu-mxh">
                                                <ul class="buysell-cc-list">
                                                    <li class="buysell-cc-item selected">
                                                        <a href="#" class="buysell-cc-opt" data-currency="btc">
                                                            <div class="coin-item coin-btc">
                                                                <div class="coin-icon">
                                                                    <em class="icon ni ni-wallet-out"></em>
                                                                </div>
                                                                <div class="coin-info">
                                                                    <span class="coin-name">Checking Account</span>
                                                                    <span class="coin-text">0821*****</span>
                                                                </div>
                                                            </div>
                                                        </a>
                                                    </li> <!-- .buysell-cc-item -->
                                                </ul>
                                            </div>
                                        </div><!-- .dropdown -->
                                    </div><!-- .buysell-field -->
                                    <form action="" method="post"><?= csrf_field() ?>
                                        <div class="row">

                                            <div class="form-group col-md-6">
                                                <div class="form-control-wrap">
                                                    <select type="text" name="payeeid"
                                                        class="form-control form-control-outlined" id="payeeid"
                                                        placeholder="">
                                                        <option disabled="" selected="">Select a payee</option>
                                                        <option selected disabled>Kindly Add a payee</option>
                                                    </select>
                                                    <label class="form-label-outlined" for="outlined">Select a
                                                        payee</label>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-6">
                                                <div class="form-control-wrap">
                                                    <input type="date" class="form-control form-control-outlined"
                                                        id="dated" name="dated" placeholder="">
                                                    <label class="form-label-outlined" for="outlined">Delivery
                                                        date</label>
                                                </div>
                                            </div>
                                            <div class="buysell-field form-group col-md-12">
                                                <div class="form-label-group">
                                                    <label class="form-label" for="buysell-amount">Amount</label>
                                                </div>
                                                <div class="form-control-group">
                                                    <input type="number"
                                                        class="form-control form-control-lg form-control-number"
                                                        id="amount" name="amount" placeholder="2000">
                                                    <div class="form-dropdown">
                                                        <div class="text"><?=currencySymbol($row['usercurrency'])?><span></span></div>
                                                    </div>
                                                </div>
                                                <div class="form-note-group">
                                                    <span class="buysell-min form-note-alt"></span> <span
                                                        class="buysell-rate form-note-alt">*Bill Pay fee will be
                                                        deducted</span>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-12">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="memo" name="memo" placeholder="">
                                                    <label class="form-label-outlined" for="outlined">Memo
                                                        (optional)</label>
                                                </div>
                                            </div>
                                            <div class="payBillResult"></div>
                                            <div class="form-group col-md-12">
                                                <button type="submit" class="btn btn-primary btn-block payBill"
                                                    id="btn1">Continue</button>
                                            </div>

                                        </div>
                                    </form>
                                </div>
                                <div class="tab-pane" id="tabItem6">
                                    <form method="post" autocomplete="off" action=""><?= csrf_field() ?>
                                        <div class="row">
                                            <div class="form-group col-md-6">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="name" name="name">
                                                    <label class="form-label-outlined" for="outlined">Payee name</label>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-6">
                                                <div class="form-control-wrap">
                                                    <select type="text" class="form-control form-control-outlined"
                                                        id="method" name="method" placeholder="">
                                                        <option>Paper Check</option>
                                                    </select>
                                                    <label class="form-label-outlined" for="outlined">Payment Delivery
                                                        Method</label>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-12">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="account" name="account">
                                                    <label class="form-label-outlined" for="outlined">Account
                                                        Number</label>
                                                    <small>This is the account number that appears on your bills. If you
                                                        don't have account number, you can enter NA</small>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-12">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="address" name="address">
                                                    <label class="form-label-outlined" for="outlined">Address 1</label>
                                                    <small>Enter the payment address that appears on your bill. We'll
                                                        mail your payment to this address.</small>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-12">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="outlined">
                                                    <label class="form-label-outlined" for="outlined">Address 2</label>
                                                    <small>Optional</small>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-4">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="city" name="city">
                                                    <label class="form-label-outlined" for="outlined">City</label>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-4">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="state" name="state">
                                                    <label class="form-label-outlined" for="outlined">State</label>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-4">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="zipcode" name="zipcode">
                                                    <label class="form-label-outlined" for="outlined">Zip Code</label>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-12">
                                                <div class="form-control-wrap">
                                                    <input type="text" class="form-control form-control-outlined"
                                                        id="nickname" name="nickname">
                                                    <label class="form-label-outlined" for="outlined">Nickname</label>
                                                    <small>Optional Nickname are for your personal use only and will not
                                                        appear on any of your payment.</small>
                                                </div>
                                            </div>
                                            <div class="form-group col-md-12">
                                                <div class="form-control-wrap">
                                                    <div class="custom-control custom-control-sm custom-switch">
                                                        <input type="checkbox" class="custom-control-input"
                                                            id="customSwitch2">
                                                        <label class="custom-control-label" for="customSwitch2">Add this
                                                            Payee to your favorites</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="addPayeeResult"></div>
                                            <div class="form-group col-md-12">
                                                <div class="form-control-wrap">
                                                    <button type="submit" class="btn btn-primary btn-block addPayee"
                                                        id="btn2">continue</button>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="tab-pane" id="tabItem7">
                                    <div class="card card-preview ">
                                        <div class="card-inner p-0" style="overflow-x:auto;">
                                            <table class="datatable-init table" style="width:100%;min-width:700px;">
                                                <thead>
                                                    <tr>
                                                        <th>Payee</th>
                                                        <th>Date</th>
                                                        <th>Amount</th>
                                                        <th>Status</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="nk-footer nk-footer-fluid">
                    <div class="container-fluid">
                        <div class="nk-footer-wrap">
                            <div class="nk-footer-copyright"> &copy; <?php
echo date("Y");
?>  <?= htmlspecialchars(getSetting('site_name', 'Deutsche Bank Holdings Delaware')) ?>   <a href="#">All rights
                                    reserved.</a>
                            </div>
                            <div class="nk-footer-links">
                                <ul class="nav nav-sm">
                                    <li class="nav-item"><a class="nav-link" href="#">Terms</a></li>
                                    <li class="nav-item"><a class="nav-link" href="privacy">Privacy</a></li>
                                    <li class="nav-item"><a class="nav-link" href="contact">Help</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- footer @e -->
            </div>
            <!-- wrap @e -->
        </div>
        <!-- main @e -->
    </div>
    <!-- app-root @e -->
    <!-- JavaScript -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="../js/country.js"></script>
    <script src="assets/js/bundle.js?ver=2.4.0"></script>
    <script src="assets/js/scripts.js?ver=2.4.0"></script>
    <script src="assets/js/charts/chart-crypto.js?ver=2.4.0"></script>
    <script src="../js/sweetalert.js"></script>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/js/custom.js"></script>
    <script src="../js/toastr.js"></script>

</body>

</html>