BazarMate Courier Pricing Update
=================================

Files
-----
1) bazarmate-courier-pricing.sql
2) bazarmate-courier-index-updated.php
3) bazarmate-courier-admin-updated.php

Installation order
------------------
1. Take a backup of the BazarMate database and the current files:
   public_html/courier/index.php
   public_html/courier/admin.php

2. Open hosting cPanel -> phpMyAdmin. Select the BazarMate database.
   Open the SQL tab, paste/run bazarmate-courier-pricing.sql.
   Run this SQL once only. It adds columns used by the new calculator.

3. Upload bazarmate-courier-index-updated.php to:
   public_html/courier/index.php
   Rename the uploaded file to index.php (overwrite the old file).

4. Upload bazarmate-courier-admin-updated.php to:
   public_html/courier/admin.php
   Rename the uploaded file to admin.php (overwrite the old file).

Pricing rules implemented
-------------------------
Inside Barlekha:
- Up to 3 km: Tk 40
- More than 3 km up to 5.5 km: Tk 50
- Above 5.5 km: each effective additional km adds Tk 10.
- Boundary follows the agreed examples: 5.5 km = Tk 50; 5.6 km = Tk 60; 6.5 km = Tk 60; 6.6 km = Tk 70.

Delivery types:
- Normal: 1.0x base
- Express / Safe: 1.7x base
- Super Express: 2.0x base
- Perishable category requires Super Express.
- Documents and fragile goods require Express / Safe or Super Express.

Outside Barlekha:
- Preliminary base minimum is Tk 150 up to 5 kg.
- For above 5 kg, the admin must verify the current Fastech tariff and enter final charge. No unconfirmed per-kg rate has been invented.

Verification workflow
---------------------
- Customer enters estimated road distance only for Barlekha destinations.
- System stores customer distance and preliminary estimate separately.
- Admin enters verified distance and final delivery charge.
- Admin page also allows updating Fastech tracking number and preserves status/rider assignment.

Important
---------
- The PHP files passed php -l syntax checks in the build environment. They have not been tested against your live hosting/database.
- Existing bookings are preserved; their new pricing fields receive defaults/null values.
- Back up before replacing files. If the SQL reports duplicate column names, stop and send the exact error instead of rerunning it.
