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j '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u423589436/domains/stratagemportfolios.com/public_html/uadmin/withdraw.php

<?php 
include 'header.php';
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);

$msg = "";
$err = "";


if (isset($_GET['app'])) {
    $tid = $_GET['app'];

    // Fetch transaction details
    $sq = mysqli_query($link, "SELECT * FROM withdrawals  WHERE id = '$tid'");
    if (mysqli_num_rows($sq) > 0) {
        $rw = mysqli_fetch_assoc($sq);
        $userId = $rw['user_id'];
        $amount = $rw['amount'];  // Amount in USD
        $status = $rw['status'];
        $date = $rw['date'];
    }

    $querys = mysqli_query($link, "SELECT * FROM users WHERE id = '$userId'");
    if (mysqli_num_rows($querys) > 0) {
        $rowss = mysqli_fetch_assoc($querys); 
        $username = $rowss['first_name'].' '.$rowss['last_name'];
        $email = $rowss['email'];
    }

    if (isset($status) && $status == "completed") {
        $msg = "This transaction has been Approved already";
    } else {
        $query = mysqli_query($link, "UPDATE withdrawals SET status = 'completed' WHERE id = '$tid'");

     
            if ($query) {
            $subject = "Transaction Approved at {$sitename}!";
            $body = "
            <div style='background: #E4E9F0; padding: 20px; font-family: Arial, sans-serif;'>
                <div style='max-width: 600px; margin: 0 auto; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);'>
                    <!-- Header -->
                    <div style='background-color: #1e293b; padding: 16px; display: flex; align-items: center;'>
                        <div style='display: flex; align-items: center;'>
                            <center><img src='$siteurl/images/emaillogo.png' width='100px' style='margin-right: 8px;'></center>
                        </div>
                    </div>
            
                    <!-- Main Content -->
                    <div style='padding: 32px; text-align: center;'>
                        <h1 style='font-size: 28px; color: #1e293b; margin-bottom: 24px; line-height: 1.2;'>
                            Your Recent Transaction Has Been Approved!
                        </h1>
            
                        <p style='font-size: 18px; color: #4b5563; margin-bottom: 32px;'>
                            Hi, <b>$username</b>, your recent transaction has been approved successfully.
                        </p>
            
                        <p style='font-size: 18px; color: #4b5563; margin-bottom: 24px;'>
                            Thanks for choosing $sitename!
                        </p>
            
                        <!-- Support Section -->
                        <div style='margin-top: 32px; border-top: 1px solid #e5e7eb; padding-top: 24px; text-align: left;'>
                            <p style='color: #4b5563; margin-bottom: 8px;'>If you have any questions, feel free to reach out to us at $sitemail.</p>
                            <p style='color: #4b5563; margin-bottom: 8px;'>Thanks,</p>
                            <p style='color: #4b5563; font-weight: bold;'>Support Team, $sitename</p>
                        </div>
            
                        <!-- Footnotes -->
                        <div style='margin-top: 32px; font-size: 12px; color: #6b7280; text-align: left;'>
                            <p style='margin-bottom: 4px;'>Please consider all emails from us as confidential.</p>
                        </div>
                    </div>
                </div>
            </div>";
           $send =  sendMail($email, $subject, $body);
           
           
        if (!$send) {
            echo "<script>alert('Transaction approved, but mail not sent');window.location.href = 'withdraw.php'</script>";
        } else {
            echo "<script>alert('Transaction approved successfully');window.location.href = 'withdraw.php'</script>";
        }

            }       
    }
}



if (isset($_GET['del'])) {
    $tid = $_GET['del'];
    $del = mysqli_query($link, "DELETE FROM withdrawals  WHERE id = '$tid'");
    if ($del) {
        echo "<script>alert('Transaction deleted successfully');window.location.href = 'withdraw.php'</script>";
    } else {
        echo "Error deleting transaction: " . mysqli_error($link);
    }
}

?>


