 <?php include("header.php");
 include("side.php");
 include("../db.php");
 // $id=$_GET['id'];
 extract($_GET);
 if(isset($check)){

 $sql=mysqli_query($conn,"UPDATE `widthdraw` SET `status`='$check' WHERE id='$id'"); 	
 }



 
?>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid">
<h2 class="mt-30 page-title">Widthdraw request</h2>
<ol class="breadcrumb mb-30">
    <li class="breadcrumb-item"><a href="index.php">Dashboard</a></li>
    <li class="breadcrumb-item active">Widthdraw request</li>
</ol>
<div class="row justify-content-between">
	
	
	<div class="col-lg-12 col-md-12">
		<div class="card card-static-2 mb-30">
			<div class="card-title-2">
				<h4>Widthdraw request</h4> 
			</div>
			<div class="card-body-table">
				<div class="table-responsive">
					<table class="table ucp-table table-hover" id="table_id">
						<thead>
							<tr>
								<th style="width:130px">ID</th>
								<th style="width:130px">User ID</th>
								<th>Ammount</th>
								<th style="width:200px">Account No.</th>
								<th style="width:300px">IFSC-code</th>
								
								<th style="width:130px">Status</th>
								<th style="width:100px">Action</th>
								<th style="width:130px">date</th>
							</tr>
						</thead>
						<tbody>
							<?php 
							$sql=mysqli_query($conn,"SELECT * FROM  widthdraw WHERE status='Withdraw'");
							$id='1';
							 while($row=mysqli_fetch_object($sql)) { ?>
							<tr>
								<td><?=$id++;?></td>
								<td>
									<a href="#" target="_blank"><?=$row->user_id;?></a>
								</td>
								<td>
									<span class="delivery-time">&#8377;&nbsp;<?=$row->ammount;?></span>
									
								</td>
								<td><?=$row->Accoun_number;?></td>
								<td><?=$row->IFSC_code;?></td>
								<td>
									
<?php if(isset($row->status)){ 
	echo 'Request';
if($row->status == 'Completed'){ echo '<span class="badge-item badge-status" style="background-color: #78c350!important;">Complete</span>'; }

if($row->status == 'Withdrawqs'){ echo '<span class="badge-item badge-status" style="background-color: #45bbe0;">Request</span>'; }

if($row->status == 'Cancel'){ echo '<span class="badge-item badge-status" style="background-color: #fc544b;">Cancel</span>'; } }

if(empty($row->status)){ echo '<span class="badge-item badge-status" style="background-color: #8892d6;">Pending</span>'; } 
		 ?></span>
								</td>
								
								<td class="action-btns">
									<a href="widthdraw-request.php?id=<?=$row->id;?>&check=Complete" class="views-btn"><span class="badge-item badge-status" style="background-color: #78c350!important;">Complete</span></a>
									<a href="widthdraw-request.php?id=<?=$row->id;?>&check=Cancel" class="edit-btn"><span class="badge-item badge-status" style="background-color: #fc544b;">Cancel</span></a>
								</td>
								<td><?=$row->date;?></td>
							</tr>
						<?php } ?>
							
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
</div>
</main>
              <?php include("footer.php"); ?>