# WebReady.pk - Complete CMS
## cPanel Upload Guide

---

## STEP 1: Database Setup (phpMyAdmin)

1. Login to cPanel → Open **phpMyAdmin**
2. Create new database: `webready_db`
3. Create database user and give **All Privileges**
4. Click **Import** → Choose `database.sql` → Click **Go**

---

## STEP 2: Update Config File

Open `includes/config.php` and update:

```php
define('DB_HOST', 'localhost');
define('DB_USER', 'cpanel_dbuser');    // Your cPanel DB username
define('DB_PASS', 'your_password');    // Your DB password
define('DB_NAME', 'webready_db');      // Your database name

define('SITE_URL', 'https://webready.pk');  // Your domain
define('ADMIN_EMAIL', 'info@webready.pk');  // Your email
```

---

## STEP 3: Upload Files to cPanel

### Via File Manager:
1. Open cPanel → **File Manager** → Go to `public_html`
2. Upload the ZIP of this folder → Extract
3. Make sure all files are directly in `public_html/`

### Via FTP (FileZilla recommended):
- Host: `ftp.webready.pk`
- Username/Password: your cPanel FTP credentials
- Upload everything to `/public_html/`

---

## STEP 4: Set Folder Permissions

In File Manager, right-click these folders → **Change Permissions** → set to **755**:
- `uploads/`
- `uploads/services/`
- `uploads/projects/`
- `uploads/posts/`
- `uploads/sliders/`
- `uploads/team/`
- `uploads/testimonials/`
- `uploads/clients/`
- `uploads/logos/`

Or run via SSH:
```bash
chmod -R 755 uploads/
```

---

## STEP 5: First Login

Go to: `https://webready.pk/admin/login.php`

**Default Credentials:**
- Admin: `admin@webready.pk` / `password`
- Editor: `editor@webready.pk` / `password`

⚠️ **CHANGE PASSWORDS IMMEDIATELY** after first login!
Go to Admin Panel → Users → Change Password

---

## STEP 6: Update Default Password in DB

The default password in database.sql is hashed for the word `password`.
To generate a new hash, use PHP:
```php
echo password_hash('YourNewPassword', PASSWORD_BCRYPT);
```

---

## FOLDER STRUCTURE

```
public_html/
├── index.php           ← Homepage
├── about.php           ← About page
├── services.php        ← Services listing
├── service-detail.php  ← Service detail
├── projects.php        ← Projects portfolio
├── project-detail.php  ← Project detail
├── blog.php            ← Blog listing
├── blog-detail.php     ← Blog post
├── contact.php         ← Contact form
├── get-quote.php       ← Quote form
├── 404.php             ← 404 error page
├── .htaccess           ← Apache config
│
├── includes/
│   ├── config.php      ← DB config (EDIT THIS!)
│   ├── header.php      ← Site header
│   └── footer.php      ← Site footer
│
├── admin/              ← Admin Panel
│   ├── login.php       ← Admin login
│   ├── dashboard.php   ← Dashboard
│   ├── services.php    ← Manage services
│   ├── service-add.php
│   ├── service-edit.php
│   ├── projects.php    ← Manage projects
│   ├── project-add.php
│   ├── project-edit.php
│   ├── posts.php       ← Manage blog
│   ├── post-add.php
│   ├── post-edit.php
│   ├── sliders.php     ← Homepage sliders
│   ├── testimonials.php
│   ├── team.php
│   ├── clients.php     ← Partner logos
│   ├── quotes.php      ← Quote requests inbox
│   ├── contacts.php    ← Contact inbox
│   ├── settings.php    ← Site settings (logo, text, social)
│   ├── users.php       ← User management
│   ├── stats.php       ← Counter numbers
│   ├── logout.php
│   └── includes/
│       └── sidebar.php ← Admin sidebar
│
├── css/                ← Template CSS
├── js/                 ← Template JS
├── fonts/              ← Template fonts
├── images/             ← Template images
└── uploads/            ← Uploaded media files
```

---

## ROLES & WORKFLOW

### Admin:
- Full access to everything
- Can create, edit, delete all content
- Can approve/reject editor submissions
- Manages users, settings, site content

### Editor:
- Can add services, projects, blog posts, sliders, testimonials, team
- All submissions go to **pending** status
- Admin must approve before going live on website
- Cannot delete approved content
- Cannot access: Settings, Users

### Approval Flow:
```
Editor adds content → Status: PENDING → Admin reviews → APPROVE → Goes Live
                                                       → REJECT  → Not shown
```

---

## EMAIL SETUP (cPanel)

### For contact forms to send emails:
1. Go to Admin → Settings → Email tab
2. Set **Notification Email** to `info@webready.pk`
3. For cPanel hosting, default PHP `mail()` works automatically
4. For SMTP, fill in the SMTP details from cPanel Email section

### Create email account in cPanel:
1. cPanel → Email Accounts → Create `info@webready.pk`
2. Set a strong password
3. Access via Webmail or configure in Outlook/Gmail

---

## SECURITY CHECKLIST

- [ ] Change default admin password
- [ ] Change default editor password  
- [ ] Update config.php with real DB credentials
- [ ] Enable HTTPS in .htaccess (after SSL is active)
- [ ] Set uploads folder permissions to 755
- [ ] Remove `database.sql` from public_html after import
- [ ] Update SITE_URL in config.php

---

## SUPPORT

Website: webready.pk
Email: info@webready.pk
