<?php 
session_start();
//error_reporting(0); 
$success="";
if(isset($_SESSION['SESS_LOGGEDIN']) == FALSE) {
    header("location: " . $config_basedir."login.php");
}

require("config.php");
require("db.php");
?>
<?php

$seller= $_SESSION['SESS_USERID']; 

$sql = mysqli_query($db,"SELECT * FROM logins WHERE id='$seller'");
 
// Place image in the folder 

$numrow=mysqli_fetch_assoc($sql);
$loginrow['id'] = $numrow['id'];
//$profile = $numrow['profile'];
$walletid = $numrow['walletid'];
$member_no = $numrow['member_no'];
$forename = $numrow['firstname'];
$surname = $numrow['lastname'];
$interest_rate = $numrow['interest_rate'];
$profit = $numrow['profit'];
$max_period = $numrow['max_period'];
$max_invest= $numrow['max_invest'];
$invest_period = $numrow['invest_period'];
$invest_amt = $numrow['invest_amt'];
$ver=$numrow['verified'];
$deposit=$numrow['balance'];
//$user_id = $numrow['id']; //added
if (isset($_POST['details'])) {
	
    if ($ver==0){
        header("location: " . $config_basedir."verify.php");
    }
    else if($ver==1){
        $success="<div class='error' style='margin-bottom:0px;font-size:17px;'>Awaiting Verification</div>";
    }
    else if($deposit==0){
        header("location: " . $config_basedir."deposit.php");
    }
    else if($ver==2){
        header("location: " . $config_basedir."trade_now.php");
    }
    else{
    } 
}
?>
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="shortcut icon" href="assets/img/favicon2.png" type="image/x-icon">
  <link rel="stylesheet" href="assets/css/bootstrap_custom.css">
  <link rel="stylesheet"
    href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200">
  <link rel="stylesheet" href="assets/css/nice-select.css">
  <link rel="stylesheet" href="assets/css/styles.css">
  
  <script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
  <title>Alpha Lite Trade - Dashboard</title>
  
  <style>
    .blink_me{
   font-size: 25px;
   font-family: serif;
   color:#ffffff;
   text-align: center;
   font-weight: bold;
   animation: animate 1.5s linear infinite;
 } 
  
 @keyframes animate{
   0%{
     opacity: 0;
   }
   50%{
     opacity: 0.7;
   }
   100%{
     opacity: 0;
   }
 }
  </style>
</head>

