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

  <title>Ncr Marketing X - View Pin</title>
  <meta content="" name="description">
  <meta content="" name="keywords">

  <!-- Favicons -->
  <link href="assets/img/favicon.png" rel="icon">
  <link href="assets/img/apple-touch-icon.png" rel="apple-touch-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">


  <!-- =======================================================
  * Template Name: NiceAdmin - v2.3.1
  * Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
  * Author: BootstrapMade.com
  * License: https://bootstrapmade.com/license/
  ======================================================== -->
</head>

<body>
    
    <?php include 'element/header.php'; ?>
<?php include 'element/sidebar.php'; ?>
     <?php
        include("element/connection.php");
         ?>
    <div class="dashboard-main-wrapper">

       

        <main id="main" class="main">
        
         <div class="pagetitle">
      <h1>Dashboard</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="pin-request.php">Pin Request</a></li>
          <li class="breadcrumb-item active">Epin</li>
        </ol>
      </nav>
    </div>
        
           
    <div class="dashboard-main-wrapper">

	  

	    <div class="dashboard-wrapper">
	        <div class="dashboard-influence">
	            <div class="col-12">
                         <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>Agent ID</th>
                                                 <th>Amt</th>
                                                 <th>Request Date</th>
                                                 <th>Left.</th>
                                                 <th>Right.</th>
                                                 <th>Action</th>
                                                 
                                             </tr>
                                         </thead>
                                         <tbody>
                                           <?php
                                           $a=0;
                                               $data=mysqli_query($conn,"select wit.*, ih.srno from witdrawl wit , income_history ih where wit.user_id=ih.user_id ");
                                               while ($d=mysqli_fetch_array($data)) {
                                                 ?>
                                                 <tr>
                                                   <th><?php echo ++$a; ?></th>
                                                   <th><?php echo $d['user_id'] ?></th>
                                                   <th><?php echo $d['amt'] ?></th>
                                                   <th><?php echo $d['request_date'] ?></th>
                                                     <th><?php echo $d['left_count'] ?></th>
                                                   <th><?php echo $d['right_count'] ?></th>
                                                   <th>
                                                       
                                                     <form class="" action="element/redirect.php" method="post">
                                                 <?php   
                                                     $amt = $d['amt'];
                                                     $perce = 15;
                                                   
                                                   
                                                         ?>            
                                                       
                                          <div class="form-group">
                                              <label for="inputRepeatPassword">Pin count</label>
                                              <input id="inputRepeatPassword" data-parsley-equalto="#inputPassword" name="amount" type="text" placeholder="Enter Amount" class="form-control" oninput="this.value = this.value.toUpperCase()" value="<?php echo $d['amt'] ?>" required >
                                             
                                          </div>
                                                       <input type="text" name="req_ih_id" value="<?php echo $d['srno'] ?>" hidden>
                                                       <input type="text" name="req_id" value="<?php echo $d['id'] ?>" hidden>
                                                       <input type="text" name="req_user_id" value="<?php echo $d['user_id'] ?>" hidden>
                                                       <button type="submit" class="btn btn-sm btn-secondary" name="approve_withdraw">Approve</button>
                                                         
                                                         

                                                       
                                                       <button type="submit" class="btn btn-sm btn-secondary" name="reject_withdraw">Reject</button>
                                                       </form>
                                                   </th>
                                                 </tr>
                                                 <?php
                                               }
                                            ?>

                                         </tbody>
                                     </table>
                                 </div>
                             </div>
                         </div>
                     </div>
                      </div>
                                </div>
                            </div>
                        </div>
                      </div>
<?php
function check_availble_pin($agent_id){
  global $conn;
  $data=mysqli_fetch_array(mysqli_query($conn,"SELECT count(allcote_user) total FROM `pin` WHERE `allcote_user`='$agent_id' AND `status`!='1'"));
  return $data['total'];
}
 ?>
   
    <!-- ============================================================== -->
    <!-- end main wrapper -->
    <!-- ============================================================== -->
    <!-- Optional JavaScript -->
   
        </main>
    </div>
    
    
    
    

  <!-- ======= Footer ======= -->
  <footer id="footer" class="footer">
    <div class="copyright">
      &copy; Copyright <strong><span>Healthy Life Mission</span></strong>. All Rights Reserved
    </div>
    <div class="credits">
      <!-- All the links in the footer should remain intact. -->
      <!-- You can delete the links only if you purchased the pro version. -->
      <!-- Licensing information: https://bootstrapmade.com/license/ -->
      <!-- Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/ -->
      Designed by <a href="https://antiradiationchip.in/">Healthy Life Mission</a>
    </div>
  </footer><!-- End Footer -->

  <a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>

  <!-- Vendor JS Files -->
 <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>