v4.0 Stable Live Documentation

Pakhi Kitchen Documentation

A complete Restaurant ERP — POS billing, table orders, kitchen display, inventory, HR & payroll, finance, and 20+ reports — all in one responsive dashboard.

PHP 8.3 MySQL 8+ Bootstrap 5 PDO Secure Responsive PWA Full POS KDS Ready Multi-Branch

Overview

Pakhi Kitchen is a full-featured Restaurant ERP built for modern food businesses. It covers every aspect of restaurant operations — from customer-facing QR ordering to kitchen management, staff payroll, inventory tracking, and financial reporting.

Built with PHP 8.3 and PDO for secure database access, featuring a clean navy & white themed UI with Bootstrap 5, Font Awesome, and Chart.js.

Key Highlights

  • Full POS with item modal & payment
  • QR-based contactless ordering (PWA)
  • Kitchen Display System (KDS)
  • Order Status Screen (OSS)
  • Multi-branch & multi-tenant support
  • Item variations, addons & extras
  • Inventory with suppliers & purchase orders
  • HR employees, attendance, shifts & payroll
  • Finance — expenses, transactions, P&L
  • Sales, items & credit balance reports
  • JWT-ready auth with brute-force protection
  • Print invoices with token numbers

Features

Point of Sale (POS)

Full POS with category filter, item grid, cart management, item detail modal (variations + addons), payment modal with numpad, and printable invoice.

QR Contactless Ordering

Customer-facing PWA — scan table QR, browse menu, add to cart, choose size/addons, and place order directly from phone.

Kitchen Display System

Real-time KDS showing dine-in and takeaway orders. Chefs mark orders as Preparing → Ready with one click.

Inventory Management

Raw material stock with suppliers, purchase orders, stock movements, wastage log, and recipe mapping to menu items.

HR & Payroll

Employee master, shift scheduling, daily attendance, leave management, and monthly payroll processing.

Finance & Reports

Expense tracking, transaction ledger, Profit & Loss, Sales Report, Items Report, and Credit Balance Report with date filters.

Multi-Branch Support

Switch between branches from the top navbar. Each branch has its own tables, staff, orders, and inventory.

Offers & Promotions

Create promotional offers with percentage or fixed discounts, set validity dates, and apply them at POS checkout.

Invoice Printing

Thermal-style printable receipt with restaurant info, item breakdown, tax, discount, total, payment type, and token number.

System Requirements

ComponentMinimumRecommended
PHP7.48.2+ / 8.3
MySQL5.78.0+ / MariaDB 10.4+
Web ServerApache 2.4 / NginxApache with mod_rewrite + mod_headers
PHP ExtensionsPDO, PDO_MySQL, mbstring, json+ openssl, gd, fileinfo, session
RAM256 MB512 MB+
Disk Space50 MB500 MB+ (for item images & backups)
BrowserChrome 80+, Firefox 75+Latest Chrome / Edge / Safari
Local StackXAMPP / WAMP / LAMPWAMP 3.x / XAMPP 8.x

Installation

1

Copy Files to Web Root

Extract the project folder and copy it to your web server document root.

bash# WAMP (Windows) — recommended Copy folder to: C:\wamp64\www\kiroproduct\pakhikitchen\ # XAMPP (Windows) Copy folder to: C:\xampp\htdocs\kiroproduct\pakhikitchen\ # LAMP (Linux) Copy folder to: /var/www/html/kiroproduct/pakhikitchen/
2

Create the MySQL Database

Open phpMyAdmin (or MySQL CLI) and create the database, then import the schema files in order.

sql-- Step 1: Create database CREATE DATABASE foodscan_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; USE foodscan_db; -- Step 2: Import schema files via phpMyAdmin or CLI -- Import: admin/database/schema.sql -- Import: admin/database/schema_extended.sql -- Import: admin/database/seed_data.sql (optional demo data)
3

Configure Database Connection

Open admin/config/database.php and app/config/database.php — update your MySQL credentials.

phpdefine('DB_HOST', 'localhost'); define('DB_NAME', 'foodscan_db'); define('DB_USER', 'root'); // Your MySQL username define('DB_PASS', ''); // Blank for WAMP default
4