<body>
  <div class="d-flex wrapper" id="wrapper">
    <!-- Sidebar -->
    <div id="sidebar-wrapper" class="sidebar-wrapper">
      <div class="sidebar-heading">
        <a href="index-2.html">
          <img id="logo" src="assets/img/logodash.png" alt="">
        </a>
      </div>
      <nav class="sidebar mb-4">
        <ul class="nav flex-column" id="nav_accordion">
          <li class="nav-item">
            <a class="nav-link active d-flex gap-2 align-items-center" href="trade.php">
              <img src="assets/img/dashboard_icon.png" alt="">
              <span class="fw-semibold">Dashboard</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="deposit.php">
              <span class="material-symbols-outlined fw-lighter">
                sync
              </span>
              <span class="fw-semibold">Deposit</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="withdraw.php">
              <span class="material-symbols-outlined fw-lighter">
                payments
              </span>
              <span class="fw-semibold">Withdraw</span>
            </a>
          </li>
         
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="pending.php">
              <span class="material-symbols-outlined fw-lighter">
                percent
              </span>
              <span class="fw-semibold">Pending</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="history.php">
              <span class="material-symbols-outlined fw-lighter">
                insights
              </span>
              <span class="fw-semibold">History</span>
            </a>
          </li>
		  
         
		  
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="account-details.php">
              <span class="material-symbols-outlined fw-lighter">
                settings
              </span>
              <span class="fw-semibold">Settings</span>
            </a>
          </li>

         <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="http://localhost/uchz/logout.php">
              <span class="material-symbols-outlined fw-lighter">
                logout
              </span>
              <span class="fw-semibold">Logout</span>
            </a>
          </li>
         
        </ul>
        <div class="lang-select d-flex justify-content-center">
          <select id="select">
            <option value="english">English</option>
            <option value="bangla">Bangla</option>
            <option value="arabic">Arabic</option>
          </select>
        </div>
      </nav>
    </div>


    <!-- Page Content -->
    <div id="page-content-wrapper" class="page-content-wrapper">
      <nav class="navbar navbar-expand-lg py-lg-3 px-2 px-lg-4 d-flex fixed-top justify-content-between">
        <div class="d-flex align-items-center">
          <div class="d-flex align-items-center d-lg-none">
            <span class="material-symbols-outlined menu-toggle" id="menu-toggle">
              menu
            </span>
          </div>
          <div class="d-none d-xl-block"> 
 		  
            
                <a class="dropdown-item d-flex align-items-center gap-2" href="#">
                  <span class="material-symbols-outlined fw-light" style="color: orange !important">
                    email
                  </span>
                  info@alphalitetrade.com</a>
               
          </div>
        </div>

        <div class="d-flex gap-3 p-lg-2 p-lg-0 align-items-center justify-content-end">           
          <div class="nav-item dropdown">
            <a class="d-flex gap-2 align-items-center" href="#" id="navbarDropdown4" role="button"
              data-bs-toggle="dropdown" aria-expanded="false">
              <img height="60" width="60" class="img-fluid" src="assets/img/avatarnow.png" alt="user">
              <div class="d-flex flex-column d-none d-xl-block">
                <p class="mb-0 text-white fw-semibold"><?php echo $forename; ?> <?php echo $surname; ?></p>
                <span class="small text-white">Investor</span>
				
				<?php
                        function display_currency($currency){

                            foreach($currency as $currence){
                                echo $currence;
                            }
                        }
                        $username = $_SESSION['SESS_USERNAME'];
                        $currency = array();
                        $query = mysqli_query($db,"SELECT * FROM logins WHERE username='$username'");
                        $user_data = mysqli_fetch_array($query);
                        if($user_data['currency']==mysqli_real_escape_string($db,'USD')){
                            $currency[]='$';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'GBP')){
                            $currency[]='£';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'EUR')){
                            $currency[]='€';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'AUD')){
                            $currency[]='$';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'CAD')){
                            $currency[]='$';
                        }
                        $seller= $_SESSION['SESS_USERID']; 
                        $sql = mysqli_query($db,"SELECT * FROM logins WHERE id='$seller'");

                        $numrow=mysqli_fetch_assoc($sql);
                        $balc=$numrow['balance'];
                        ?>
              </div>
            </a>
            <ul class="dropdown-menu dropdown-menu-end user shadow border-0" aria-labelledby="navbarDropdown4"
              onclick="event.stopPropagation()">
              <li><span class="px-3 d-inline-block">Welcome <?php echo $surname; ?></span></li>
              <li>
                <a class="dropdown-item d-flex align-items-center gap-2" href="#">
                  <span class="material-symbols-outlined fw-light">
                    account_circle
                  </span>
                  Profile</a>
              </li>
              <li>
                <a class="dropdown-item d-flex align-items-center gap-2" href="#">
                  <span class="material-symbols-outlined fw-light"> chat </span>
                  Message</a>
              </li>
            
            
              <li>
                <a class="dropdown-item d-flex align-items-center gap-2" href="account-details.php">
                  <span class="material-symbols-outlined fw-light"> settings </span>
                  Settings</a>
              </li>
              <li>
                <a class="dropdown-item d-flex align-items-center gap-1" href="http://localhost/uchz/logout.php">
                  <span class="material-symbols-outlined fw-light"> logout </span>
                  Log Out</a>
              </li>
            </ul>
          </div>
        </div>
        <!-- For pc -->
      </nav>

      <div class="container-fluid main-content px-2 px-lg-4">
	  
	  <script>
  (function(b,i,t,C,O,I,N) {
    window.addEventListener('load',function() {
      if(b.getElementById(C))return;
      I=b.createElement(i),N=b.getElementsByTagName(i)[0];
      I.src=t;I.id=C;N.parentNode.insertBefore(I, N);
    },false)
  })(document,'script','https://widgets.bitcoin.com/widget.js','btcwdgt');
</script>




