# Dicomm Traffic Restored - cPanel Deployment

This package contains the restored Driver Logbook traffic system.

## Package Contents

- `public_html/driver-logbook/` - upload this folder to cPanel `public_html`
- `database/traffic_driver_logbook.sql` - import this into a cPanel MySQL database

Do not upload the `database` folder into public web space.

## Server

- cPanel/IP: `162.0.226.180`
- cPanel URL is usually: `https://162.0.226.180:2083`
- FTP/SFTP host: `162.0.226.180`

## 1. Create The Database In cPanel

1. Log into cPanel.
2. Open **MySQL Database Wizard**.
3. Create a database, for example: `YOURCPANELUSER_traffic`.
4. Create a database user, for example: `YOURCPANELUSER_trafficuser`.
5. Set a strong password.
6. Assign the user to the database with **ALL PRIVILEGES**.
7. Write down:
   - Database name
   - Database username
   - Database password

## 2. Import The Database

1. Open **phpMyAdmin** in cPanel.
2. Select the database you created.
3. Click **Import**.
4. Upload `database/traffic_driver_logbook.sql`.
5. Run the import.

## 3. Update Database Config

Edit these two files after upload:

- `public_html/driver-logbook/db.php`
- `public_html/driver-logbook/admin-module/db.php`

Replace:

```php
define('TRAFFIC_DB_USER', 'CPANEL_DB_USER');
define('TRAFFIC_DB_PASS', 'CPANEL_DB_PASSWORD');
define('TRAFFIC_DB_NAME', 'CPANEL_DB_NAME');
```

With your real cPanel database values, for example:

```php
define('TRAFFIC_DB_USER', 'yourcpaneluser_trafficuser');
define('TRAFFIC_DB_PASS', 'your-real-password');
define('TRAFFIC_DB_NAME', 'yourcpaneluser_traffic');
```

Leave this as `localhost` unless your host gives you a different MySQL hostname:

```php
define('TRAFFIC_DB_HOST', 'localhost');
```

## 4. Upload Files

Using cPanel File Manager:

1. Open **File Manager**.
2. Go to `public_html`.
3. Upload the `driver-logbook` folder from `public_html/driver-logbook`.
4. Confirm this path exists on the server:

```text
public_html/driver-logbook/index.php
public_html/driver-logbook/admin-module/index.php
```

Using FTP/SFTP:

1. Connect to `162.0.226.180`.
2. Upload `public_html/driver-logbook` into the server's `public_html`.

## 5. Set PHP Version

In cPanel **MultiPHP Manager** or **Select PHP Version**, use PHP `8.1` if available.

Required PHP extension:

- `mysqli`

## 6. Test URLs

After upload, test:

```text
http://YOUR-DOMAIN/driver-logbook/
http://YOUR-DOMAIN/driver-logbook/admin-module/
```

If the domain is not pointed yet, cPanel may provide a temporary URL. If enabled, it is usually:

```text
http://162.0.226.180/~CPANELUSERNAME/driver-logbook/
```

## Known Restored Login

Evans was reset locally for testing:

```text
Username: Evans Marozhe
Password: TempPass123
```

Change this password after the site is live.

## Verification Done Before Packaging

- Driver/admin PHP files pass syntax checks.
- Old local MySQL host/port credentials were removed from packaged PHP files.
- Database export was created from the restored local database.
- Viewing/reporting paths were tested locally before packaging.
