<?php
ob_start();
session_start();

require_once($_SERVER['DOCUMENT_ROOT'] . "/include/Function/Function.php");
// require_once($_SERVER['DOCUMENT_ROOT'] . "/include/Function.php");
//require __DIR__."/../include/loginFunction.php";
// require_once __DIR__."/../session.php";
// require_once("/include/accountFunction.php");


$sql = "SELECT * FROM settings WHERE id ='1'";
$stmt = $conn->prepare($sql);
$stmt->execute();

$page = $stmt->fetch(PDO::FETCH_ASSOC);


$viesConn = "SELECT * FROM users";
$stmt = $conn->prepare($viesConn);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);



$email_message = new message();
$sendMail = new emailMessage();

?>


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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <meta name="description" content="Exchange cryptocurrencies easily">
    <title>Bsc OTC Trading</title>
    <link rel="stylesheet" href="<?= $web_url ?>/static/assets/flaticon/css/uicons-regular-rounded.css">
    <link rel="stylesheet" href="<?= $web_url ?>/static/vendor/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<?= $web_url ?>/static/docs/css/light.css">
    <link rel="stylesheet" href="<?= $web_url ?>/static/docs/css/animate.css">
    <link rel="stylesheet" href="<?= $web_url ?>/static/docs/css/major.css">
    <link rel="stylesheet" href="<?= $web_url ?>/static/assets/css/fontawesome.css">
    <link rel="shortcut icon" type="image/jpg" href="<?= $web_url ?>/static/assets/images/bsc.png" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu%7CRoboto%7CSource%20Sans%20Pro%7CMerriweather%20Sans%7CNoto%20Sans">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

    <link href="https://fonts.googleapis.com/css2?family=Anuphan:wght@500&amp;display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Anuphan:wght@400&amp;display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Anuphan:wght@600&amp;display=swap" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css?family=Material+Icons%7CMaterial+Icons+Outlined" rel="stylesheet">
    <link rel="stylesheet" href="<?= $web_url ?>/static/assets/plugin/jquery/jquery-ui.min.css">
    <!-- animate -->
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css">
    <!-- particle JS -->
    <script src="<?= $web_url ?>/static/vendor/jquery/jquery.js"></script>
    <script src="https://www.otcmarketx.com/static/assets/plugin/particles-js/particles.js"></script>
    <script src="https://www.otcmarketx.com/static/assets/plugin/particles-js/app.js"></script>

    <style>
        @media(max-width:576px) {
            .eo-cm-ip {
                top: -35px !important;
            }
        }
    </style>
</head>

