<?php
include("common/header2.php");
include("common/connection.php");


/*

if (isset($_GET['sd'])) {
  # code...

$from=$_GET['sd'];
$to=$_GET['ed'];
 
 
 
$sql="SELECT * FROM  tbl_agent WHERE created_date  between '$from' and '$to'   ORDER BY id DESC  ";
$result=mysqli_query($db,$sql);
if(mysqli_num_rows($result)>0);

   
} 
else
{
 $sql="SELECT * FROM  tbl_agent  ORDER BY ID DESC LIMIT 20 ";
$result=mysqli_query($db,$sql);
if(mysqli_num_rows($result)>0);




}
*/

 $sql="SELECT * FROM  tbl_transaction   where status='1' and user_id != '0' order by transaction_id desc ";
$result=mysqli_query($db,$sql);
if(mysqli_num_rows($result)>0);


?>

        <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
             <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-12 d-flex no-block align-items-center">
                        <h4 class="page-title">Account Summary </h4>
                        <div class="ml-auto text-right">
                             <a class="btn btn-sm btn-primary btn-round" href="adminindex.php">
        <i class="icon md-link" aria-hidden="true"></i>
        <span class="hidden-sm-down">Home</span>
      </a>
                        </div>
                    </div>
                </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid">
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                <div class="row">
                    <div class="col-12">
                        
                        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title">Total  Transaction</h5>
                                <div class="table-responsive">
                                    <table id="zero_config" class="table table-striped table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Sno.</th>
                                                <th>Transaction Type</th>
                                                 <th>User Id</th>
                                                   <th>Amount </th>
                                                    <th>Type</th>
                                                      
                                              <th>Date / Time</th>
                                         
                                            </tr>
                                        </thead>
                                        <tbody>
                                            
                         <?php 
                                             $count=0;
                                             while($row = mysqli_fetch_assoc($result)) {
                                            if($result)
                                                {    $count++; 
                                                  $app=  $row['approved'];
                                                    ?>
                                             <tr>
                                            <td><?php echo $count;?></td>
                                             
                                            <td><?php echo $row['transcation_type'];?></td>
                                            <td><?php echo $row['user_id'];?></td>

                               <td><b><?php echo $row['amount'];?>  </b></td>
                               <td><?php echo $row['cdtype'];?></td>
                                 
                                             <td><?php echo $row['created_date'];?> / <?php echo $row['time'];?></td>
                                       
                               <!--  <td> 
  
<a style="color: blue;" href="agent-update.php?id=">  <button type="button" class="btn btn-primary btn-sm"> <i class="fas fa-edit"></i></button> </a>

<a  href="agent-delete.php?id=">
<button type="button" class="btn btn-danger btn-sm remove"> <i class="fas fa-ban"></i></button> 
</a>
<a  href="agent-delete.php?id=">
<button type="button" class="btn btn-success btn-sm"> <i class="far fa-check-circle"></i></button> 
</a>
 <a  href="agent-view.php?id=">
<button type="button" class="btn btn-warning btn-sm remove"> <i class=" fas fa-eye"></i></button> 
</a>

  </td>-->
     </tr>
                                        <?php } } ?>

<tfoot>
                                            <tr>
                                             <th>Sno.</th>
                                                      <th>Transaction Type</th>
                                                 <th>User Id</th>
                                                   <th>Amount </th>
                                                    <th>Type</th>
                                                      
                                              <th>Date</th>
                                            

                                            </tr>
                                        </tfoot>
                                        </tbody>
                                        
                                    </table>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Right sidebar -->
                <!-- ============================================================== -->
                <!-- .right-sidebar -->
                <!-- ============================================================== -->
                <!-- End Right sidebar -->
                <!-- ============================================================== -->
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- footer -->
            <!-- ============================================================== -->
                      <?php
include("common/footer.php");
?>
  <script src="assets/extra-libs/DataTables/datatables.min.js"></script>
     <link href="assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.css" rel="stylesheet">
    <link href="dist/css/style.min.css" rel="stylesheet">
     <script>
        /****************************************
         *       Basic Table                   *
         ****************************************/
        $('#zero_config').DataTable();
    </script>