Draft Portal (PHP + MySQL + dompdf)

1) Upload this folder to your hosting (e.g., cPanel File Manager) as: /public_html/draft-portal/
2) Create MySQL database + user in cPanel, then import the SQL (provided separately in chat).
3) Edit app/db.php with DB credentials.
4) Run composer install on server OR locally then upload vendor/.
   - If server has SSH: cd draft-portal && composer require dompdf/dompdf
   - If no SSH: run composer locally and upload vendor/ directory.
5) Ensure storage is writable:
   - storage/pdf
   - storage/uploads
6) Create admin:
   - If SSH: php tools/create_admin.php
   - If no SSH: temporarily open tools/create_admin.php in browser ONCE (then delete/disable tools folder).

Login:
- admin@local / nymp6b2V

Admin flow:
- Create users + roles
- Assign routing (maker->checker->approver). If maker==checker, set checker_id = maker_id (auto-skip).
- Create templates and versions; publish; set default.
Maker:
- New Draft Request -> select Issuer + Instrument -> fill form -> attach files.
Checker/Approver:
- Can see Special Request + attachments; can edit draft.
Approver:
- Approve -> system PDF OR upload final override PDF.
Maker:
- Can only download final PDF after approval.


EMAIL NOTIFICATIONS
- Configure app/config.php:
  - email_enabled (true/false)
  - email_from, email_from_name
  - base_url (your deployed public URL to /public)
- Uses PHP mail(). On some hosts you may need to enable SMTP or use an email relay.