<body class="white-bg">

    <!-- Page Preloader -->
    <div class="page-preloader">
        <div class="page-preloader-wrapper">
            <div class="loader justify-content-center m-0" style="height: 10px;">
                <span class="bar" style="border-radius: 0px;"></span>
                <span class="bar" style="border-radius: 0px;"></span>
                <span class="bar" style="border-radius: 0px;"></span>
                <span class="bar" style="border-radius: 0px;"></span>
            </div>
        </div>
    </div>
    <!-- End Page Preloader -->

    
        <div class="d-none d-md-block">
            <nav class="navbar navbar-expand-lg px-4 border-bottom dark-bg shadow-none" style="z-index:999 !important;">
                <a class="navbar-brand" href="/">
                    <p class="m-0 name-brand bold-text">
                        <img src="<?= $web_url ?>/static/assets/images/logo.png" alt="bscotc" style="height: 25px; width: 130px;">
                    </p>
                </a>
                
                <div class="collapse navbar-collapse" id="navbarNav" style="font-family: 'anuphan';">
                    

                    <?php
                    if (empty($_SESSION['acct_email'])) {
                    ?>

                        <ul class="navbar-nav noto-sans ml-auto" style="font-size: 14px;">

                            
                            <li class="nav-item mt-1">
                                <a href="./login.php" class="nav-link">
                                    <button class="px-4 py-1">
                                        Login
                                    </button>
                                </a>
                            </li>
                           

                        </ul <?php } else { ?> <ul class="navbar-nav ml-auto" style="font-size: 14px;">
                        <li class="nav-item mr-2 ml-4 mt-1">
                            <a href="./account/deposit.php" class="nav-link">
                                <button class="px-4 py-1 xsmall anuphan reg-btn add-radius-sm">
                                    <i class="bi bi-download"></i>
                                    Deposit
                                </button>
                            </a>
                        </li>
                        <li class="nav-item mt-3">
                            <img src="<?= $web_url ?>/static/assets/images/avatar-5.png" alt="profile" style="width: 25px; height: 25px;" class="n-top-2 pointer" onclick="accountMangt(this)">
                        </li>
                        <li class="nav-item mt-3">
                            <i class="bi bi-globe ml-3 n-top-3" style="font-size: 18px;"></i>
                        </li>
                        <li class="nav-item mt-3">
                            <i class="bi bi-moon-fill ml-3 n-top-1" style="font-size: 12px;"></i>
                        </li>
                        </ul>

                    <?php } ?>

                </div>
            </nav>
        </div>

        <div class="d-block d-sm-none container-fluid shadow-sm noto-sans" style="z-index: 4;">
            <div class="row py-3">
                <div class="col-6">
                    <a href="/">
                        <img src="<?= $web_url ?>/static/assets/images/logo.png" alt="bscotc" style="height: 25px; width: 130px;">
                    </a>
                </div>

                <?php
                if (empty($_SESSION['acct_email'])) {
                ?>


                    <div class="col-6">
                        <div class="d-flex justify-content-end">
                            <a href="./login.php">
                                <button class="anuphan-2 py-1 xsmall fit-content px-3">Login</button>
                            </a>
                            <i class="material-icons ml-4 top-1" style="font-size: 30px;" onclick="openSideBarSm()">menu</i>
                        </div>
                    </div>

                <?php } else { ?>

                    <div class="col-7">
                        <div class="d-flex justify-content-end">
                            <a href="./account/deposit.php">
                                <button class="anuphan-2 py-1 xsmall fit-content px-3">
                                    <i class="bi bi-download"></i>
                                    Deposit
                                </button>
                            </a>
                            <img src="<?= $web_url ?>/static/assets/images/avatar-5.png" alt="profile" style="width: 25px; height: 25px;" class="top-2 ml-3" onclick="accountMangt(this)">
                            <i class="material-icons ml-2 top-1" style="font-size: 30px;" onclick="openSideBarSm()">menu</i>
                        </div>
                    </div>
                <?php } ?>
            </div>
        </div>



        <!-- account control panel -->
        <div class="account-control-panel-overlay" style="display: none; background: rgba(0, 0, 0, 0.2) !important;" onclick="closeAccountMangt()"></div>
        <div class="account-control-panel dark-bg3 shadow-sm p-0" style="padding: 0px; display: none; box-shadow: none; border-radius: 0;">
            <div>
                <div class="border-bottom mb-1">
                    <p class="m-0 mt-2 p-3">
                        <b>ofofonobs@gmail.com</b>
                    </p>

                </div>

                <a href="./account/dashboard.php" class="mainWhite">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-3 grey-color-3" style="font-size: 18px">person</i> &nbsp;
                        <span>Dashboard</span>
                    </div>
                </a>
                <a class="mainWhite pointer" href="./account/security.php">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-3 grey-color-3" style="font-size: 18px">lock</i> &nbsp;
                        <span>Security</span>
                    </div>
                </a>
                <a class="mainWhite pointer" href="./account/settings.php">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-4 grey-color-3" style="font-size: 18px">tune</i> &nbsp;
                        <span>Settings</span>
                    </div>
                </a>
                <a class="mainWhite pointer" href="./account/profile.php">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-3 grey-color-3" style="font-size: 18px">fact_check</i> &nbsp;
                        <span>Identification</span>
                    </div>
                </a>
                <a class="mainWhite pointer" href="./account/wallet.php">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-3 grey-color-3" style="font-size: 18px">account_balance_wallet</i> &nbsp;
                        <span>Wallet</span>
                    </div>
                </a>
                <a class="mainWhite pointer" href="./account/transactions.php">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-4 grey-color-3" style="font-size: 18px">receipt_long</i> &nbsp;
                        <span>Orders</span>
                    </div>
                </a>
                <a class="mainWhite pointer" href="./account/view-rooms.php">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-4 grey-color-3" style="font-size: 18px">token</i> &nbsp;
                        <span>OTC Orders</span>
                    </div>
                </a>
                <a class="mainWhite pointer" href="./account/otc.php">
                    <div class="a-p-inner px-3 py-2 pb-3">
                        <i class="material-icons top-4 grey-color-3" style="font-size: 18px">swap_horiz</i> &nbsp;
                        <span>New OTC Trade</span>
                    </div>
                </a>
                <a href="./account/logout.php">
                    <div class="a-p-inner px-3 py-2 pb-3" style="border-radius: 0px 0px 6px 6px;">
                        <i class="material-icons-outlined top-4 grey-color-3 mr-2" style="font-size: 18px;">logout</i>
                        <small class="xsmall">Sign out</small>
                    </div>
                </a>
            </div>
        </div>


        <script>
            // account management modal
            const accountMangt = (e) => {
                $('.account-control-panel-overlay').fadeIn(150)
                $('.account-control-panel').show('drop', {
                    direction: 'up'
                }, 200)
            }
            const closeAccountMangt = (e) => {
                $('.account-control-panel-overlay').fadeOut(150)
                $('.account-control-panel').hide('drop', {
                    direction: 'up'
                }, 200)
                $(e).attr('onclick', 'accountMangt(this)')
                $('.accountMangtBtn').each(function() {
                    $(this).attr('onclick', 'accountMangt(this)')
                })
            }
        </script>