Fix .htaccess for Apache 2.4

The project's .htaccess uses Apache 2.4 syntax. Make sure mod_headers and mod_rewrite are enabled in WAMP.

In WAMP, left-click the tray icon → Apache → Apache Modules → enable headers_module and rewrite_module. Then restart all services.
5

Login & Verify Setup

Navigate to the admin login page and sign in with the default credentials.

urlhttp://localhost/kiroproduct/pakhikitchen/admin/login.php
After login, the dashboard should show charts and stats. If items/orders are empty, import seed_data.sql for demo data. Go to Settings to configure your restaurant name, currency, and tax rate.
6

Customer App (QR Ordering)

The customer-facing PWA runs from the app/ folder with its own API.

urlhttp://localhost/kiroproduct/pakhikitchen/app/
The app uses the same foodscan_db database. Item images are served from admin/uploads/items/. Make sure the uploads directory is writable.

Login Credentials

Security Notice: Change the default password immediately after first login via user avatar → Change Password. These credentials are for development/demo only.

Login Page URL

urlhttp://localhost/kiroproduct/pakhikitchen/admin/login.php

Role-Based Login Tabs

The login page has 4 clickable role tabs that auto-fill the correct email and password. Each role redirects to a different dashboard after login:

#Tab / RoleColourEmailPasswordRedirects ToAccess
1 Admin Blue admin@foodscan.com •••••••• index.php (Dashboard) Full access — all modules, reports, settings, users
2 Branch Manager Teal posoperator@example.com •••••••• index.php (Dashboard) Branch-level access — orders, staff, inventory for own branch
3 POS Operator Purple posoperator@example.com •••••••• pos.php (POS) POS billing, orders, and basic reports only
4 Chef / Kitchen Green chef@example.com •••••••• kds.php (Kitchen Display) KDS only — view orders and update status
All demo passwords are password — stored as bcrypt hash via PHP password_hash().
To reset any account password via MySQL:
UPDATE users SET password='$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi' WHERE email='admin@foodscan.com'; This bcrypt hash = plain text: password

Role-Based Redirect After Login

Admin

Goes to index.php — full dashboard with all modules visible in sidebar.

Branch Manager

Goes to index.php — same dashboard scoped to their assigned branch.

POS Operator

Goes directly to pos.php — the billing interface for quick order entry.

Chef / Kitchen

Goes directly to kds.php — Kitchen Display System for order status management.

Customer App (No login required)

urlhttp://localhost/kiroproduct/pakhikitchen/app/

The customer QR ordering PWA is sessionless — no login needed. Customers scan table QR, browse the menu, add items to cart, and place orders directly from their phone.

Branch Manager Panel (Separate Login)

urlhttp://localhost/kiroproduct/pakhikitchen/branch_manager/login.php

The branch manager has a separate scoped login. Only users with role = 'branch_manager' can access this panel.

EmailPasswordAccess
anwar.bm@foodscan.com••••••••Branch dashboard, orders, staff, tables (scoped to branch)

Admin Recovery (Emergency)

urlhttp://localhost/kiroproduct/pakhikitchen/admin/create_admin.php
Run this URL if you get locked out. It creates/resets the admin account to admin@foodscan.com / password. Delete the file after use.

Database Setup

PakhiKitchen uses MySQL with PDO and prepared statements throughout. All queries are parameterized to prevent SQL injection.

Connection Details

PropertyValue
Database Namefoodscan_db
Character Setutf8mb4
Default Hostlocalhost
Default Userroot
Default Passwordblank (WAMP/XAMPP default)

Schema Files

FileContentsOrder
admin/database/schema.sqlCore tables — users, branches, categories, items, variations, dining tables, customers, orders, transactions, offers, settings, taxes1st
admin/database/schema_extended.sqlExtended tables — multi-tenancy, inventory, suppliers, purchase orders, accounting, HR/payroll, JWT tokens, audit log, RBAC2nd
admin/database/seed_data.sqlDemo data — branches, suppliers, inventory items, HR employees, shifts, customers, expenses, wastage, chart of accountsOptional

Core Tables Reference

