From 5db529f225dc886b8be66ea7f6be999afa8dd168 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 22 Feb 2026 13:52:18 +0000 Subject: [PATCH] Autosave: 20260222-135217 --- admin/areas.php | 17 ++- admin/categories.php | 15 +- admin/customers.php | 12 +- admin/includes/header.php | 5 + admin/loyalty.php | 14 +- admin/orders.php | 17 ++- admin/outlets.php | 12 +- admin/product_variants.php | 90 +++++++++++- admin/products.php | 234 +++++++++++++++++++---------- admin/suppliers.php | 12 +- admin/tables.php | 17 ++- api/order.php | 17 ++- assets/css/custom.css | 91 ++++++++++++ assets/js/main.js | 101 +++++++++++-- includes/functions.php | 149 +++++++++++++++++++ index.php | 293 ++++++++++++++----------------------- pos.php | 268 +++++++++++++++++++++++++++++++++ 17 files changed, 1056 insertions(+), 308 deletions(-) create mode 100644 pos.php diff --git a/admin/areas.php b/admin/areas.php index 688a9e1..20a5b14 100644 --- a/admin/areas.php +++ b/admin/areas.php @@ -16,12 +16,13 @@ if (isset($_GET['delete'])) { } // Fetch areas with outlet names -$areas = $pdo->query(" - SELECT areas.*, outlets.name as outlet_name +$query = "SELECT areas.*, outlets.name as outlet_name FROM areas LEFT JOIN outlets ON areas.outlet_id = outlets.id - ORDER BY areas.id DESC -")->fetchAll(); + ORDER BY areas.id DESC"; + +$areas_pagination = paginate_query($pdo, $query); +$areas = $areas_pagination['data']; // Fetch outlets for dropdown $outlets = $pdo->query("SELECT id, name FROM outlets ORDER BY name ASC")->fetchAll(); @@ -38,6 +39,10 @@ include 'includes/header.php';
+ +
+ +
@@ -68,6 +73,10 @@ include 'includes/header.php';
+ +
+ +
diff --git a/admin/categories.php b/admin/categories.php index 32ccebe..d5a40f4 100644 --- a/admin/categories.php +++ b/admin/categories.php @@ -3,12 +3,15 @@ require_once __DIR__ . '/../db/config.php'; $pdo = db(); if (isset($_GET['delete'])) { - $pdo->prepare("DELETE FROM categories WHERE id = ?")->execute([$_GET['delete']]); + $id = $_GET['delete']; + $pdo->prepare("DELETE FROM categories WHERE id = ?")->execute([$id]); header("Location: categories.php"); exit; } -$categories = $pdo->query("SELECT * FROM categories ORDER BY sort_order ASC, name ASC")->fetchAll(); +$query = "SELECT * FROM categories ORDER BY sort_order ASC, name ASC"; +$categories_pagination = paginate_query($pdo, $query); +$categories = $categories_pagination['data']; include 'includes/header.php'; ?> @@ -22,6 +25,10 @@ include 'includes/header.php';
+ +
+ +
@@ -65,6 +72,10 @@ include 'includes/header.php';
+ +
+ +
diff --git a/admin/customers.php b/admin/customers.php index 3ef17bd..02dabdc 100644 --- a/admin/customers.php +++ b/admin/customers.php @@ -28,7 +28,9 @@ if (isset($_GET['delete'])) { } // Fetch Customers -$customers = $pdo->query("SELECT * FROM customers ORDER BY id DESC")->fetchAll(); +$query = "SELECT * FROM customers ORDER BY id DESC"; +$customers_pagination = paginate_query($pdo, $query); +$customers = $customers_pagination['data']; include 'includes/header.php'; ?> @@ -44,6 +46,10 @@ include 'includes/header.php';
+ +
+ +
@@ -78,6 +84,10 @@ include 'includes/header.php';
+ +
+ +
diff --git a/admin/includes/header.php b/admin/includes/header.php index bde3348..1cc7abe 100644 --- a/admin/includes/header.php +++ b/admin/includes/header.php @@ -90,6 +90,11 @@ function isActive($page) { Dashboard +