"") { $_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']); $returnStatus = strtolower($val['return_order']['status']); $orderStatus = strtolower($val['status']); $formattedOrderDate = date('m-d-Y', strtotime($val['order_date'])); if ($formattedOrderDate == $currentDate) { $orderCount++; if($paymentStatus == "paid" && (!$returnStatus || $orderStatus != "returned" )){ $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 Current Month's Overall Report

Monthly Users Registry

Purchased by Country

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']); $style = ''; $textColor = ''; $backgroundColor = ''; switch ($orderStatus) { case 'TO SHIP': $backgroundColor = '#8061ef'; $textColor = 'white'; break; case 'TO PAY': $backgroundColor = '#1E6E58'; $textColor = 'white'; break; case 'TO RECEIVE': $backgroundColor = '#FFD700'; $textColor = 'black'; break; case 'COMPLETED': $backgroundColor = '#4c84ff'; $textColor = 'white'; break; case 'RETURNED': $backgroundColor = '#ff7b7b'; $textColor = 'white'; break; default: $backgroundColor = '#464646'; $textColor = 'white'; } $style = "display: flex; height: 15px; font-weight: bold; width: 90px; font-size: 10px !important; padding: 10px; justify-content: center; align-items: center; background-color: $backgroundColor; border-radius: 30px; color: $textColor;"; 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