TablePurpose
usersAdmin accounts with roles: admin, branch_manager, pos_operator, chef
branchesRestaurant branches with name, phone, address
categoriesMenu categories with image and status
itemsMenu items — price, image, veg/non-veg, featured, description, tax
item_variationsSize/variant options per item with additional price
item_addonsItem-to-item addon relationships
item_extrasExtra add-on options per item
dining_tablesRestaurant tables with name, size, branch, status
customersCustomer records with name, email, phone, status
ordersOrders — type, token, discount, tax, total, status pipeline
order_itemsLine items per order with variation, price, addons JSON
transactionsPayment records per order — method, amount, status
offersPromotional offers with discount type, value, validity dates
settingsKey-value store for app config (currency, tax rate, company info)
tenantsMulti-tenant setup — each tenant = one restaurant group
inventory_itemsRaw material/ingredient stock with supplier, quantity, min stock
suppliersVendor/supplier master with contact info
purchase_ordersPO management — draft, ordered, received, partial, cancelled
hr_employeesStaff records — department, designation, salary, bank details
attendanceDaily attendance — check-in, check-out, status, hours worked
payrollMonthly payroll — basic, overtime, bonus, deductions, net salary
expensesBusiness expenses by category, amount, date, payment method
api_tokensJWT refresh tokens for API auth
login_attemptsBrute-force protection — tracks failed attempts per email
audit_logAction audit trail — who did what, when, old & new values

Configuration Files

admin/config/database.php

phpdefine('DB_HOST', 'localhost'); define('DB_NAME', 'foodscan_db'); define('DB_USER', 'root'); define('DB_PASS', ''); // PDO connection with error mode exception $pdo = new PDO("mysql:host=localhost;dbname=foodscan_db;charset=utf8mb4", 'root', ''); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);

admin/config/auth.php — Security Constants

phpdefine('MAX_LOGIN_ATTEMPTS', 5); // Lockout after 5 failed attempts define('LOCKOUT_DURATION', 900); // 15 minutes define('SESSION_LIFETIME', 3600); // 1 hour define('JWT_SECRET', 'your-secret-key'); // Change in production define('JWT_EXPIRY', 3600); // 1 hour define('PASSWORD_MIN_LENGTH', 8);
Production tip: Change JWT_SECRET to a long random string (64+ chars) before deploying. Never commit real credentials to version control.

Folder Structure

treepakhikitchen/ ├── admin/ # Admin panel (PHP backend) │ ├── api/ # JSON API endpoints │ │ ├── auth_api.php # JWT auth operations │ │ ├── items_api.php # Item CRUD + variations │ │ ├── orders_api.php # Order create & status │ │ ├── customers_api.php # Customer CRUD │ │ ├── inventory_api.php # Inventory CRUD │ │ ├── offers_api.php # Offers CRUD │ │ └── tables_api.php # Dining tables CRUD │ ├── assets/ │ │ ├── css/style.css # Full admin stylesheet │ │ └── js/app.js # Shared JS utilities │ ├── config/ │ │ ├── auth.php # JWT, Security, RBAC classes │ │ ├── database.php # PDO connection + helpers │ │ └── error_handler.php # Global error & exception handler │ ├── database/ │ │ ├── schema.sql # Core DB schema │ │ ├── schema_extended.sql # Enterprise modules │ │ └── seed_data.sql # Demo data │ ├── includes/ │ │ ├── header.php # HTML head + auth check │ │ ├── sidebar.php # Sidebar + top navbar with dropdowns │ │ └── footer.php # JS includes + dropdown logic │ ├── settings_sections/ # 20 settings tab partials │ ├── uploads/ # Item/category/avatar images │ ├── index.php # Dashboard │ ├── login.php # Login (split-panel UI) │ ├── logout.php # Session destroy │ ├── pos.php # Full POS interface │ ├── orders.php # POS orders list │ ├── table_orders.php # Dine-in table orders │ ├── kds.php # Kitchen Display System │ ├── oss.php # Order Status Screen │ ├── items.php # Menu items CRUD │ ├── item_view.php # Item detail (tabs: info/images/variations/addons) │ ├── dining_tables.php # Tables management │ ├── customers.php # Customer management │ ├── offers.php # Promo offers │ ├── inventory.php # Stock items │ ├── suppliers.php # Supplier master │ ├── hr_employees.php # HR staff records │ ├── attendance.php # Daily attendance │ ├── payroll.php # Payroll processing │ ├── finance.php # Expense management │ ├── transactions.php # Payment transactions │ ├── sales_report.php # Sales analytics │ └── settings.php # App settings (20 sections) ├── app/ # Customer PWA (QR ordering) │ ├── api.php # Stateless JSON API (7 actions) │ ├── index.php # Menu browse + cart │ ├── checkout.php # Order checkout │ ├── bill.php # Receipt/bill view │ ├── manifest.json # PWA manifest │ ├── assets/css/style.css # Mobile-first styles │ └── assets/js/app.js # Cart + API logic ├── assets/ # Landing page assets ├── branch_manager/ # Branch manager panel ├── index.php # Root redirect → admin/login.php ├── .htaccess # Apache 2.4 rules + security headers └── documentation.html # This file

