%PDF- %PDF-
Direktori : /home/eirtvhdf/payments.hire-va.com/ |
Current File : //home/eirtvhdf/payments.hire-va.com/pendinglinks.php |
<?php include("inc/c.php"); ?> <!DOCTYPE html> <html> <head> <title>Pending Links</title> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php include("inc/css.php"); ?> </head> <body> <!--wrapper--> <div id="divSideMenu" class="wrapper"> <?php include("inc/m.php"); ?> <div class="page-wrapper"> <div class="page-content"> <div class="card"> <div class="card-body"> <div class="d-lg-flex align-items-center mb-4 gap-3"> <div class="position-relative"> </div> <div class="ms-auto"><a href="generatelink.php" id="btnGenerateLink" class="btn btn-primary radius-30 mt-2 mt-lg-0"><i class="bx bxs-plus-square"></i>Generate New Link</a></div> </div> <div class="table-responsive"> <table class="table mb-0" id="tblLinks"> <thead class="table-light"> <tr> <th>ID</th> <th>Customer</th> <th>Order</th> <th>Payments</th> <th>Created On</th> <th>Actions</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> </div> <?php include("inc/f.php"); ?> </div> <!--end wrapper--> <?php include("inc/js.php"); ?> <script> var url = '<?php echo $api_base ?>'; var user = GetUser(); $(function () { GetData(); }); function GetData() { $.ajax({ url: url + "_pendinglinks.php?userId="+user.id , type: 'GET', cache: false, beforeSend: function (b) { console.log(b); }, success: function (data) { console.log(data); if (data.length>0) { BindData(data); } else $("#tblLinks>tbody").remove(); }, error: function (e) { console.log(e); }, complete: function (c) { console.log(c); } }); } function DeleteRecord(id) { if (confirm("Are you sure?")) { $.ajax({ url: url + "_deletelinks.php?userId="+user.id , type: 'POST', data: { linkId: id, updated_by: user.id }, cache: false, success: function (data) { console.log(data); if (data.length>0 && data.indexOf("Error")<0) { GetData(); round_success_noti("Successfully deleted"); } else { round_error_noti("Error: Unable to delete"); } }, error: function (e) { console.log(e); round_error_noti(e.statusText); }, complete: function (c) { console.log(c); } }); } } function BindData(data) { $("#tblLinks>tbody").remove(); var tblBody = document.createElement("tbody"); $.each(data, function (k, d) { var statusClass="text-primary"; if(d.status=="Created") statusClass="text-primary"; else if(d.status=="Paid") statusClass="text-success"; else if(d.status=="Declined") statusClass="text-danger"; var tblRow = tblBody.insertRow(); var cell = tblRow.insertCell(); cell.append(d.id); cell = tblRow.insertCell(); $(cell).append("<b>Name:</b> "+d.cname+"<br/><b>Email:</b> "+d.cemail+"<br/><b>Phone:</b> "+d.cpcode+" "+d.cphone); cell = tblRow.insertCell(); $(cell).append("<b>Item:</b> "+d.item+"<br/><b>Amount:</b> $"+d.amount+"<br/><b>TrID:</b> "+d.transaction_id); cell = tblRow.insertCell(); $(cell).append("<div class="+statusClass+"><b>Status:</b> "+d.status+"<br/><b>On:</b> "+d.status_date+"<br/><b>Desc:</b> "+d.status_desc+"</div>"); cell = tblRow.insertCell(); cell.append(FormatDateTime(d.date)); cell = tblRow.insertCell(); $(cell).append("<a href='<?php echo $url_base; ?>/co.php?id="+d.id+"' class='ms-3' onclick='CopyToCB(this);return false;'><i class='bx bx-link'></i></a><a href='javascript:;' class='ms-3' onclick='DeleteRecord(" + d.id +");'><i class='bx bxs-trash'></i></a>"); }); $("#tblLinks").append(tblBody); } </script> </body>