<div class="container">
  <div class="well well-lg" style="background: green !important">
  <div style="width: 100%; height:62px; background-color: #1D2330; overflow:hidden; box-sizing: border-box; border: 1px solid #282E3B; border-radius: 4px; text-align: right; line-height:14px; block-size:62px; font-size: 12px; box-sizing:content-box; font-feature-settings: normal; text-size-adjust: 100%; box-shadow: inset 0 -20px 0 0 #262B38;padding:1px;padding: 0px; margin: 0px;"><div style="height:40px;"><iframe src="https://widget.coinlib.io/widget?type=horizontal_v2&theme=dark&pref_coin_id=1505&invert_hover=" width="100%" height="36" scrolling="auto" marginwidth="0" marginheight="0" frameborder="0" border="0" style="border:0;margin:0;padding:0;"></iframe></div><div style="color: #626B7F; line-height: 14px; font-weight: 400; font-size: 11px; box-sizing:content-box; margin: 5px 6px 10px 0px; font-family: Verdana, Tahoma, Arial, sans-serif;">Powered by&nbsp;<a href="https://coinlib.io" target="_blank" style="font-weight: 500; color: #626B7F; text-decoration:none; font-size: 11px;">Alpha Elite Trade</a></div></div>
  </div>
</div>
	  
	  
	  
        <div class="row my-2 g-3 g-lg-4">
          <div class="col-md-6 col-xl-4 col-xxl-3">
            <div class="price-box">
              <div class="d-flex align-items-center justify-content-between">
                <div>
                  <p class="text-white mb-0">Investment</p>
                  <h4 class="fw-semibold text-white mb-0"><?php display_currency($currency); echo' '. $invest_amt ?>.00</h4>
                </div>
                <img src="assets/img/crypto/moni.png" alt="">
              </div>
              <div class="chart">
                <canvas id="chart_2"></canvas>
              </div>
            </div>
          </div>
          <div class="col-md-6 col-xl-4 col-xxl-3">
            <div class="price-box">
              <div class="d-flex align-items-center justify-content-between">
                <div>
                  <p class="text-white mb-0">TOTAL BALANCE</p>
                  <h4 class="fw-semibold text-white mb-0" style="color: orange !important"><?php display_currency($currency); echo' '. $balc ?>.00</h4>
                </div>
                <img src="assets/img/crypto/3.png" alt="">
              </div>
              <div class="chart">
                <canvas id="chart_3"></canvas>
              </div>
            </div>
          </div>
          
          <div class="col-md-6 col-xl-4 col-xxl-3">
            <div class="price-box">
              <div class="d-flex align-items-center justify-content-between">
                <div>
                  <p class="text-white mb-0">TOTAL BONUS</p>
                  <h4 class="fw-semibold text-white mb-0"><?php  display_currency($currency); echo' '. $profit ?>.00</h4>
                </div>
                <img src="assets/img/crypto/bal.png" alt="">
              </div>
              <div class="chart">
                <canvas id="chart_5"></canvas>
              </div>
            </div>
          </div>
		  
		<div class="col-md-6 col-xl-4 col-xxl-3">
            <div class="price-box">
              <div class="d-flex align-items-center justify-content-between">
                <div>
                  <p class="text-white mb-0">ACCOUNT STATUS</p>
                  
				  
				    <a class="dropdown-item d-flex align-items-center gap-2 blink_me" href="#">
                  <span class="material-symbols-outlined fw-light" style="color: white !important">
                    verified
                  </span>
                  <?php echo $max_period; ?></a>				  						  
				  
                </div>
                <img src="assets/img/crypto/myt.png" with='30' height='30' style="opacity: 0.5" alt="">
              </div>
              <div class="chart">
                <canvas id="chart_4"></canvas>
              </div>
            </div>
          </div>

        </div>






