# Registration Page

A modern, responsive registration page with server-side validation, QR code generation, database storage, and email confirmation.

## Features
- Clean, minimal UI with accent color #3EC2D1
- All fields mandatory; validated client and server side
- QR code generated (ID-based) and saved under `storage/qrcodes/`
- Stores data in MySQL (auto-creates `registrations` table)
- Sends confirmation email with QR attachment (via PHP `mail()`)

## Files
- `index.php`: Form UI
- `assets/styles.css`: Styles
- `assets/app.js`: Client logic and UX
- `api/submit.php`: Backend endpoint
- `connect.php`: Existing PDO helpers (used)
- `config.php`: App configuration
- `storage/qrcodes/`: Saved QR images

## Email Setup
This project uses PHP `mail()` to send emails. On Windows (XAMPP), configure `php.ini`:

- `SMTP = your_smtp_host`
- `smtp_port = 587`
- `sendmail_from = no-reply@example.com`

Restart Apache after changes. Update `config.php` values for `EMAIL_FROM`, `EMAIL_FROM_NAME`, and `EMAIL_REPLY_TO`.

If you prefer SMTP libraries (e.g. PHPMailer), you can integrate them later and use `SMTP_*` settings in `config.php`.

## Database
`api/submit.php` will auto-create a table `registrations` if it doesn't exist, using the connection from `connect.php`.

Columns saved: uuid, first_name, last_name, email, phone, scfhs_id, national_id, speciality, hospital, qr_path, created_at

## QR Content
For privacy, the QR encodes only the generated unique ID (e.g. `REG:<uuid>`). The QR image is generated via `api.qrserver.com` and stored locally.

## Testing
1. Open `http://localhost/temoregister/`.
2. Fill in the form and submit.
3. On success, a QR is saved to `storage/qrcodes/` and an email is sent with the QR attached (if `mail()` is configured).

## Customization
- Change accent color by editing `assets/styles.css` (variable `--accent`) or `config.php` for email template.
- Replace `logo.png` with your own logo (already present in root).
