# Furnify Customer Accounts

This version adds buyer accounts and one unified admin access.

## New customer pages

- `register.php` - customer registration
- `login.php` - customer login
- `customer-dashboard.php` - customer dashboard
- `customer-orders.php` - order tracking
- `customer-custom.php` - custom sofa quote tracking
- `customer-reup.php` - Re-Up request tracking
- `customer-profile.php` - profile and password update
- `verify-email.php` - email verification link handler

## New admin pages

- `admin/customers.php` - customer list
- `admin/customer-view.php` - customer profile, manual email verification, and activity

The admin still uses one access point:

```text
/admin/login.php
```

## Database setup

Fresh install:

```text
database/schema.sql
```

Existing Furnify database:

```text
database/migration_customer_accounts.sql
```

## Email verification

The system uses PHP `mail()` by default. Some shared hosting accounts disable or limit `mail()`. For production, use a real SMTP mailer in a later upgrade.

For testing, `data/settings.php` includes:

```php
'accounts' => array(
    'show_debug_verification_link' => true,
)
```

This shows a testing verification link inside the customer dashboard after registration/resend. After email sending is working, set it to:

```php
'show_debug_verification_link' => false,
```

## Phone verification

The database already has a `phone_verified_at` field, but SMS OTP is not activated yet. To enable real phone OTP later, connect an SMS provider such as Semaphore, Twilio, or another Philippine SMS gateway.

## Recommended customer flow

```text
Customer creates account
→ verifies email
→ orders ready-made sofa / sends custom quote / sends Re-Up request
→ admin reviews
→ customer tracks status in dashboard
→ customer pays downpayment or balance
```
