File "requests.php"

Full path: /home/eshuaesb/public_html/www.mhawaterpark.com/admin/requests.php
File size: 0.01 KB (8.69 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php include("auth.php");
                                     function getkyc($uid)
                                        {
                                        include "conn.php";

                                        $sql = "select * from tbl_user where mobile='$uid'";
                                        $smt = mysqli_query($conn, $sql);
                                        $res = mysqli_fetch_assoc($smt);
                                        
                                        return($res['kyc']);
                                        }
                                        function getupi($uid)
                                        {
                                        include "conn.php";

                                        $sql = "select * from tbl_user where mobile='$uid'";
                                        $smt = mysqli_query($conn, $sql);
                                        $res = mysqli_fetch_assoc($smt);
                                        
                                        return($res['upi_id']);
                                        }
                                        function getaccount($uid)
                                        {
                                        include "conn.php";

                                        $sql = "select * from tbl_user where mobile='$uid'";
                                        $smt = mysqli_query($conn, $sql);
                                        $res = mysqli_fetch_assoc($smt);
                                        
                                        return($res['account_no']);
                                        }
                                        function getifsc($uid)
                                        {
                                        include "conn.php";

                                        $sql = "select * from tbl_user where mobile='$uid'";
                                        $smt = mysqli_query($conn, $sql);
                                        $res = mysqli_fetch_assoc($smt);
                                        
                                        return($res['ifsc_code']);
                                        }
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title>Withdrawal Requests</title>
    <meta content="" name="description">
    <meta content="" name="keywords">
    <?php include("templates/inc.php"); ?>
    <script src="scripts/user-wallet.js" type="text/javascript" language="javascript"></script>
    <script>
    // Vanilla JS alternative for hover
    document.addEventListener("DOMContentLoaded", function () {
        const yesSpan = document.getElementById("yes");
        const detailsDiv = document.getElementById("details");

        yesSpan.addEventListener("mouseenter", function () {
            detailsDiv.style.display = "block";
        });

        yesSpan.addEventListener("mouseleave", function () {
            // Optional: wait a little to avoid flicker
            setTimeout(() => {
                detailsDiv.style.display = "none";
            }, 200);
        });

        detailsDiv.addEventListener("mouseenter", function () {
            detailsDiv.style.display = "block";
        });

        detailsDiv.addEventListener("mouseleave", function () {
            detailsDiv.style.display = "none";
        });
    });
</script>
</head>

<body>

    <!-- ======= Header ======= -->
    <?php
    include("templates/header.php");
    ?>

    <!-- End Header -->

    <!-- ======= Sidebar ======= -->
    <?php
    include("templates/sidebar.php");

    ?>
    <!-- End Sidebar-->

    <main id="main" class="main">

        <div class="pagetitle">
            <h1>Withdraw Request List</h1>
            <nav>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
                    <li class="breadcrumb-item">Request List</li>

                </ol>
            </nav>
            <hr>
        </div><!-- End Page Title -->

        <section class="section">
            <!--<a href="user-wallet.php">-->
            <!--    <button type="button" class="btn btn-primary"><i class="bi bi-plus me-1"></i> Add Wallet Amount</button>-->
            <!--</a></br></br>-->

            <section class="section">
                <div class="row">
                    <div class="col-lg-12">

                        <div class="card">
                            <div class="card-body table-responsive" id="records">
                                <h5 class="card-title">Withdrawal List</h5>
                                <!-- Table with stripped rows -->
                                <table class="table datatable table-striped">
                                    <thead>
                                        <tr>
                                            <th scope="col">Sl</th>
                                            <th scope="col">UserName</th>
                                            <th scope="col">Mobile</th>
                                            <th scope="col">Balance</th>
                                            <th scope="col">Account Details</th>
                                            <th scope="col">UPI Details</th>
                                            <th scope="col">Status</th> 
                                            <th scope="col">Action</th>

                                        </tr>
                                    </thead>

                                    <tbody>
                                        <?php
                                        require "conn.php";

                                        $sl = 1;
                                       if(isset($_GET['status']) && $_GET['status']=="pending")
                                         $sql = "select * from tbl_withdraw_request where status='Pending' and deleted_at is NULL order by id desc";
                                         else
                                         $sql = "select * from tbl_withdraw_request where deleted_at is NULL order by id desc";
                                        $rs = mysqli_query($conn, $sql);
                                        while ($row = mysqli_fetch_assoc($rs)) {
                                            echo "<tr>";
                                            echo '<td>' . $sl . '</td>';
                                            echo '<td>' . $row['uname'] . '</td>';
                                            echo '<td>' . $row['uid'] . '</td>';
                                            echo '<td>' . $row['balance'] . '</td>';
                                            if(getkyc($row['uid'])!="0")
                                            {
                                            echo '<td>Account No- ' . getaccount($row['uid']) . '<br>Ifsc- ' . getifsc($row['uid']) . '</td>';
                                            echo '<td>UPI Id- ' . getupi($row['uid']) . '</td>';
                                            }else{
                                            echo '<td>No Details</td>';
                                            echo '<td>No Details</td>';
                                            }
                                            if($row['status']=="Pending")
                                            echo '<td class="text-danger">' . $row['status'] . '</td>';
                                            else
                                            echo '<td class="text-success">' . $row['status'] . '</td>';
                                            if($row['status']=="Pending")
                                            echo '<td><button id=' . $row['id'] . ' class="btn btn-success approve">Approve</button></td>';
                                            else
                                            echo '<td></td>';
                                            echo "</tr>";
                                            $sl++;
                                        }
                                        ?>

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>

            </section>

    </main><!-- End #main -->

    <!-- ======= Footer ======= -->
    <?php
    include("templates/footer.php");
    ?>
    <!-- End Footer -->


    <?php include("templates/vendors.php"); ?>

</body>

</html>