"") { $_SESSION["isLoggedIn"] = true; //$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!"); } date_default_timezone_set('Asia/Manila'); $currentDate = date('m-d-Y'); $all_orders = getAllOrder(); $all_customers = getAllCustomers(); $all_vendors = getAllVendors(); $allSignups = array_merge($all_customers, $all_vendors); ?> oBanana B2B - Admin Dashboard

Today's Signups

Total Users

$val) { $paymentStatus = strtolower($val['payment']['status']); $formattedOrderDate = date('m-d-Y', strtotime($val['order_date'])); if ($formattedOrderDate == $currentDate) { $orderCount++; if($paymentStatus == "paid"){ $dailyRevenue += $val['total_amount']; } // Increment order count for each order on the current date } } $finalDailyRevenue = number_format($dailyRevenue, 2, '.', ','); ?>

Today's Orders

Today's Revenue

Sales Report

Orders Overview

Download overall report

User Activity

Current Users

Purchased by Country

Backpack 9 33%
T-Shirt 6 150%
Coat 3 50%
Necklace 7 150%
Jeans Pant 10 300%
Shoes 5 100%
T-Shirt 6 150%
Watches 18 160%
Inner 156 120%
T-Shirt 6 150%

Recent Orders

$val) { $paymentStatus = strtolower($val['payment']['status']); $formattedOrderDate = date('m-d-Y', strtotime($val['order_date'])); $paymentMethod = $val['payment_method']; $customerName = $val['customer'][0]['name']; $vendorName = $val['items'][0]['vendor_name']; $totalAmount = $val['total_amount']; $orderStatus = strtoupper($val['status']); $returnStatus = strtoupper($val['return_order']['status']); $statusClass = ''; if ($orderStatus === 'UNPAID' || $orderStatus === 'RETURNED') { $statusClass = '#cb3747'; } elseif ($orderStatus === 'TO PAY') { $statusClass = '#50d7ab'; } elseif ($orderStatus === 'TO SHIP') { $statusClass = '#9586cd'; } elseif ($orderStatus === 'TO RECEIVE') { $statusClass = '#ffc319'; } elseif ($orderStatus === 'COMPLETED') { $statusClass = '#88aaf3'; } if ($formattedOrderDate == $currentDate) { $ordersDisplayed = true; $displayDate = date('m-d-Y, g:i A', strtotime($val['order_date'])); ?> = 8) { break; } } } if (!$ordersDisplayed) { ?>
Payment Method Customer Name Vendor Name Total Amount Order Date Status Return Status
No Recent Orders Yet.

New Customers

From to
$val) { $formattedSignupDate = date('m-d-Y', strtotime($val['createdAt'])); $imageUrl = $val['customer_image']; $fullName = $val['first_name'] . ' ' . $val['last_name']; $email = $val['user_email']; if ($formattedSignupDate >= $weekAgoDate && $formattedSignupDate <= $currentDate) { $customersDisplayed = true; ?> = 8) { break; } } } if (!$customersDisplayed) { ?>
customer image
No new customers in the past week

New Vendors

From to
$val) { $formattedSignupDate = date('m-d-Y', strtotime($val['createdAt'])); $imageUrl = $val['vendor_image']; $shopName = $val['user_login']; $fullName = $val['first_name'] . ' ' . $val['last_name']; $email = $val['user_email']; if ($formattedSignupDate >= $weekAgoDate && $formattedSignupDate <= $currentDate) { $vendorsDisplayed = true; ?> = 8) { break; } } } if (!$vendorsDisplayed) { ?>
customer image
||
No new vendors in the past week