# DryClean360 PHP — Deployment Update (2026-07-06 night → 2026-07-07 morning)

## Database changes

**Only one schema change** was made in this period.

| Table | Change | Purpose |
|-------|--------|---------|
| `shop_settings_shopprofile` | Add column `client_logo` VARCHAR(255) NOT NULL DEFAULT '' | Store uploaded client logo path for login page + invoice PDF |

**No other tables were altered.**  
`customers_customer.active` already existed — inactive customer behaviour uses that existing column only.

### SQL script for server

Run on hosting MySQL:

```bash
mysql -u YOUR_USER -p dryclean360_db < scripts/server_update_20260707.sql
```

Or paste the contents of `scripts/server_update_20260707.sql` in phpMyAdmin.

**Note:** The PHP app also auto-adds this column on first Shop Settings load if missing. Running the SQL script on the server is still recommended so the team has a clear, repeatable step.

---

## Application / file changes (no extra DB)

Deploy the latest `Dryclean360aiphp` code. Summary by area:

### Invoice PDF
- Client logo moved to **footer** (below footer line), not behind items table
- Footer height increased (2-inch logo zone)
- Table text reverted to normal size (not bold); only **Grand Total** is bold
- Totals aligned under the **Total** column
- Multi-page invoices: items paginate; footer/logo on each page

### Login page
- Homepage poster background (`public/assets/images/dryclean360-homepage.png`)
- Client logo in fixed vertical holder (left of login form)
- Dedicated auth layout (`resources/views/layouts/auth.php`)
- Highlight text styling for tagline, shop name, footer
- **Upload Logo** in Shop Settings → saves to `public/assets/images/client_logo.{png|jpg|webp}`

### Shop Settings
- New **Upload Logo** field (PNG/JPG/WEBP)
- Logo used on login page and invoice PDF footer

### Save / UX (today morning)
- Success **popup with OK** (replaces green banner for key saves)
- **Double-click protection** on Save (customer, order, payment, invoice generate)
- Inactive customer edit message: *"You cannot book an order now for this customer."*
- New customer: popup → OK → **Customers grid**
- Order / payment / invoice: popup → OK → **stay on order detail**

### Dev server
- `run.bat` now routes all requests through `public/index.php` (fixes `/media/` and uploads)

### Invoice generate route
- Changed from **GET** to **POST** (CSRF protected) — update bookmarks/links if any

---

## Server deployment checklist

1. **Backup** database and `public/` folder
2. **Run SQL:** `scripts/server_update_20260707.sql`
3. **Upload/deploy** latest PHP code to hosting document root (`public/`)
4. **Ensure writable:**
   - `public/assets/images/` (client logo uploads)
   - `storage/` and shared `media/` (orders, invoices, photos)
5. **Copy assets** if not in repo:
   - `public/assets/images/dryclean360-homepage.png`
   - `public/assets/images/logo.png`, `ndclogo1.png` (fallbacks)
6. **Configure `.env`** on server (DB, `APP_URL`, `MEDIA_PATH`)
7. **Hard refresh** browsers (Ctrl+F5) or clear service worker cache after deploy
8. **Optional:** Regenerate invoice PDFs after deploy:
   ```bash
   php scripts/regenerate_invoices.php
   ```

---

## Files touched (reference)

**DB-related**
- `app/Services/ShopSettingsService.php`
- `scripts/server_update_20260707.sql`

**Invoice**
- `app/Services/InvoiceService.php`
- `resources/views/billing/invoice_pdf.php`

**Login / branding**
- `resources/views/accounts/login.php`
- `resources/views/layouts/auth.php`
- `public/assets/css/tablet.css`
- `public/assets/images/dryclean360-homepage.png`

**Shop Settings**
- `app/Controllers/ShopSettingsController.php`
- `resources/views/shop_settings/form.php`

**Save popups / double-submit**
- `app/Helpers/functions.php` (`flash_modal`)
- `app/Controllers/CustomerController.php`
- `app/Controllers/OrderController.php`
- `app/Controllers/PaymentController.php`
- `app/Controllers/BillingController.php`
- `resources/views/partials/success_modal.php`
- `resources/views/layouts/app.php`
- `public/assets/js/tablet.js`
- `routes/web.php` (invoice POST)

**Dev**
- `run.bat`
- `public/sw.js` (cache version bumps)