Login Page

http://localhost/kiroproduct/pakhikitchen/admin/login.php

The login page uses a split-panel layout — form on the left, dark feature showcase on the right. The left panel has 4 role tabs that auto-fill the correct credentials and redirect to the right dashboard after login.

Role Tabs

Admin Blue Tab

Email: admin@foodscan.com / Pass: password
→ Redirects to full Dashboard

Branch Manager Teal Tab

Uses POS operator email / Pass: password
→ Redirects to Dashboard

POS Operator Purple Tab

Email: posoperator@example.com / Pass: password
→ Redirects directly to POS

Chef / Kitchen Green Tab

Email: chef@example.com / Pass: password
→ Redirects directly to KDS

Other Features

Split Layout

Left panel: role tabs + login form. Right panel: dark gradient with 8 feature cards + stats.

Brute-Force Protection

Locks out after 5 failed attempts for 15 minutes. Records each attempt in login_attempts table.

Password Toggle

Eye icon shows/hides password. Tabs auto-fill email & password — just click a tab and hit Sign In.

Role Redirect

Each role is sent to the most relevant page: Admin/Manager → Dashboard, POS → POS page, Chef → KDS.

Dashboard

http://localhost/kiroproduct/pakhikitchen/admin/index.php

Real-time overview of restaurant performance. All figures show current month data by default.

4 Stat Cards

Total Sales (pink), Total Orders (blue), Total Customers (orange), Total Menu Items (purple) — current month figures.

Sales Summary Chart

30-day pink line chart showing daily revenue trend with total sales and avg sales/day summary.

Order Stats Chart

Blue bar chart showing hourly order volume for today — helps identify peak hours.

Featured Items Grid

4-column grid showing items marked as featured with images. Set items as featured from Items → Edit.

Most Popular Items

Top 6 items by order count with category label and price — right side of dashboard.

Reminder Banner

Top-of-page info banner for system notices. Can be customized in admin/index.php.

Top Navbar Dropdowns (all pages)

DropdownContentsTrigger
Branch SelectorRadio list of all active branches — click to switch branch contextClick branch pill (left side)
LanguageEnglish 🇬🇧 / Bangla 🇧🇩 / German 🇩🇪 / Arabic 🇸🇦 with flag iconsClick red language button
User ProfileAvatar, name, email, balance, Edit Profile / Change Password / Logout linksClick avatar + name (right side)

POS (Point of Sale)

http://localhost/kiroproduct/pakhikitchen/admin/pos.php

The core billing interface. Full-screen split layout — item grid left, cart panel right.

POS Components

ComponentDescription
Search BarDebounced search to filter items by name in real time
Category ScrollHorizontal scrollable category bar with images — click to filter items
Item GridAuto-fill grid of item cards with image, name, price, and quick Add button
Customer SelectDropdown to select registered customer or Walking Customer
Token NoManual token number input for kitchen reference
Order Type ToggleDine-In / Takeaway radio toggle — Dine-In shows table selector
Cart ItemsLive cart with item name, size, qty stepper (±), price, and remove button
Discount RowPercentage or Fixed discount input with Apply button
Cart SummarySub Total / Discount / Total footer
Cancel / OrderCancel clears cart; Order opens Payment Modal

