<?php include("includes/header.php"); ?>
<?php // include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Dashboard | <?php echo $sitename;  ?></title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

   <!--CSS-->
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

    <!-- Bootstrap Core CSS -->
      <link href="css/bootstrap.min.css" rel="stylesheet">

     <!-- Font Awesome -->
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

      <!-- Custom CSS -->
      <link href="css/blog-home.css" rel="stylesheet">

      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
      <!--[if lt IE 9]-->
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
          <script src="js/jquery.js"></script>
          <script src="js/bootstrap.js"></script>



</head>

<body>
  <?php  include("includes/dashboard_navbar.php"); ?>
  <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
  <style>
    body{
      background-color: #f5f5f5;
    }
    .destop-siderbar{
      background-color: #131e2a;
      height: 100%;
      width:240px;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      position: fixed;
      margin-left:-20px;
      padding:50px 25px;
    }
    .destop-siderbar li{
       padding: 30px 20px;
       list-style: none;
    }
    .destop-siderbar li a{
      color: #fff;
      font-size: 17px;
      padding:10px 0px;
    }
    .destop-siderbar li a i{
      color:#ffb900;
      font-weight: lighter;
    }
    .destop-siderbar .active {
      background-color:#123962;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      
    }
    .destop-siderbar .active a{
      color:#fff;
    }
    .destop-siderbar .active a:hover{
      color:#fff;
    }
    .destop-siderbar li a:hover{
      color: #a5bdd9;
      text-decoration: none;
    }
    .panel{
      border-radius: 0px;
      border-color: transparent;
    }
  </style>

  <div class="container-fluid">
    <div class="row">
      <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-2 hidden-xs" style="height: 100%;">
              <ul class="destop-siderbar">
                <br><br>
                 <li><a href="dashboard.php"><i class="fa fa-th-large"></i>&nbsp;&nbsp;Dashboard</a></li><br><br>
                 <li><a href="sell-bitcoin.php"><i class="fa fa-btc"></i>&nbsp;&nbsp;Sell Bitcoin</a></li><br><br>
                 <li><a href="buy-bitcoin.php"><i class="fa fa-shopping-cart"></i>&nbsp;&nbsp;Buy Bitcoin</a></li><br><br>
                 <li><a href="withdraw.php"><i class="fa fa-google-wallet"></i>&nbsp;&nbsp;Withdraw <sup><span style="font-size: 12px; color: #00d67d;"> ₦</span></sup></a></li><br><br>
                 <li><a href="deposit.php"><i class="fa fa-google-wallet"></i>&nbsp;&nbsp;Deposit <sup><span style="font-size:12px; color: #00d67d;"> ₦</span></sup></a></li><br><br>
                 <li><a href="transactions.php"><i class="fa fa-exchange"></i>&nbsp;&nbsp;Transactions</a></li><br><br>
                 <li><a href="settings.php"><i class="fa fa-cog"></i>&nbsp;&nbsp;Settings</a></li><br><br>
                 <li><a href="security.php"><i class="fa fa-shield"></i>&nbsp;&nbsp;Security</a></li><br><br>
                 <li><a href="live-chat.php"><i class="fa fa-comments-o"></i>&nbsp;&nbsp;Live Chat</a></li><br><br>
                 <li><a href="logout.php"><i class="fa fa-power-off"></i>&nbsp;&nbsp;Logout</a></li>
                 <br><br><br><br><br><br><br>
               </ul>
      </div>
      <!--/////////////////////// DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-10">
        <br><br><br><br>

        <!----------------------------------------------------------------------------------->

        <div class="row">
          <div class="col-sm-8">
            <div class="row">
              

              <div class="col-sm-6">
                 <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/btc1.svg" width="35">&nbsp;&nbsp;<b>UPDATE RATES</b>
                <br><hr>
                
                    <div class="part-1">
                      <br>
                      <span style="font-size: 20px;">What's up Comrade,</span><br>
                      <span style="font-size: 15px;">Update your rates below.</span><br><br>


                      <?php
                       if(isset($_POST["updaterate"])){

                         $newbtcrate = $_POST["newbtcrate"];
                         $newusdtrate = $_POST["newusdtrate"];
                         $newethrate = $_POST["newethrate"];

                            //UPDATE PASSWORD ON DB
                            $query = mysqli_query($conn, "UPDATE hq SET rates = '$newbtcrate', eth_rates = '$newethrate', usdt_rates = '$newusdtrate'");
                            echo "<div class='alert alert-success' style='border-radius:0px;'><i class='fa fa-bell'></i> Rates Updated</div>";
                       
                       }
 
                      ?>


                      <?php
                        //RATES

                        $rate_query = mysqli_query($conn, "SELECT * FROM hq");
                        $rate_row = mysqli_fetch_assoc($rate_query);
                        $rates = $rate_row["rates"];
                        $eth_rates = $rate_row["eth_rates"];
                        $usdt_rates = $rate_row["usdt_rates"];
                      ?>

                      <form action="" method="POST">
                        <div class="form-group">
                          <label>BTC RATES:</label>
                          <input type="number" name="newbtcrate" class="input-lg form-control" style="border-radius: 0px;" value="<?php echo $rates; ?>">

                          <br>

                          <label>ETH RATES:</label>
                          <input type="number" name="newethrate" class="input-lg form-control" style="border-radius: 0px;" value="<?php echo $eth_rates; ?>">

                          <br>

                          <label>USDT RATES:</label>
                          <input type="number" name="newusdtrate" class="input-lg form-control" style="border-radius: 0px;" value="<?php echo $usdt_rates; ?>">

                          <button type="submit" name="updaterate" class="btn btn-lg btn-block" style="border-radius: 0px; height:43px; font-size:13px; letter-spacing:1px; background-color:rgb(0, 135, 90); color:#fff;"><i class="fa fa-edit" style="font-weight: lighter;"></i> UPDATE</button>

                        </div>
                      </form>

                      
                    </div>


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

              <div class="col-sm-6">
                
              </div>

            </div>

            <!--------------------------->







          </div>


          <div class="col-sm-4">
            
            </div>
          </div>
        </div>
        
        
        
        
        
        
      </div>
    </div>
  </div>
</body>
</html>