<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css">
  
  

  <link rel="stylesheet" href=" https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href=" https://cdn.datatables.net/1.10.19/css/dataTables.jqueryui.min.css">
  <link rel="stylesheet" href=" https://cdn.datatables.net/buttons/1.5.6/css/buttons.jqueryui.min.css">



  

  <link rel="stylesheet" href=" https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap.min.css">
  <link rel="stylesheet" href=" https://cdn.datatables.net/buttons/1.5.6/css/buttons.bootstrap.min.css">
  <link rel="stylesheet" href="">
 
  

  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script>
 

  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/dataTables.jqueryui.min.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>

  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.jqueryui.min.js"></script>
   
  <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js"></script>
  <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.colVis.min.js"></script>
<style>
.table-responsive {
overflow-x: hidden;
}
@media (max-width: 8000px) {
.table-responsive {
overflow-x: auto;
}
</style>
<div class="page-content">
    <div class="container-fluid">
<?php 
    if ($msg != "") {
        echo "<div style='padding:20px;background-color:#dce8f7;color:black'> $msg</div class='btn btn-success'>" ."</br></br>"; 
    }
    if ($err != "") {
        echo customAlert("error", $err);
    }

 ?>
			<div class="row">
			    <div class="col-lg-12">
			        <div class="card">
			            <div class="card-header">
			                <h4 class="card-title mb-0">All Pending Withdrawal</h4>
			            </div><!-- end card header -->

			            <div class="card-body">
			                <div id="customerList">
			                    

			                    <div class="table-responsive table-card mt-3 mb-1">
			                    	<table id="myTable" class="table-responsive" >  
								        <thead class="table-light">
			                                <tr class="info">
			                                  
												<th>Name</th>
												<th>Email</th>
												<th>Amount(USD)</th>
												<th>Method</th>
											
												<th>Address</th>
												<th>Status</th>
												<th>Date</th>
						                        <th>Action</th>						                        
						                        <th>Action</th>
								
											</tr>
			                            </thead>
								        <tbody>
									<?php 
									$sql= "SELECT * FROM withdrawals  WHERE status = 'pending'  ORDER BY id DESC ";
									  $result = mysqli_query($link,$sql);
									  if(mysqli_num_rows($result) > 0){
										  while($row = mysqli_fetch_assoc($result)){   
										  	$userId = $row['user_id'];
										  	$user = mysqli_query($link, "SELECT * FROM users WHERE id = '$userId' ");
											$user_r = mysqli_fetch_assoc($user);
				  						?>
				  		
						<tr class="primary">
						<form method="post">
                            <input type="hidden" name="name" value="<?php echo $row['fullname'] ?>">
							<input type="hidden" name="email" value="<?php echo $user_r['email'] ?>">
                        	<input type="hidden" name="deposit_id" value="<?php echo $row['id'] ?>">
                        	<input type="hidden" name="status" value="<?php echo $row['status'] ?>">
                        	<input type="hidden" name="amount" value="<?php echo $row['amount'] ?>">
                        	
                        	
                        	<input type="hidden" name="userId" value="<?php echo $row['user_id'] ?>">
                        	
                        	
                        
							<td><?php echo $user_r['first_name']." ".$user_r['last_name'] ?></td>
							<td><?php echo $user_r['email'] ?></td>
							<td>$<?php echo $row['amount'] ?></td>
							<td><?php echo $row['crypto_method'] ?></td>
						
							<td><?php echo $row['wallet_address'] ?></td>
							<td><?php echo $row['status'] ?></td>
							<td><?php echo $row['created_at'] ?></td>
							
                            <td>
                            
                            <a onclick="return confirm('Carry out action')" href="?app=<?php echo $row['id']; ?>" class="btn btn-success">Approve</a>
                            </td>

							<td><a href="?del=<?php echo $row['id']; ?>" class="btn btn-danger">Delete</a></td>
							
   
						</form>
						</tr>
						
					  <?php
 }
			  }
			  ?>
					</tbody>

								      </table>  

			                        
			                    </div>


			                </div>
			            </div><!-- end card -->
			        </div>
			        <!-- end col -->
			    </div>
			    <!-- end col -->
			</div>
			<!-- end row -->


	</div>
</div>
<script>
$(document).ready(function(){
    $('#myTable').dataTable();
});
</script>

<?php include 'footer.php'; ?>
Back to Directory=ceiIENDB`