<?php include("includes/header.php"); ?>
<?php include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Admin Dashboard | <?php echo $sitename;  ?> HQ</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>





          <!----MODAL-------------------->
          <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.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:rgb(45, 156, 219);
      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;
    }
    .input-danger{
       border:1px solid darkred;
       color:darkred;
     }
     .input-danger::placeholder{
       opacity: 0.6;
       color:darkred;
     }
  </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%;">
              <?php include("includes/desktop_side.php"); ?>
      </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-12" align="">
            <div class="alert alert-info" style="border-radius: 0px;">
              <img src="images/unauthorized-person.png" class="img-responsive" width="40">
              <span style="font-size: 20px;">Welcome <b>@<?php echo $admin_username; ?> | <span style="font-size: 14px; color:#ffb900;"> SUPER ADMIN</span></b></span><hr>
              <span style="font-size: 15px;">Welcome Boss, below are the recent activities on <?php echo $sitename; ?>, you can navigate to view more insights on user data.</span>

              

              <div class="row">
                <div class="col-sm-12 hidden-md hidden-lg" align="left">
                  <br>
                  <a href="all-users.php" class="btn" style="font-weight:; background-color:rgb(45, 156, 219); border-color: transparent; color:#fff; border-radius:0px; font-size:14px;">ALL USERS <i class="fa fa-caret-right"></i></a>
                </div>

                <div class="col-sm-12 hidden-xs hidden-sm" align="right">
                  <a href="all-users.php" class="btn" style="font-weight:; background-color:rgb(45, 156, 219); border-color: transparent; color:#fff; border-radius:0px; font-size:14px;">ALL USERS <i class="fa fa-caret-right"></i></a>
                </div>
              </div>
            </div>
            
          </div>
        </div>

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

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

              <div class="col-sm-4">
                 <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/users.png" width="50px">&nbsp;&nbsp;<b>CLIENTS</b>
                    <br><br><br>
                    <span style="font-size: 16px;">All Users:</span>
                    <br>
                    <span style="color: #ff9800; font-size: 23px;"><?php echo $users_numrow; ?></span>
                    <br><hr>
                    <div align="right">
                      <a href="all-users.php" class="btn" style="font-weight:; background-color:rgb(45, 156, 219); border-color: transparent; color:#fff; border-radius:0px; font-size:14px;">VIEW ALL <i class="fa fa-caret-right"></i></a>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-sm-4">
                <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/893268.png" width="50px">&nbsp;&nbsp;<b>MESSAGES</b>
                    <br><br><br>
                    <span style="font-size: 16px;">All Messages:</span>
                    <br>
                    <span style="color: #00d67d; font-size: 23px;"><?php echo $support_numrow; ?></span>
                    <br><hr>
                    <div align="right">
                      <a href="all-msg.php" class="btn" style="font-weight:; background-color:rgb(45, 156, 219); border-color: transparent; color:#fff; border-radius:0px; font-size:14px;">VIEW ALL <i class="fa fa-caret-right"></i></a>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-sm-4">
                <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/1751805.png" width="50px">&nbsp;&nbsp;<b>TRANSACTIONS</b>
                    <br><br><br>
                    <span style="font-size: 16px;">All Transactions:</span>
                    <br>
                    <span style="color: #00d67d; font-size: 23px;"><?php echo $transfer_numrow; ?></span>
                    <br><hr>
                    <div align="right">
                      <a href="all-trans.php" class="btn" style="font-weight:; background-color:rgb(45, 156, 219); border-color: transparent; color:#fff; border-radius:0px; font-size:14px;">VIEW ALL <i class="fa fa-caret-right"></i></a>
                    </div>
                  </div>
                </div>
              </div>

            </div>

            

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

            <div class="row">
              <div class="col-sm-12">
                 <div class="panel panel-default">
                  <div class="panel-body">
                       <span style="font-size: 16px; font-weight: bold;"><i class="fa fa-caret-left" style="font-size: 18px;"></i> <i class="fa fa-caret-right" style="font-size: 18px;"></i> LATEST TRANSACTIONS</span>
                    

                       <style>
                         table thead tr th{
                           font-size: 13px;
                           font-weight: bolder;
                         }
                         table tbody tr td{
                           font-size: 13px;
                           font-weight:;
                         }
                       </style>

                         <div class="table-responsive">
                          
                          <div class="hidden-lg hidden-md" align="left" style="font-size: 15px; margin-left: 10px; color: red;"><img src="images/swipe-left.gif" class="img-responsive" width="45"> Swipe left to view full transaction details.</div>
                          <hr>
                         <table class="table table-bordered table-striped">
                             <thead>
                               <tr>
                                <th>EDIT</th>
                                <th>X</th>
                                <th>STATUS</th>
                                <th>DATE</th>
                                <th>TYPE</th>
                                 <th>AMOUNT<span style="color:#000; font-size: 12px; font-weight: normal;"></span></th>
                                 <th>DESC</th>

                               </tr>
                            
                       <?php
                        $query = mysqli_query($conn, "SELECT * FROM transfer ORDER BY id DESC LIMIT 20");
                        $numrow = mysqli_num_rows($query);
                        if($numrow >= 1){
                          while($row = mysqli_fetch_assoc($query)){
                            
                            $user_id = $row['account_id'];
                            $tdate = $row["date"];
                            $tdesc = $row["desc"];
                            $tamount = $row["amount"];
                            $tstatus = $row['status'];
                            $trans_type = $row["trans_type"];
                            $trans_status = $row["trans_status"];

                            $cot_trans_status = $row["cot_trans_status"];
                            $aml_trans_status = $row["aml_trans_status"];
                            $nrt_trans_status = $row["nrt_trans_status"];
                            $r_name = $row["r_name"];
                            $r_account_number = $row["r_account_number"];
                            $r_bank_name = $row["r_bank_name"];    ?>
                                 
                                 </thead>
                                 <tbody class="tbody">
                                 <tr>

                                  

                                  <td> <a href="edit-trans.php?user_id=<?php echo $user_id; ?>" class="btn btn-primary" style="border-radius: 0px;"><i class="fa fa-edit"></i></a> </td>

                                  <td><a href="delete-trans.php?user_id=<?php echo $user_id; ?>" class="btn btn-danger" style="border-radius: 0px;"><i class="fa fa-trash"></i></a> </td>

                                  <td>
                                    <?php
                                    if($trans_status == "PENDING"){
                                        $trans_status = "<a class='btn btn-warning' style='border-radius:0px;'>PENDING</a>";
                                    }elseif($trans_status == "APPROVED"){
                                        $trans_status = "<a class='btn btn-success' style='border-radius:0px;'>APPROVED</a>";
                                    }elseif($trans_status == "DECLINED"){
                                        $trans_status = "<a class='btn btn-danger' style='border-radius:0px;'>DECLINED</a>";
                                    }else{
                                     echo "";
                                    }

                                    echo $trans_status;
                                  ?>
                                  </td>
                                  <td><?php echo $tdate; ?></td>
                                  <td><?php echo $trans_type; ?></td>
                                  <td>$<?php echo ($tamount); ?></td>
                                  <td><?php echo $tdesc; ?></td>
                                   
                                 </tr>
                               



                        <?php  }
                        }else{
                          echo ' <br><br>
                    <div align="center">
                    <img src="images/empty.png" width="80" class="img-responsive">
                    <br>
                    <span style="font-size: 18px;">What\'s Up Comrade</span><br><br>
                    <span style="font-size: 15px;">You have not traded crypto with btczux, <a href="sell-bitcoin.php">Trade Now <i class="fa fa-caret-right"></i></a></span>
                    </div>

                    <br><br><br><br><br>';
                        }
                       ?>

                           </tbody>
                         </table>

                       </div>
                       <div align="right"><a href="all-users.php" style="font-size: 15px;">View all users <i class="fa fa-caret-right"></i></a></div>

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






          </div>








          </div>
        </div>
        
        
        
        
        
        
      </div>
    </div>
  </div>
</body>
</html>