# Crest Chimney Admin Panel

## Installation Instructions

### 1. Database Setup

1. Open phpMyAdmin (usually at http://localhost/phpmyadmin)
2. Click on "SQL" tab
3. Copy and paste the contents of `install.sql` file
4. Click "Go" to execute

This will:
- Create the database `crestchimney_db`
- Create the `admin_users` table
- Insert a default admin user

### 2. Default Login Credentials

- **Username:** `admin`
- **Password:** `admin123`
- **Email:** `admin@zibot.store`

**⚠️ IMPORTANT: Change the default password immediately after first login!**

### 3. Access the Admin Panel

Navigate to: `http://localhost/admin/login.php`

### 4. Database Configuration

If your database credentials are different, edit `config.php`:

```php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'crestchimney_db');
```

### 5. Security Notes

- The `.htaccess` file provides basic protection
- Passwords are hashed using PHP's `password_hash()` function
- Sessions are used for authentication
- Always use strong passwords in production

### 6. Changing Password

To change the admin password, you can:

1. Use PHP code:
```php
echo password_hash('your_new_password', PASSWORD_DEFAULT);
```

2. Then update in database:
```sql
UPDATE admin_users SET password = 'generated_hash' WHERE username = 'admin';
```

Or create a password change feature in the admin panel.

## File Structure

```
admin/
├── login.php          # Login page
├── dashboard.php      # Admin dashboard
├── logout.php         # Logout handler
├── .htaccess          # Basic protection
├── install.sql        # Database setup SQL
└── README.md          # This file
```