Item Detail Modal

Click any item card to open the full detail modal:

Quantity Stepper

− / + buttons to set quantity before adding to cart. Minimum 1.

Size / Variations

Radio-style size options (Regular, Big etc.) with additional price shown. First option pre-selected.

Addons

Horizontal scrollable addon cards with individual qty controls and price. Total auto-updates on cart button.

Special Instructions

Free-text textarea for kitchen notes (extra mayo, no onions etc.)

Payment Modal

Payment Methods

Cash / Card / MFS / Other — selected method highlights with blue border.

Numpad

On-screen numpad: 1–9, 00, 0, decimal, backspace, clear — for fast cash amount entry.

Confirm & Print

Creates order in DB, clears cart, opens invoice modal with receipt. Change amount auto-calculated.

Invoice Receipt

Thermal-style receipt with restaurant info, items, VAT, totals, payment type, and Token #. One-click print.

Orders

PageURLDescription
POS Ordersadmin/orders.phpAll orders with filter by ID, status, customer, date. Status labels: Accept / Prepared / Delivered.
Table Ordersadmin/table_orders.phpDine-in orders filtered by order_type = dine_in. Same filter interface.
Order Viewadmin/order_view.php?id=XFull order detail — items, payment info, delivery info, status update dropdown.

Order Status Pipeline

StatusColorLabel ShownMeaning
pendingOrangeAcceptNew order — waiting for kitchen acknowledgement
preparingBluePreparingKitchen is preparing the order
readyTealReadyOrder is ready for pickup or serving
servedGreenServedDelivered to the table/customer
completedGreenDeliveredFully completed and paid
cancelledRedCancelledOrder was cancelled

Items & Menu

http://localhost/kiroproduct/pakhikitchen/admin/items.php
TabURLDescription
Informationitem_view.php?id=X&tab=informationName, price, category, item type (veg/non-veg), featured status, caution, description
Imagesitem_view.php?id=X&tab=imagesMultiple gallery images per item. Upload new images (stored in uploads/items/)
Variationitem_view.php?id=X&tab=variationAdd size/variant options with additional price (e.g., Regular +$0, Large +$2)
Extraitem_view.php?id=X&tab=extraExtra chargeable options (e.g., Extra Cheese +$0.50)
Addonitem_view.php?id=X&tab=addonLink related items as addons shown in POS item modal
Item images should be 262×182px or similar landscape ratio. They're displayed in the POS grid, item modal, and customer app. Supported formats: JPG, PNG, WebP, GIF.

Dining Tables

http://localhost/kiroproduct/pakhikitchen/admin/dining_tables.php

Manage restaurant tables. Each table has a name, seating size, branch, and status. Tables are selectable in POS for dine-in orders.

From dining_table_view.php?id=X, generate a QR code for each table. Customers scan the QR with their phone to open the self-ordering PWA pre-loaded with that table's context.

Customers

http://localhost/kiroproduct/pakhikitchen/admin/customers.php

Manage registered customer profiles. Customers can be selected at POS checkout instead of "Walking Customer" for loyalty tracking and order history.

Demo Customers (from seed_data.sql)

NameEmailPhone
Arif Rahmanarif@example.com+880181000001
Fatema Akterfatema@example.com+880181000002
Sajid Hasansajid@example.com+880181000003
Nusrat Jahannusrat@example.com+880181000004
Tanvir Islamtanvir@example.com+880181000005

Inventory Management

Stock Items

Raw materials & ingredients with SKU, unit (kg/ltr/pcs), quantity, min stock level, and cost price. admin/inventory.php

Suppliers

Vendor master with company name, contact, email. Linked to inventory items. admin/suppliers.php

Purchase Orders

Create POs to suppliers — draft, ordered, received, partial, cancelled. admin/purchase_orders.php

Wastage Log

Record ingredient wastage with reason (expired/damaged/spilled) and cost impact. admin/wastage.php

Pre-loaded Inventory Items (seed data)

SKUItemUnitQtyMin Stock
INV-001Chicken Breastkg25.510
INV-002Beef Mincekg15.08
INV-003Rice (Basmati)kg50.020
INV-013Coca Cola (Can)pcs10030
INV-015Fish (Hilsa)kg3.05

