From e30c1453e1d2e0c2279d3082011daed83c2165a1 Mon Sep 17 00:00:00 2001 From: Jun Barroga Date: Fri, 22 Mar 2024 14:18:39 +0800 Subject: [PATCH] admin payout --- admin/config.php | 3 +- admin/user-card.php | 330 +++++++++++++++++++-------------------- admin/vendor-profile.php | 279 +++++++++++++++++---------------- 3 files changed, 312 insertions(+), 300 deletions(-) diff --git a/admin/config.php b/admin/config.php index 2c49fab..d51d6b8 100644 --- a/admin/config.php +++ b/admin/config.php @@ -1,8 +1,9 @@
- - + for ($x = $start; $x <= $end && $x < $totalUsers; $x++) { + $user = $users[$x]; + ?> + + +
- @@ -284,76 +289,115 @@ if (is_array($vendorOrderss)) { + selectedOrders.forEach(order => { + var orderId = order.orderId; + fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json', + "Authorization": "Bearer " + token, + }, + body: JSON.stringify({ + payout_status: { + payout_id: data._id, + status: "Processing" + } + }) + }) + .then(response => { + // if (!response.ok) { + // console.error(`Failed to update payout status for order ${orderId}`); + // } + if (!response.ok) { + console.error(`Failed to update payout status for order ${orderId}`); + } else { + location.reload(); + } + }) + .catch(error => { + console.error(`Error updating payout status for order ${orderId}:`, error); + }); + }); + }) + .catch(error => { + console.error('Error:', error); + }); + } + @@ -417,35 +461,6 @@ if (is_array($vendorOrderss)) { - - ₱2,340 - EastWest - **** **** 1234 - Jon-Jon Manaay - Oct 27, 2018 - - Processing - - - - - -