<div class="row">
  <div class="col-md-16 col-lg-16 col-xl-16">
    <div class="card full-screen-container" style="background: orange !important">
      <div class="card-header align-items-start justify-content-between flex" style="">
        <h5 class="card-title  pull-left" style="color:white"><b>Live Trading Chart</b></h5>
        <ul class="nav nav-pills card-header-pills pull-right">
          <!-- <li class="nav-item">
            <button type="" class="btn btn-sm btn-outline-primary btn-round" id="livechart"><i class="fa fa-print"></i> <span class="">Get Pdf</span></button>
          </li> -->
          <li class="nav-item">
            <button class="btn btn-sm btn-link btn-round fullscreen-btn"><i class="fa fa-arrows-alt"></i></button>
          </li>
          <li class="nav-item">
            <button class="btn btn-sm btn-link btn-round" data-toggle="collapse" data-target="#demo"><i class="fa fa-chevron-down"></i></button>
          </li>
        </ul>
      </div>
      <div id="tablelivechart">
        <!-- chart -->
        <div class="tradingview-widget-container" id="demo">
          <div id="tradingview_e705a" style="height:550px"></div>
          <script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
          <script type="text/javascript">
            new TradingView.widget({
              "autosize": true,
              // "width": 1200,
              // "height": 610,
              "symbol": "NASDAQ:AMZN",
              "interval": "1",
              "timezone": "America/Los_Angeles",
              "theme": "dark",
              "style": "1",
              "locale": "en",
              "toolbar_bg": "#f1f3f6",
              "enable_publishing": false,
              "hide_side_toolbar": false,
              "allow_symbol_change": true,
              "details": true,
              "studies": [
                "AwesomeOscillator@tv-basicstudies",
                "MACD@tv-basicstudies"
              ],
              "container_id": "tradingview_e705a"
            });
          </script>
        </div>
        <!-- chart end -->
      </div>
    </div>
  </div>
</div>





