<?php 
require('header.php');
$get_deposit = $special->get_alt_transactions($client_id,'Withdrawal');

?>
	<!-- TRACKING ORDER -->
	<section class="py-5" id="">
		<div class="container py-md-3">
			<h4 class="heading text-center text-white"> <span class="fa fa-book"></span> ACCOUNT WITHDRAWAL RECORD</h4>
			<div class="row">
				<div class="col-lg-12 acct-wrapper">
					<table class="table">
						<thead>
							<td>TNX ID</td>
							<td>Amount</td>
							<td>Method</td>
							<td>Wallet</td>
							<td>Status</td>
							<td>Confirmation</td>
							<td>Date</td>
						</thead>
						<?php
						foreach($get_deposit as $xdeposit){
						?>
						<tr><td><?php echo $xdeposit['tnx']; ?></td>
							<td>
							<?php echo $xdeposit['amount']; ?> USD
							</td>
							<td>
							<?php echo $xdeposit['method']; ?>
							</td>
							<td>
							<?php echo $xdeposit['withdraw_id']; ?>
							</td>
							<td>
							<?php echo $xdeposit['status']; ?>
							</td>
							<td>
							<?php 
							if($xdeposit['status'] == 'pending'){
							?><form action="/admin/view_withdrawal.php" method="post">
								<input type="hidden" value="<?php echo $xdeposit['tnx']; ?>" name="id">
								<input type="hidden" value="<?php echo $xdeposit['amount']; ?>" name="amount">
								<input type="hidden" value="<?php echo $xdeposit['type']; ?>" name="type">
								<input type="hidden" value="<?php echo $xdeposit['user_id']; ?>" name="email">
								<button type="submit" name="Action" class="btn btn-sm btn-primary" value="approve" style="font-size:13px;">Approve Withdrawal</button>
								<button type="submit" name="Action" class="btn btn-sm btn-warning" value="deny" style="font-size:13px;">Deny Withdrawal</button>
								</form> 
							<?php }else{	?>						
			<?php echo ($xdeposit['status'] == 'success')?'<span class="badge badge-success" style="font-size:13px;"><i class="fa fa-check"></i> Approved</span>':'<span class="badge badge-danger" style="font-size:13px;"><i class="fa fa-times"></i> Denied</span>'; ?>							
							<?php } ?>
							</td>
							<td><?php echo $xdeposit['created_at']; ?></td>
						</tr>

						<?php } ?>					
					</table>
						
				</div>
			</div>
		</div>
		</div>
	</section>

</body>

</html>