"") { $_SESSION["isLoggedIn"] = true; //$customer_data = getCustomerbyLoginId($_SESSION["userId"]); $customer_data = getCustomerbyLoginId($_SESSION["userId"]); } else { $_SESSION["isLoggedIn"] = false; header("location: login.php"); exit(); } if ($_SESSION["user_type"] != "admin") { header("location: login.php?alert=Only admins allowed here!"); } $products = productList(); $vendorSearchResult = $_SESSION["vendorSearchResult"]; $payoutResponse = getAllPayout($_SESSION["token"]); $payoutData = json_decode($payoutResponse, true); ?> oBanana B2B - Admin Dashboard
No Vendor Found.

'; } // $vendors = vendorList(); for ($x = $start; $x <= $end && $x < $totalVendors; $x++) { $vendor = $vendors[$x]; $vendorId = $vendor['_id']; $totalPayoutAmount = 0; // Initialize the total net amount for the current vendor // Loop through the payout data and sum up the net amounts foreach ($payoutData as $payout) { if ($payout['vendor_details'][0]['vendor_id'] == $vendorId) { $totalPayoutAmount += $payout['net_amount']; } } $totalPayoutAmount = number_format($totalPayoutAmount, 2, '.', ','); ?>