<!doctype html>
<html lang="en">
<head>
  
    <!-- Required meta tags -->
    <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title><?php echo $row[0]; ?> ||WITHDRAW</title>
  <meta content="" name="description">
  <meta content="" name="keywords">

  <!-- Favicons -->
  <link href="../img/logo/logo22222.png" rel="icon"> 

  <!-- Google Fonts -->
  <link href="https://fonts.gstatic.com" rel="preconnect">
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">

  <!-- Vendor CSS Files -->
  <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
  <link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
  <link href="assets/vendor/quill/quill.snow.css" rel="stylesheet">
  <link href="assets/vendor/quill/quill.bubble.css" rel="stylesheet">
  <link href="assets/vendor/remixicon/remixicon.css" rel="stylesheet">
  <link href="assets/vendor/simple-datatables/style.css" rel="stylesheet">

  <!-- Template Main CSS File -->
  <link href="assets/css/style.css" rel="stylesheet">
</head>

<body>

    <main id="main" class="main">

        <?php
        include_once("element/header.php");
         ?>
        <?php
        include_once("element/sidebar.php");
         ?>

        <div class="dashboard-wrapper">
            <div class="container-fluid  dashboard-content">

                <div class="row">
                  <?php include('element/connection.php');?>


                  <div class="">
                        <div class="card">
                            <h5 class="card-header">Withdraw History</h5>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table table-striped table-bordered first">
                                        <thead>
                                            <tr>
                                                <th>Sr no</th>
                                                <th>Amt</th>
                                                <th>User Id</th>
                                                <th>Request Date</th>
                                                <th>Approve Date</th>
                                                <th>Status</th>
                                                <th>Left.</th>
                                                <th>Right.</th>
                                                
                                            </tr>
                                        </thead>
                                        <tbody>
                                          <?php
                                          $a=0;        
                                              $data=mysqli_query($conn,"SELECT * FROM witdrawl ");
                                              
                                              while ($d=mysqli_fetch_array($data)) {
                                                  $amt = $d['amt'];
                                          $perce = 15;
                                                ?>
                                                <tr>
                                                  <th><?php echo ++$a; ?></th>
                                                  <th><?php echo number_format($amt - ($amt*$perce)/100) ?></th>
                                                  <th><?php echo $d['user_id'] ?></th>
                                                  <th><?php echo $d['request_date'] ?></th>
                                                  <th><?php echo $d['approve_date'] ?></th>
                                                  <th><?php echo ($d['status'])?"Paid":"Pending" ?></th>                                                  
                                                  <th> <?php echo $d['left_count'] ?> </th>                                                  
                                                  <th> <?php echo $d['right_count'] ?> </th>                                                  
                                                                                                 
                                                </tr>
                                                <?php
                                              }
                                           ?>

                                        </tbody>
                                        
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

            </div>


        </div>
    </div>
    <!-- ============================================================== -->
    <!-- end main wrapper -->
    <!-- ============================================================== -->
    <!-- Optional JavaScript -->
    <script type="text/javascript">
                        function show_details(a){
                          $('#exampleModal').modal("show");
                          var agent_id=$(a).attr('id');
                          $('#exampleModalLabel').html(agent_id);
                          $.ajax({
                            url: 'ajax.php',
                            type: 'post',
                            data: {agent_id:agent_id},
                            success:function(response){
                              $('#agent_detail_show_on_model').html(response);
                            }
                          })
                        }
                      </script>
    <script src="assets/vendor/jquery/jquery-3.3.1.min.js"></script>
    <script src="assets/vendor/bootstrap/js/bootstrap.bundle.js"></script>
    <script src="assets/vendor/slimscroll/jquery.slimscroll.js"></script>
    <script src="assets/vendor/multi-select/js/jquery.multi-select.js"></script>
    <script src="assets/libs/js/main-js.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
    <script src="assets/vendor/datatables/js/dataTables.bootstrap4.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.2/js/dataTables.buttons.min.js"></script>
    <script src="assets/vendor/datatables/js/buttons.bootstrap4.min.js"></script>
    <script src="assets/vendor/datatables/js/data-table.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.2/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.2/js/buttons.print.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.5.2/js/buttons.colVis.min.js"></script>
    <script src="https://cdn.datatables.net/rowgroup/1.0.4/js/dataTables.rowGroup.min.js"></script>
    <script src="https://cdn.datatables.net/select/1.2.7/js/dataTables.select.min.js"></script>
    <script src="https://cdn.datatables.net/fixedheader/3.1.5/js/dataTables.fixedHeader.min.js"></script>
    <script src="assets/vendor/apexcharts/apexcharts.min.js"></script>
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/chart.js/chart.min.js"></script>
  <script src="assets/vendor/echarts/echarts.min.js"></script>
  <script src="assets/vendor/quill/quill.min.js"></script>
  <script src="assets/vendor/simple-datatables/simple-datatables.js"></script>
  <script src="assets/vendor/tinymce/tinymce.min.js"></script>
  <script src="assets/vendor/php-email-form/validate.js"></script>

  <!-- Template Main JS File -->
  <script src="assets/js/main.js"></script>

</body>

</html>
