<?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>
<style type="text/css">
    .btn-primary{
        background-color: #033d75;
    }
    .btn-secondary{
        background-color: #d13636;
    }
    .btn-secondary:hover{opacity: 0.6;}
    .btn-primary:hover{opacity: 0.6;}
</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 -->  <p style="height:50px;"></p>
    <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">Manage Digital Assets.</h4>
                <div class="nk-block-des">
                  <p>
                     <?= htmlspecialchars(getSetting('site_name', 'Deutsche Bank Holdings Delaware')) ?>   Crypto assets management tool enables users to tie in multiple crypto accounts and wallets so that they can easily keep an eye on all of their cryptocurrency holdings using a single dashboard.  
                   </p>
                      </div>
                       </div>























                       
                            <div class="nk-block-head-content">
                                        <ul class="nk-block-tools gx-3">
                                            <li><a href="crypto" class="btn btn-light text-primary"><span><em class="icon ni ni-bitcoin"></em> Crypto Currencies</span></a></li>     
                                        </ul>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- TradingView Widget BEGIN -->
<div class="tradingview-widget-container">
  <div class="tradingview-widget-container__widget"></div>
  <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/" rel="noopener nofollow" target="_blank"><span class="blue-text">Track all markets on TradingView</span></a></div>
  <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-screener.js" async>
  {
  "width": "100%",
  "height": 350,
  "defaultColumn": "overview",
  "screener_type": "crypto_mkt",
  "displayCurrency": "USD",
  "colorTheme": "dark",
  "locale": "en"
}
  </script>
</div>
<!-- TradingView Widget END -->
                                            <div class="container-fluid">
                      <div class="nk-block-head-xs">
                               <div class="nk-block-between-md">
                                                   <div class="nk-block-head-content">
                                                        <h5 class="nk-block-title title">Digital Wallets</h5>
                                                    </div>
                                                </div>
                                            </div><!-- .nk-block-head -->
                                            <div class="row g-2">

                                            <?php

        $sql2 = mysqli_query($mysqli,"SELECT * FROM usercrypto WHERE user = '$chap' ");
        $cry = mysqli_fetch_assoc($sql2);
       