<div class="row">
  <div class="col-md-16 col-lg-16 col-xl-16" style="margin-top: 70px !important">
    <div class="card full-screen-container" style="background: orange !important">
      <div class="card-header align-items-start justify-content-between flex">
        <h5 class="card-title  pull-left" style="color: white !important"><b>Cryptocurrency Market</b></h5>
        <ul class="nav nav-pills card-header-pills pull-right">
          <!-- <li class="nav-item">
            <button type="" class="btn btn-sm btn-outline-primary btn-round" id="chart1"><i class="fa fa-print"></i> <span class="">Get Pdf</span></button>
          </li> -->
          <li class="nav-item">
            <button class="btn btn-sm btn-link btn-round fullscreen-btn"><i class="fa fa-arrows-alt"></i></button>
          </li>
          <li class="nav-item">
            <button class="btn btn-sm btn-link btn-round" data-toggle="collapse" data-target="#demo3"><i class="fa fa-chevron-down"></i></button>
          </li>
        </ul>
      </div>
      <div id="tablechart1">
        <div id="demo3" class="">
          <!-- TradingView Widget BEGIN -->
          <div class="tradingview-widget-container" style="width: 100%; height: 350px;">
            <div class="tradingview-widget-container__widget"></div>
            <!-- <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/markets/cryptocurrencies/prices-all/" rel="noopener" target="_blank"><span class="blue-text">Cryptocurrency Markets</span></a> by TradingView</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>

      </div>
    </div>
  </div>
  <!-- </div> -->


  <!-- <div class="row"> -->
  <div class="col-md-16 col-lg-16 col-xl-16" style="margin-top: 40px !important">
    <div class="card full-screen-container" style="background: orange !important">
      <div class="card-header align-items-start justify-content-between flex">
        <h5 class="card-title  pull-left" style="color: white !important"><b>Stock Market Data</b></h5>
        <ul class="nav nav-pills card-header-pills pull-right">
          <!-- <li class="nav-item">
            <button type="" class="btn btn-sm btn-outline-primary btn-round" id="chart2"><i class="fa fa-print"></i> <span class="">Get Pdf</span></button>
          </li> -->
          <li class="nav-item">
            <button class="btn btn-sm btn-link btn-round fullscreen-btn"><i class="fa fa-arrows-alt"></i></button>
          </li>
          <li class="nav-item">
            <button class="btn btn-sm btn-link btn-round" data-toggle="collapse" data-target="#demo1"><i class="fa fa-chevron-down"></i></button>
          </li>
        </ul>
      </div>
	  
      <div id="tablechart2">
        <div id="demo1" class="">
          <div class="tradingview-widget-container" style="width: 100%; height: 350px;">
            <!-- 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" target="_blank"><span class="blue-text">stock</span></a> by TradingView</div> -->
            <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-market-quotes.js" async>
              {
                "width": "100%",
                "height": "350",
                "symbolsGroups": [{
                    "name": "stock",
                    "symbols": [{
                        "name": "NASDAQ:NDAQ",
                        "displayName": "NASDAQ"
                      },
                      {
                        "name": "NASDAQ:AAPL",
                        "displayName": "APPLE STOCK"
                      },
                      {
                        "name": "NASDAQ:GOOGL",
                        "displayName": "GOOGL"
                      },
                      {
                        "name": "NASDAQ:NVAX",
                        "displayName": "NVAX NA"
                      },
                      {
                        "name": "NASDAQ:AMZN",
                        "displayName": "AMZN"
                      },
                      {
                        "name": "NASDAQ:FB",
                        "displayName": "FACEB"
                      },
                      {
                        "name": "NASDAQ:TLSA",
                        "displayName": "TLSA"
                      }
                    ]
                  },
                  {
                    "name": "Indices",
                    "originalName": "Indices",
                    "symbols": [{
                        "name": "FOREXCOM:SPXUSD",
                        "displayName": "S&P 500"
                      },
                      {
                        "name": "FOREXCOM:NSXUSD",
                        "displayName": "Nasdaq 100"
                      },
                      {
                        "name": "FOREXCOM:DJI",
                        "displayName": "Dow 30"
                      },
                      {
                        "name": "INDEX:NKY",
                        "displayName": "Nikkei 225"
                      },
                      {
                        "name": "INDEX:DEU30",
                        "displayName": "DAX Index"
                      },
                      {
                        "name": "FOREXCOM:UKXGBP",
                        "displayName": "UK 100"
                      }
                    ]
                  },
                  {
                    "name": "Commodities",
                    "originalName": "Commodities",
                    "symbols": [{
                        "name": "CME_MINI:ES1!",
                        "displayName": "S&P 500"
                      },
                      {
                        "name": "CME:6E1!",
                        "displayName": "Euro"
                      },
                      {
                        "name": "COMEX:GC1!",
                        "displayName": "Gold"
                      },
                      {
                        "name": "NYMEX:CL1!",
                        "displayName": "Crude Oil"
                      },
                      {
                        "name": "NYMEX:NG1!",
                        "displayName": "Natural Gas"
                      },
                      {
                        "name": "CBOT:ZC1!",
                        "displayName": "Corn"
                      }
                    ]
                  },
                  {
                    "name": "Bonds",
                    "originalName": "Bonds",
                    "symbols": [{
                        "name": "CME:GE1!",
                        "displayName": "Eurodollar"
                      },
                      {
                        "name": "CBOT:ZB1!",
                        "displayName": "T-Bond"
                      },
                      {
                        "name": "CBOT:UB1!",
                        "displayName": "Ultra T-Bond"
                      },
                      {
                        "name": "EUREX:FGBL1!",
                        "displayName": "Euro Bund"
                      },
                      {
                        "name": "EUREX:FBTP1!",
                        "displayName": "Euro BTP"
                      },
                      {
                        "name": "EUREX:FGBM1!",
                        "displayName": "Euro BOBL"
                      }
                    ]
                  },
                  {
                    "name": "Forex",
                    "originalName": "Forex",
                    "symbols": [{
                        "name": "FX:EURUSD"
                      },
                      {
                        "name": "FX:GBPUSD"
                      },
                      {
                        "name": "FX:USDJPY"
                      },
                      {
                        "name": "FX:USDCHF"
                      },
                      {
                        "name": "FX:AUDUSD"
                      },
                      {
                        "name": "FX:USDCAD"
                      }
                    ]
                  }
                ],
                "showSymbolLogo": true,
                "colorTheme": "dark",
                "isTransparent": false,
                "locale": "en"
              }
            </script>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>


















        <div class="row py-2 g-3 g-lg-4 top-border footer">
          <div class="col-lg-6">
            <span class="text-center text-lg-start d-block w-100">©2023. All Rights Reserved By <a href="#" class="primary">Alpha Lite Trade.</a></span>
          </div>
         
        </div>
      </div>
    </div>

    <!-- /#page-content-wrapper -->
  </div>

  <script src="../cdn.jsdelivr.net/npm/bootstrap%405.0.0-beta3/dist/js/bootstrap.bundle.min.js"></script>
  <script src="../cdn.jsdelivr.net/npm/chart.js"></script>
  <script src="../code.jquery.com/jquery-3.5.1.min.js"></script>
  <script src="assets/js/jquery.nice-select.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
  <script src="assets/js/main.js"></script>
  <script src="assets/js/chart.js"></script>
  
  
</body>
</html>