HR & Payroll

HR Employees

Staff records — department (kitchen/service/management/delivery/cleaning), designation, salary, bank details. admin/hr_employees.php

Attendance

Daily check-in/check-out, status (present/absent/late/half-day/leave), hours worked. admin/attendance.php

Shifts

Define Morning (6–14), Afternoon (14–22), Night (22–6), Split shifts. Assign to employees. admin/shifts.php

Leaves

Leave requests by type (sick/casual/annual/unpaid/maternity) — pending/approved/rejected workflow. admin/leaves.php

Payroll

Monthly payroll — basic salary, overtime, bonus, deductions, net salary. Payment via cash/bank/card. admin/payroll.php

Employees (General)

All staff list (waiters, chefs, general employees) with basic role info. admin/employees.php

Demo Employees (seed data)

CodeNameDeptRoleSalary
EMP-0001Kamal HossainKitchenHead Chef৳45,000/mo
EMP-0002Rafiq AhmedKitchenSous Chef৳35,000/mo
EMP-0003Nasrin AkterServiceHead Waiter৳25,000/mo
EMP-0008Anwar HossainManagementBranch Manager৳55,000/mo

Finance

Expenses

Business expense tracking by category (rent/utilities/salary/supplies/maintenance/marketing). admin/finance.php

Transactions

All payment transactions linked to orders — cash, card, MFS, other. admin/transactions.php

Profit & Loss

P&L report comparing revenue vs expenses for the selected period. admin/profit_loss.php

Chart of Accounts

15 pre-loaded accounts — Cash, Bank, AR, AP, Sales Revenue, COGS, Salary, Rent, Utilities, Marketing.

Reports

ReportURLDescription
Sales Reportadmin/sales_report.phpAll completed orders with total earnings, discount, and payment type. Filter by payment method.
Items Reportadmin/items_report.phpItem-wise sales breakdown — quantity sold, revenue per item.
Credit Balanceadmin/credit_balance_report.phpCustomer credit balance and outstanding amounts.
Profit & Lossadmin/profit_loss.phpRevenue vs Expense comparison with net profit.

Settings

http://localhost/kiroproduct/pakhikitchen/admin/settings.php

20 settings sections accessible from the left sidebar within the settings page. All settings stored in the settings table as key-value pairs.

Company

Restaurant name, address, phone, email, GSTIN — shown on printed invoices.

Site Settings

Site name, currency symbol, timezone, default language.

Taxes

Configure VAT/GST rate applied to all orders. Default: 0%. Shown on invoice as "VAT (X%)".

Print Settings

Invoice header/footer text, logo, terms, thermal or A4 print size.

Branches

Add/edit restaurant branches. Each branch gets its own tables and staff assignments.

Currencies

Set primary currency symbol and decimal display format.

KDS & Order Status Screen

ScreenURLPurpose
KDS (Kitchen Display)admin/kds.phpShows active dine-in and takeaway orders grouped by status. Chef clicks expand → Start Preparing → Mark Ready.
OSS (Order Status)admin/oss.phpCustomer-facing status board. Left panel: popular menu items. Right panels: Preparing (blue) and Ready (green) orders. Staff marks Ready → Served.
Mount KDS on a tablet in the kitchen. Mount OSS on a TV screen in the dining area. Both auto-refresh via page reload or can be enhanced with WebSocket/polling.

API Reference

Admin API Endpoints (admin/api/)

FileAction (GET ?action=)MethodDescription
items_api.phpgetGETSingle item with variations & addons — ?action=get&id=X
items_api.phpcreate / updatePOSTCreate or update item (supports file upload for image)
items_api.phpdeletePOSTDelete item by id
items_api.phpadd_variationPOSTAdd size variant with additional price to item
items_api.phpadd_addonPOSTLink another item as an addon to this item
orders_api.phpcreate_orderPOSTCreate order + line items + transaction. Returns order_number + cartSnapshot
orders_api.phpupdate_statusPOSTUpdate order status (pending/preparing/ready/completed/cancelled)
orders_api.phpget_orderGETFull order with items by id
customers_api.phpcreatePOSTAdd customer, returns id + name
customers_api.phpupdate / deletePOSTUpdate or delete customer
tables_api.phpcreate / update / deletePOSTDining table CRUD
offers_api.phpcreate / deletePOSTPromo offer CRUD
inventory_api.phpcreate / update / deletePOSTStock item CRUD

