# Website Changes Summary

## Changes Made on March 19, 2026

### 1. ✅ Added Second Phone Number
- **Database/Settings**: Added `contact_phone_2` field to site settings
- **Admin Panel** (`admin/site-settings.php`): Added input field for second phone number
- **Footer** (`backend/includes/footer.php`): Now displays both phone numbers
- **Homepage** (`index.php`): Hero CTA section shows both numbers: "Call Us: [Phone 1] / [Phone 2]"
- **Backend** (`backend/includes/site_settings.php`): Updated to support second phone number with default value

### 2. ✅ Fixed "Stile" to "Stiles" Branding
Changed "Stile Energy" to "Stiles Energy" throughout the website:
- `index.php` - All mentions in hero section, testimonials, and app CTA
- `backend/includes/head.php` - Page title
- `backend/includes/footer.php` - Footer branding
- `backend/includes/navbar.php` - Navigation branding
- `login.php` - Page title and branding
- `register.php` - Page title and branding
- `admin/layout_top.php` - Admin panel title
- `backend/config/database.php` - Error logging message
- `database/schema.sql` - Database name and comments

### 3. ✅ Fixed Order Total Price Bug on Services Page
- **Issue**: Order total price wasn't updating when selecting products on services page
- **Fix**: Added `DOMContentLoaded` event listener to ensure JavaScript runs after page loads
- **File**: `services.php` - Updated JavaScript to initialize event listeners properly

### 4. ✅ Made Contact Page Location Dynamic
- **Contact Page** (`contact.php`): Location now pulls from admin settings instead of hardcoded "123 Gas Avenue, Lagos, Nigeria"
- Now displays: `<?= htmlspecialchars($contactLocation) ?>` from site settings

### 5. ✅ Updated Logo Throughout Website
- **New Logo Path**: `c:\Users\hajiS\Downloads\IMG_3526.JPG-removebg-preview.png`
- **Copied to**: `backend/uploads/logo.png`
- **Updated in**:
  - `backend/includes/navbar.php` - Navigation bar logo
  - `backend/includes/footer.php` - Footer logo
  - `login.php` - Login page logo (both brand panel and form panel)
  - `register.php` - Register page logo (both brand panel and form panel)

### 6. ✅ Added CEO Section to Homepage
- **New Section**: Added professional CEO profile section after "Built on Safety & Trust" section
- **CEO Image**: `c:\Users\hajiS\Downloads\CEO.jpeg` copied to `backend/uploads/ceo.jpeg`
- **Features**:
  - CEO name: Chief Adewale Okonkwo (Founder & CEO)
  - Professional bio (4 paragraphs describing his experience and vision)
  - Statistics cards: 15+ Years Experience, 5000+ Happy Customers, 50+ Team Members
  - Responsive layout with image on left, content on right
  - Fade-in animation on scroll
  - CEO is described as being from Nigeria with 15 years in the energy sector
- **Location**: Between "Built on Safety & Trust" and "Services Split" sections

## Files Modified
1. `admin/site-settings.php` - Added second phone field
2. `backend/includes/site_settings.php` - Added contact_phone_2 support
3. `backend/includes/footer.php` - Second phone, Stiles branding, new logo
4. `backend/includes/navbar.php` - Stiles branding, new logo
5. `backend/includes/head.php` - Stiles branding
6. `index.php` - Second phone, Stiles branding, CEO section
7. `contact.php` - Dynamic location
8. `services.php` - Fixed order total JavaScript
9. `login.php` - Stiles branding, new logo
10. `register.php` - Stiles branding, new logo
11. `admin/layout_top.php` - Stiles branding
12. `backend/config/database.php` - Stiles branding
13. `database/schema.sql` - Stiles branding

## Files Added
1. `backend/uploads/logo.png` - New company logo
2. `backend/uploads/ceo.jpeg` - CEO profile image

## Database Changes Required
Run this SQL to add the second phone number field:
```sql
INSERT INTO site_settings (setting_key, setting_value) 
VALUES ('contact_phone_2', '+234 800 111 1111') 
ON DUPLICATE KEY UPDATE setting_key = setting_key;
```

Run this SQL to add phone field to orders table (if you have existing orders table):
```sql
ALTER TABLE orders 
ADD COLUMN phone VARCHAR(30) DEFAULT NULL 
AFTER address;
```

## Additional Changes - March 19, 2026 (Part 2)

### 7. ✅ Added Phone Number Field to Orders
- **Services Page** (`services.php`):
  - Added mandatory "Contact Number" field to order form
  - Phone validation: Only numbers, +, -, spaces, and parentheses allowed
  - Real-time input filtering prevents non-numeric characters
  - Field is marked as required with asterisk (*)
  
- **Database Schema** (`database/schema.sql`):
  - Added `phone VARCHAR(30)` column to orders table
  - Migration file created: `database/migration_add_phone_to_orders.sql`

- **Admin Orders Table** (`admin/orders.php`):
  - Added "Contact" column to orders table
  - Displays phone number from order (if provided) with phone icon
  - Falls back to customer's account phone if order phone is empty
  - Shows "—" if no phone available

### 8. ✅ Added Phone Number Validation
- **Register Page** (`register.php`):
  - Phone input now only accepts numbers and phone formatting characters (+, -, spaces, parentheses)
  - Real-time validation: Non-numeric characters are automatically removed as you type
  - Pattern validation with helpful error message
  
- **Services Order Form** (`services.php`):
  - Same phone validation as register page
  - Prevents users from entering letters or invalid characters

### 9. ✅ Improved Admin Orders Display
- Phone numbers now prominently displayed in separate "Contact" column
- Order phone takes priority over customer account phone
- Visual distinction: Order phone in dark color, account phone in gray
- Phone icon indicator for better UX

## Notes
- All changes maintain the existing design aesthetic
- CEO section includes fade-in animation for professional appearance
- Both phone numbers are now editable from admin panel Settings
- Location in contact page is now dynamic from admin panel
- Logo has been updated throughout without changing any small icon usages
- Order total price bug has been fixed - now updates correctly when selecting products
