<?php
	session_start();
	if($_SESSION['unohs'] == null){
		header("location:index.php?msg=unauthorized");
	}
?>
<?php
	include ("conn.php");
?>

<?php include 'header.php'; ?>

      <div class="main-panel">
        <div class="content-wrapper">
          <div class="row">
            <div class="col-sm-12 mb-4 mb-xl-0">
              <h4 class="font-weight-bold text-dark">Withdraw Accept List</h4>
            </div>
          </div> 		  		  		  			
		  <div class="row">
            <div class="col-sm-12">
				<form id="formID" name="formID" method="post" action="#" enctype="multipart/form-data">
					<table id="example1" class="table table-bordered table-striped">
						<thead>
							<tr>
								<th>Sr.No</th>
								<th>User Mobile</th>
                              	<th>User ID</th>
								<th>Amount</th>
                              	<th>Order ID</th>
								<th>Payout Type</th>
								<th>Req. Date</th>
							</tr>
						</thead>
						<tbody>
						<?php
$Query = mysqli_query($conn, "SELECT *, 
    (SELECT `mobile` FROM `shonu_subjects` WHERE `id`=`hintegedukolli`.`balakedara`) AS user,
    (SELECT `id` FROM `shonu_subjects` WHERE `id`=`hintegedukolli`.`balakedara`) AS subject_id
FROM `hintegedukolli` 
WHERE `sthiti`='1' 
ORDER BY `shonu` DESC");

$i = 0;
$total = 0; 
while ($row = mysqli_fetch_array($Query)) {
    $i++;
    $total += $row['motta'];
?>  
    <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo $row["user"]; ?></td>
        <td><?php echo $row["subject_id"]; ?></td>
        <td><?php echo number_format($row['motta'], 2); ?></td>
      	<td><?php echo $row["dharavahi"]; ?></td>
        <td><?php echo 'bank'; ?></td>
        <td><?php echo date('d-m-Y', strtotime($row['dinankavannuracisi'])); ?></td>                                    
    </tr>
<?php 
}
?>

					   
						</tbody>
					</table>
				</form>			  			  
            </div>			
          </div>		  
		</div>
	<!--		<footer class="footer">
			<div class="d-sm-flex justify-content-center justify-content-sm-between">
				<span class="text-muted d-block text-center text-sm-left d-sm-inline-block">Copyright © 51gameplay.online 2024</span>
			</div>
		</footer>-->
      </div>     
    </div>
  </div>  
  <script>
	$(function () {
		$('#example1').DataTable({
		  "paging": true,
		  "lengthChange": false,
		  "searching": true,
		  "ordering": false,
		  "info": true,
		  "autoWidth": true,
		  "pageLength": 100
		});
	});
  </script>
</body>

</html>