Customer App API (app/api.php)

ActionMethodDescriptionReturns
get_categoriesGETAll active menu categoriesid, name, image
get_itemsGETItems filtered by category_id, item_type, searchitems with category_name
get_itemGETSingle item with variations + addons — ?action=get_item&id=Xitem + variations[] + addons[]
get_tablesGETActive dining tables for checkout table selectid, name
place_orderPOST (JSON body)Create order from customer app — table_id, payment_method, items[]success, order_number, order_id
get_billGETFull order receipt with items and restaurant info — ?order_number=XXXorder + items + restaurant settings
track_orderGETCheck order status by order numberstatus, total, order_type

Example: Create Order (POST)

json// POST admin/api/orders_api.php { "action": "create_order", "customer_id": 1, "order_type": "dine_in", "table_id": 2, "token_no": "43", "discount": 5, "discount_type": "percentage", "payment_method": "cash", "received_amount": 10.00, "items": "[{\"item_id\":1,\"name\":\"Fried Cheese Wonton\",\"price\":2.00,\"quantity\":1,\"variation_id\":3,\"variation_name\":\"Regular\"}]" } // Response { "success": true, "order_id": 15072614, "order_number": "#15072614", "cartSnapshot": [ /* cart items array */ ] }

Troubleshooting

ProblemLikely CauseFix
Internal Server Error on /pakhikitchen/.htaccess uses Apache 2.2 Order/Deny syntaxUpdated to Apache 2.4 Require all denied — already fixed in current version
Login fails with correct passwordAdmin user not in DB or wrong hashRun SQL: UPDATE users SET password='$2y$10$92IX...' WHERE email='admin@foodscan.com';
POS item modal shows "Failed to load"items_api.php not returning variationsEnsure item_variations table exists (schema_extended.sql). Check api/items_api.php get action.
Dashboard charts blankChart.js CDN not loadingCheck internet connection. Or download Chart.js 4.4 and host locally in assets/js/.
PDO connection failedWrong DB credentialsEdit admin/config/database.php — verify DB_HOST, DB_NAME, DB_USER, DB_PASS.
Images not showinguploads/ folder missingCreate admin/uploads/items/, categories/, avatars/ and ensure Apache has write permission.
Header not found / mod_headers errormod_headers disabled in WAMPWAMP tray → Apache Modules → enable headers_module → Restart All.
Page redirects to login after switching branchSession not persisting branch changeBranch switch is client-side only — page refresh resets to session branch. Full branch-switch requires server-side session update.
"No items in cart" after adding itemsJavaScript error in cart stateOpen browser console (F12) and check for errors. Ensure Bootstrap 5.3 and jQuery 3.7 are loading from CDN.
Invoice printing blankPopup blocked by browserAllow popups for localhost in browser settings. Print uses window.open().

Changelog

VersionDateChanges
v4.1Jul 2026Login page role tabs (Admin/Branch Manager/POS Operator/Chef) with auto-fill credentials and role-based redirect. Updated documentation with all credentials and tab details.
v4.0Jul 2026Complete UI overhaul — new split login, FoodScan branding, top navbar with branch/language/user dropdowns (single open at a time), pink/blue dashboard charts, full POS rewrite with item modal + payment numpad + thermal invoice, all 40+ pages updated to new layout, 46.9 KB complete stylesheet
v3.xJun 2026Enterprise modules — multi-tenancy, inventory, HR/payroll, JWT auth, audit log, RBAC (schema_extended.sql)
v2.xMay 2026Extended schema — suppliers, purchase orders, HR employees, shifts, attendance, leaves, payroll, expenses
v1.0Apr 2026Initial release — core POS, items, orders, dining tables, customers, offers, basic reports
Setup complete! Visit admin/login.php to log in. Click any role tab (Admin / Branch Manager / POS Operator / Chef) to auto-fill credentials, then click Sign in.