EVOLUTION-NINJA
Edit File: withdraw_request_approval.php
<?php echo view('includes/headerSidebar'); ?> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/jquery.dataTables.min.css"> <script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script> <style> .mainheading { padding: 8px 17px; box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px; color: #15283C; font-size: 18px; font-weight: 500; } .user_details_main { border-radius: 13px; box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; /* width: 55%; */ padding: 27px; min-height: 301px; background-color: white; } .use_img { width: 140px; height: 126px; /* border: 1px solid; */ border-radius: 50%; overflow: hidden; } .user_deta { /* border: 1px solid; */ } .user_deta>p { margin: 0; margin-bottom: 5px; } .user_deta>p:nth-child(1) { color: #0065A3; font-size: 26px; font-weight: 600; } .user_deta>p:nth-child(2) { color: #33363F; font-size: 19px; font-weight: 600; } .user_deta>p:nth-child(3) { color: #222323; font-size: 16px; font-weight: 600; word-wrap: break-word; white-space: break-spaces; word-break: break-word; } .user_idno { color: #575757 } .user_border { height: 1px; border: 1px solid #B7B4B4; margin-bottom: 15px; } .user_more_inf { margin-bottom: 10px; display: flex; align-items: center; font-size: 16px; font-weight: 500; margin-left: 10px; /* color: #007bff; */ color: #444; } .user_more_inf>span { margin-left: 8px; color: #525252; } .user_de { color: #363636; font-weight: 500; margin: 0; margin-bottom: 8px; margin-left: 4px; font-size: 20px; } .mor_det { color: #212529; font-weight: 500; } /* promoter details */ .prom_det { position: relative; width: 300px; padding: 20px; box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px; margin: auto; margin-bottom: 15px; background-color: white; } .prom_det:hover { scale: 1.1; transition: scale 0.6s ease-in-out; } .prom_icon { width: 63px; position: relative; top: -47px; left: 17px; } .prom_det>.pro_mon { float: right; margin-top: 18px; font-size: 18px; font-weight: 600; color: #345757; } .prom_detail { /* display:grid; grid-template-columns: repeat(5,1fr); */ display: flex; flex-wrap: wrap; flex: 1 0 300px; gap: 22px; margin: auto; } .peo_par { color: #443; font-weight: 600; margin-top: 4px } @media only screen and (max-width:628px) { .user_details_main { width: 100%; padding: 12px; min-height: auto; } } @media only screen and (min-width:629px) and (max-width:1028px) { .user_details_main { width: 100%; min-height: auto; } } </style> <div id="main" class="p-4"> <section> <div class="container"> <h2>Approval Requests</h2> <table id="approvalTable" class="display" style="width:100%"> <thead> <tr> <th>Scheme</th> <th>Partner ID</th> <th>Partner Name</th> <th>Requested Amount</th> <th>Status</th> <th>Requested On</th> <th>Action</th> </tr> </thead> <tbody> <?php if (!empty($requests)): ?> <?php foreach ($requests as $request): ?> <tr> <td><?= $request['scheme_name']; ?></td> <td><?= $request['promoter']; ?></td> <td><?= $request['name']; ?></td> <td><?= $request['amount']; ?></td> <td><?= $request['status']; ?></td> <td><?= $request['created_at']; ?></td> <td> <button class="approve-btn btn-success" data-id="<?= $request['request_id']; ?>">Approve</button> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> </section> <script> $(document).ready(function () { $('#approvalTable').DataTable(); $('.approve-btn, .reject-btn').click(function () { const requestId = $(this).data('id'); $.ajax({ url: "<?php echo base_url('approveWithdrawRequest'); ?>", type: "POST", data: { request_id: requestId}, success: function (response) { alert(response.message); location.reload(); }, error: function () { alert('Error while updating the request.'); } }); }); }); </script> </div> </body> <script> let arrow = document.querySelectorAll(".arrow"); for (var i = 0; i < arrow.length; i++) { arrow[i].addEventListener("click", (e) => { let arrowParent = e.target.parentElement.parentElement; arrowParent.classList.toggle("showMenu"); }); } let sidebar = document.querySelector(".sidebar"); let sidebarBtn = document.querySelector(".bx-menu"); console.log(sidebarBtn); sidebarBtn.addEventListener("click", () => { sidebar.classList.toggle("close"); }); </script> <script> $(document).ready(function () { $('#withdraw').click(function (e) { e.preventDefault(); window.location.href = "<?php echo base_url('withdraw'); ?>"; }); }); </script> </html>