# Tartu College Summer Application Form

This is a standalone PHP-based web application for collecting Summer accommodation applications for Tartu College.

---

## ✅ Requirements
- PHP 7.2+ (tested on Bluehost shared hosting)
- SMTP credentials (e.g., Bluehost email)
- Google reCAPTCHA v2 keys (optional)

---

## 📂 File Structure
```
/
├── index.php                  # Main form UI
├── review.php                 # Review and confirm form
├── submit.php                 # Final submission handler
├── verify-email.php           # Sends email verification code
├── verify-code.php            # Verifies 6-digit code
├── generate-pdf.php           # Streams PDF to browser
├── template-review-pdf.php    # PDF layout template
├── mailer-config.php          # SMTP / config settings
├── README.txt
│
├── /assets/                  # Frontend & library files
│   ├── style.css
│   ├── verify-email.js
│   ├── logo.png (optional)
│   ├── /dompdf/
│   └── /PHPMailer/
│
└── /submissions/             # JSON + PDF archive
    └── .htaccess             # Prevents web access
```

---

## ⚙️ Setup Instructions
1. Upload all files to your hosting (e.g., `summerapplication.tartucollege.ca`)
2. Edit `mailer-config.php` with:
   - Your SMTP hostname
   - Your email address and password
   - Destination address for office copy
3. (Optional) Set your reCAPTCHA keys in `mailer-config.php`
4. Make sure the `/submissions/` folder is writable by the server (CHMOD 755 or 775)
5. Test the form — verified email, form review, submit, and email delivery

---

## 📧 Outgoing Emails
- One email sent to applicant (with PDF attached)
- One copy to office (admin email)

---

## 🔐 Security Notes
- Email is verified before submission
- All submissions archived to JSON and PDF
- Archive is protected via `.htaccess`

---

© 2025 Tartu College | Built for summerapplication.tartucollege.ca
