# Getting Started

## Logging in

Go to the portal URL and you land on `/login.php`. Enter your username and password.

- Accounts live in the `users` table with a bcrypt password hash and a **role**: `manager`, `driver` or `fitter`.
- After login you are redirected to the **Hire List** (`/CRUD/hire_list/hire_list.php`).
- Sessions last 24 hours (cookie `HICKEYSESSID`).
- Individual pages can be restricted per role via the `users_page_permissions` table (managed at `/CRUD/users/manage_page_permissions.php`). If your role isn't allowed you are sent to the "unauthorised" page.
- **On localhost the login step is skipped entirely** — `CRUD/session.php` returns early for local hostnames. That's why the local dev portal never asks you to sign in.

## The navigation bar

The navbar (`CRUD/nav_bar/navbar_1.html`) appears on every page:

- **Colour tells you which environment you're in** — red = dev/test, grey-green = live.
- Left to right: **Hire List**, **Plant List** (dropdown: Asset List, Plant List, Plant Specs, Yard Ready List), **XH List**, **To collect**, **Drivers**, **Sites**, **Reports**, **Fitter**, **Missing** (fuel / buckets / PODs / POs / drivers / rates — the red badge shows the count of missing POs), **History**, **Uploads**.
- Right-hand quick-action buttons: **Need** (yellow; the small **+** opens multi-need), **Moves** (site move), **Op** (operator-only hire), **Chargeable**.
- The small clock icon at the far right: **single-click** = log a phone call, **double-click** = phone-call dashboard.

![Main page](../screenshots/main__mainpage.png)

## The main page

`/CRUD/main/mainpage.php` is the tile menu shown above. It links to every module that isn't in the navbar — Customers, Forms, Fleet, Health & Safety, Invoice Review, ISO, GHG, Suppliers, Templates, POD Management, Maintenance, Contacts, Bank Holidays, Call Log and more. Click the logo in the navbar from any page to come back here.

## Where things live on disk

Local dev root: `C:\xampp\htdocs\portal.hickeyplanthire.co.uk`

- All pages: `CRUD/<module>/...`
- Shared plumbing: `CRUD/bootstrap.php`, `CRUD/config.php`, `CRUD/database.php`, `CRUD/session.php`, `CRUD/functions/`
- Database: `hickeyplant` on local MariaDB (XAMPP), user `root`. See [database-schema.md](../database-schema.md) for every table.

> **Deployment note:** the live portal runs separately-deployed code — a page working locally does not mean the live site has that version yet.