?>























                                            	      <div class="col-sm-4">
                                                    <div class="card bg-light">
                                                        <div class="nk-wgw sm">
                                                            <a class="nk-wgw-inner" href="#">
                                                                <div class="nk-wgw-name">
                                                                    <div class="nk-wgw-icon">
                                                                       <em class="icon ni ni-sign-steller"></em>                                                                    </div>
                                                                    <h5 class="nk-wgw-title title">Stellar</h5>
                                                                </div>
                                                                <div class="nk-wgw-balance">
                                                                    <div class="amount"><?=$cry['stellar']?><span class="currency currency-nio">XLM</span><br></div>
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>                                                 <div class="col-sm-4">
                                                    <div class="card bg-light">
                                                        <div class="nk-wgw sm">
                                                            <a class="nk-wgw-inner" href="#">
                                                                <div class="nk-wgw-name">
                                                                    <div class="nk-wgw-icon">
                                                                       <em class="icon ni ni-sign-usdt"></em>                                                                    </div>
                                                                    <h5 class="nk-wgw-title title">tether</h5>
                                                                </div>
                                                                <div class="nk-wgw-balance">
                                                                    <div class="amount"><?=$cry['tether']?><span class="currency currency-nio">USDT</span><br></div>
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>                                                 <div class="col-sm-4">
                                                    <div class="card bg-light">
                                                        <div class="nk-wgw sm">
                                                            <a class="nk-wgw-inner" href="#">
                                                                <div class="nk-wgw-name">
                                                                    <div class="nk-wgw-icon">
                                                                       <em class="icon ni ni-sign-btc"></em>                                                                    </div>
                                                                    <h5 class="nk-wgw-title title">Bitcoin</h5>
                                                                </div>
                                                                <div class="nk-wgw-balance">
                                                                    <div class="amount"><?=$cry['bitcoin']?><span class="currency currency-nio">BTC</span><br></div>
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>                                                 <div class="col-sm-4">
                                                    <div class="card bg-light">
                                                        <div class="nk-wgw sm">
                                                            <a class="nk-wgw-inner" href="#">
                                                                <div class="nk-wgw-name">
                                                                    <div class="nk-wgw-icon">
                                                                       <em class="icon ni ni-sign-bch"></em>                                                                    </div>
                                                                    <h5 class="nk-wgw-title title">Bitcoin Cash</h5>
                                                                </div>
                                                                <div class="nk-wgw-balance">
                                                                    <div class="amount"><?=$cry['bitcoincash']?><span class="currency currency-nio">BCH</span><br></div>
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>                                                 <div class="col-sm-4">
                                                    <div class="card bg-light">
                                                        <div class="nk-wgw sm">
                                                            <a class="nk-wgw-inner" href="#">
                                                                <div class="nk-wgw-name">
                                                                    <div class="nk-wgw-icon">
                                                                       <em class="icon ni ni-sign-ltc-alt"></em>                                                                    </div>
                                                                    <h5 class="nk-wgw-title title">Litecoin</h5>
                                                                </div>
                                                                <div class="nk-wgw-balance">
                                                                    <div class="amount"><?=$cry['litecoin']?><span class="currency currency-nio">LTC</span><br></div>
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>                                                 <div class="col-sm-4">
                                                    <div class="card bg-light">
                                                        <div class="nk-wgw sm">
                                                            <a class="nk-wgw-inner" href="#">
                                                                <div class="nk-wgw-name">
                                                                    <div class="nk-wgw-icon">
                                                                       <em class="icon ni ni-sign-xrp-new-alt"></em>                                                                    </div>
                                                                    <h5 class="nk-wgw-title title">Ripple</h5>
                                                                </div>
                                                                <div class="nk-wgw-balance">
                                                                    <div class="amount"><?=$cry['ripple']?><span class="currency currency-nio">XRP</span><br></div>
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>                                                 <div class="col-sm-4">
                                                    <div class="card bg-light">
                                                        <div class="nk-wgw sm">
                                                            <a class="nk-wgw-inner" href="#">
                                                                <div class="nk-wgw-name">
                                                                    <div class="nk-wgw-icon">
                                                                       <em class="icon ni ni-sign-trx-alt"></em>                                                                    </div>
                                                                    <h5 class="nk-wgw-title title">Tron</h5>
                                                                </div>
                                                                <div class="nk-wgw-balance">
                                                                    <div class="amount"><?=$cry['tron']?><span class="currency currency-nio">TRX</span><br></div>
                                                                </div>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>                                             </div><!-- .row -->
                                                                          
                          
                        <ul class="nk-nav nav nav-tabs">
                                <li class="nav-item">
                                    <a class="nav-link active" href="#">Deposit History</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="deposit.php">Deposit</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="withdraw-crypto.php">Withdraw Fiat<span class="badge badge-primary"></span></a>
                                </li>
                            </ul>









                            <?php
                   $account_num = $row['account_num'];
                   
                   $crabs = mysqli_query($mysqli,"SELECT * FROM transactions2 WHERE user = '$account_num' ORDER  BY id DESC ");
                   $brows = mysqli_num_rows($crabs);

                  
                   if( $brows == 0 ){
                     
                   }
                   else{
                       $i = 1;
                       while($xrow = mysqli_fetch_assoc($crabs)){
                        if($xrow['status'] == "Completed"){

                            $text ="success";
                            
                                                    }
                                                    else if($xrow['status'] == "Pending"){
                            
                                                        $text ="warning";
                                                        
                                                                                }
                                                    else{
                                                        $text ="danger";
                            
                                                    }
// Cryptocurrency logos from CoinGecko
$cryptoLogos = [
    'stellar' => 'https://cryptologos.cc/logos/stellar-xlm-logo.png',
    'tether' => 'https://assets.coingecko.com/coins/images/325/large/Tether-logo.png',
    'bitcoin' => 'https://assets.coingecko.com/coins/images/1/large/bitcoin.png',
    'bitcoin-cash' => 'https://assets.coingecko.com/coins/images/780/large/bitcoin-cash-circle.png?1696501932',
    'litecoin' => 'https://assets.coingecko.com/coins/images/2/large/litecoin.png',
    'ripple' => 'https://i.pinimg.com/originals/e6/9d/92/e69d92c8f36c37c84ecf8104e1fc386d.png',
    'tron' => 'https://cdn-icons-png.flaticon.com/512/12114/12114250.png'
];




                         
                           echo'
                           <div class="tranx-list tranx-list-stretch card card-bordered">
                           <div class="tranx-item">
                               <div class="tranx-col">
                                   <div class="tranx-info">
                                       <div class="tranx-badge">
                                           <span class="tranx-icon ">
                                             <h6 style="font-size:30px;" class="text-primary">
                                              <img src="'.$cryptoLogos[$xrow['scope']].'" style="height:30px;width:30px"/> 
                                             </h6>
                                           </span>
                                       </div>
                                       <div class="tranx-data">
                                           <div class="tranx-label">'.$xrow['scope'].'</div>
                                           <div class="tranx-date">'.$xrow['date'].'</div>
                                           <small class="badge badge-'.$text.'">'.$xrow['status'].'</small>                                                </div>
                                   </div>
                               </div>
                               <div class="tranx-col">
                                   <div class="tranx-amount">
                                       <div class="number">'.$xrow['amount_cur'].' <span class="currency currency-btc">'.$xrow['scope'].'</span></div>
                                   <div class="number-sm">'.$xrow['amount'].' <span class="currency currency-usd">'.currencySymbol($row['usercurrency']).'</span></div>
                                   </div>
                               </div>
                           </div><!-- .nk-tranx-item -->
                       </div>

                               
            
                                  '
                           ;
                           $i++ ;
                         
                       }                                                    
                   }
            
               
               
               
               ?>          


                      

















                                                 <script src="../js/jquery.min.js"></script>                  
         
<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>