<!DOCTYPE html>
<html lang="en">
<?php include('include/head.php');
include("loginCheck.php");
include('include/header.php');
include('include/menu.php'); ?>
<div id="main-content">
  <div class="container-fluid">
    <div class="row clearfix">
      <div class="col-lg-12 col-md-12 col-sm-12">
        <div class="card">
          <div class="header">
            <h2>Fund Request</h2>
          </div>
          <div class="body">
            <div class="table-responsive">
              <table class="table table-hover js-basic-example dataTable table-custom mb-0">
                <thead>
                  <tr>
                    <th>#</th>
                    <th>UserId</th>
                    <th>wallet Address</th>
                    <th>Requested Amount</th>
                    <th>Request Date</th>
                    <th>Status</th>
                    <th>Action</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  $count = 0;
                  $queryFund = mysqli_query($con, "SELECT a.*,b.paymentName ,c.user_id,c.walletAddress from meddolic_user_fund_request a, meddolic_config_payment_details b, meddolic_user_details c WHERE a.payment_id=b.payment_id ORDER BY a.date_time DESC");
                  while ($valFund = mysqli_fetch_array($queryFund)) {
                    $count++; ?>
                    <tr>
                      <td><?= $count; ?></td>
                      <td><?= $valFund['user_id']; ?></td>
                      <td><?= $valFund['walletAddress']; ?></td>
                      <td> <?= $valFund['requestFund'] ?></td>
                      <td><i class="fa fa-clock-o"></i> <?= $valFund['date_time']; ?></td>

                      <td><?php if ($valFund['status'] == 1)
                        echo "Approved";
                      else if ($valFund['status'] == 2)
                        echo "Rejected";
                      else if ($valFund['status'] == 0)
                        echo "Pending"; ?></td>
                      <td><a href="fundRequestDetails?RqsID=<?= $valFund['id'] ?>" class="btn btn-success"> More </a></td>
                    </tr>
                  <?php } ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<?php include('include/footer.php'); ?>
<script>
  var d = document.getElementById("transfer");
  d.className += " active";
  var d = document.getElementById("fundRequest");
  d.className += " active";
</script>
</body>

</html>