File "withdrawals_details.php"

Full Path: /home/quiczmwg/lightspringdigitals.com/admin-20260114051102/withdrawals_details.php
File size: 7.35 KB
MIME-type: text/x-php
Charset: utf-8

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

<body class="skin-default fixed-layout">
    <div id="main-wrapper">
        <?php 
        include 'sidebar.php';
        if (isset($message)) {
            foreach ($message as $message) {
                echo '<div class="message"><span>' . $message . '</span> <i class="fas fa-times" onclick="this.parentElement.style.display = `none`;"></i> </div>';
            };
        };
        ?>
        
        <div class="page-wrapper">
            <div class="container-fluid">
                <?php include 'nav.php'; ?>
                <div class="container">
                   
                    <!-- DETAILS/DELETE MODAL -->
                    <div class=""> 
                        <?php
                        if(isset($_GET['wid'])) {
                            $wid = $_GET['wid'];
                            $query = "SELECT * FROM withdrawals WHERE wid=?";
                            $stmt = $conn->prepare($query);
                            $stmt->bind_param("s", $wid); // "s" indicates that $wid is a string
                            $stmt->execute();
                            $result = $stmt->get_result();

                            if($result->num_rows > 0) {
                                while ($row = $result->fetch_assoc()) {
                                    // Your code to handle each row goes here
                                    ?>
                                    <div class="card">
                                        <div class="card-header"></div> 
                                        <div class="card-body">
                                            <div class="container row my-4">
                                                <div class="col-md-6 mt-4">
                                                    <div class="container">
                                                        <img src="img/icon1.jpeg" alt="" height="200">
                                                    </div>
                                                </div>
                                                
                                                <div class="col-md-6 mt-2">
                                                    <h1>withdrawal Info:</h1>
                                                    <hr>
                                                    <p><b>Trans ID: <?php echo html_entity_decode($row['wid']); ?></b></p>
                                                    <p><b>User ID:<span> <?php echo $row['userid']; ?></span></b></p> 
                                                    <p><b>Wallet Address: <?php echo html_entity_decode($row['wallet_address']); ?></b></p>
                                                    <p><b>Time: <?php echo html_entity_decode($row['created_at']); ?></b></p>
                                                    <p><b>Amount withdrawn: $<?php echo number_format($row['amount'], 2); ?></b></p>
                                                    <span><a href="#" data-toggle="modal" data-target="#myModalx<?php echo $row['id']; ?>" class="btn btn-info btn-sm">Edit</a></span>
                                <!-- The Modal -->
                                <div class="modal fade" id="myModalx<?php echo $row['id']; ?>">
                                                <div class="modal-dialog">
                                                  <div class="modal-content">
                                                  
                                                    <!-- Modal Header -->
                                                    <div class="modal-header">
                                                      <h4 class="modal-title">Edit Amount</h4>
                                                      <button type="button" class="close" data-dismiss="modal">&times;</button>
                                                    </div>
                                                    
                                                    <!-- Modal body -->
                                                    <div class="modal-body">
                                                      <form action="withdrawals_details_process.php" method="post">

                                                      <div class="form-group">
                                                        
                                                        <input name="amount" type="number" value='<?php echo $row['amount']; ?>' class="form-control my-2" placeholder="Amount" required>
                                                        <input name="id" value='<?php echo $row['id']; ?>' type='hidden'>
                                                        
                                                      </div>
                                                      
                                                      <input name="wid" value='<?php echo $row['wid']; ?>' type='hidden'>
                                    
                                                    </div>
                                                    
                                                    <!-- Modal footer -->
                                                    <div class="modal-footer">
                                                        <button type="submit" name="btnEditAmount"  class="btn btn-success bg-warn">Update</button>
                                                      <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                                                    </div>
                                                    </form>
                                                  </div>
                                                </div>
                                            </div>
                                    <h4><b>withdrawals Status: <?php echo html_entity_decode($row['status']); ?></b></h4>
                                        <?php if ($row['status'] == 'pending') : ?>
                                            <a href="withdrawals-controller.php?id=<?php echo $row['wid']; ?>&status=confirm"
                                            class="btn btn-primary btn-sm my-2">Confirm withdrawals</a>
                                        <?php else : ?>
                                            <span class="btn btn-success btn-sm">withdrawals Confirmed</span>
                                        <?php endif; ?>
                             

                                        <!-- <a href="withdrawals-delete-controller?delete=<//?php echo $row['id']; ?>" class="btn btn-danger" onclick="return confirm('are you sure you want to delete this?');">Delete <i class="bi bi-trash3-fill"></i></a> -->
                            </div>
                            <?php
                                }
                            } else {
                                echo "<p>No withdrawal details found for the provided ID.</p>";
                            }
                        } else {
                            echo "<p>No withdrawal ID provided.</p>";
                        }
                        ?>
                    </div>  
                </div>                            
            </div>





        
        

            
        </div> 
        </div> 
      </div>
    </section>
            </div>
          </div>
        </div>
    <?php
    include 'footer.php';
    ?>