# AGENTS.md

## Project
Oslob Cebu Paragliding website — PHP + MySQL + Tailwind CSS + jQuery PJAX

## Deployment
After every code change, **always commit, push, and confirm deploy**. Prefix commit messages with `[deploy]`:

```bash
git add .
git commit -m "[deploy] description of changes"
git push origin main
```

The server auto-deploys via GitHub webhook. No manual SSH/pull needed.

- **Production URL:** https://oslobcebuparagliding.com
- **Admin Panel:** https://oslobcebuparagliding.com/admin/
- **GitHub Repo:** https://github.com/argonarsoftware-oss/oslobparagliding
- **Server:** Google Cloud (136.110.4.109) — /var/www/oslobparagliding/
- **Domain:** oslobcebuparagliding.com (Namecheap DNS)

## Local Development
- XAMPP: http://localhost/oslobparagliding/
- DB: root / no password / oslobparagliding_db

## Key Paths
- Frontend pages: `pages/`
- Admin panel: `admin/`
- Backend includes: `includes/`
- Database config: `includes/db.php`
- Customer auth: `includes/customer-auth.php`
- Admin auth: `includes/auth.php`
- Booking handler: `includes/process-booking.php`
- JS (PJAX + booking AJAX): `js/app.js`
- CSS: `css/style.css`
- Image uploads: `uploads/`
- Webhook auto-deploy: `webhook-deploy.php`
- DB installer: `admin/install.php`

## Reminders
- After any DB schema changes (new tables, new columns, ALTER TABLE), **always run the installer** on both local and production:
  - **Local:** Run `/c/xampp/php/php.exe /c/xampp/htdocs/oslobparagliding/admin/install.php`
  - **Production:** After pushing (auto-deploy), fetch `https://oslobcebuparagliding.com/admin/install.php` using WebFetch to run it on the cloud DB
- The installer is **safe to re-run** — uses `CREATE TABLE IF NOT EXISTS`, try/catch per ALTER column, and seeds only when tables are empty
- After every code change, always commit + push — the server auto-deploys via webhook, no manual steps needed

## Important Notes
- Base path is `/oslobparagliding/` locally, `/` on production — the webhook auto-fixes this on deploy
- All frontend pages use PJAX — keep `data-pjax` and `pjax-link` on links
- Customer auth and admin auth are separate (different session keys, different tables)
- Image paths support both `images/` (legacy) and `uploads/` (new) via `img_url()` helper
