# Mikhmon Billing System - File Structure

## Core Modules (included by index.php)
- `customers_module.php` - Customer management main page
- `invoices_module.php` - Invoice management main page  
- `whatsapp_logs_module.php` - WhatsApp integration logs

## Separate Action Pages
- `addcustomer.php` - Add new customer form
- `editcustomer.php` - Edit customer form
- `deletecustomer.php` - Delete customer confirmation
- `addinvoice.php` - Create new invoice form
- `recordpayment.php` - Record payment form
- `viewinvoice.php` - View invoice details
- `sendtestmessage.php` - Send test WhatsApp message
- `clearwhatsapplogs.php` - Clear WhatsApp logs confirmation

## Data Storage
- `data/` - Directory containing JSON data files
  - `customers.json` - Customer data
  - `invoices.json` - Invoice data
  - `payments.json` - Payment records
  - `whatsapp_logs.json` - WhatsApp message logs

## Routing
All pages are accessed through main index.php with parameters:
- `?billing=customers&session=XXX` - Customer management
- `?billing=invoices&session=XXX` - Invoice management
- `?billing=addcustomer&session=XXX` - Add customer
- `?billing=editcustomer&customer_id=XXX&session=XXX` - Edit customer
- etc.

## Session Handling
All billing pages consistently use `$_GET['session']` parameter for session management.
No direct session handling in individual pages - handled by main index.php.