prepare("INSERT INTO jobs (company_id, job_ref, address_1, description, status_id, client_id) VALUES (?, ?, ?, ?, ?, ?)");
$stmt->execute([$company_id, $job_ref, $address_1, $description, $status_id, $client_id]);
$job_id = db()->lastInsertId();
logActivity($job_id, 'job_created', null, null, "Job Ref: $job_ref");
header("Location: job_detail.php?id=" . $job_id);
exit;
} catch (Exception $e) {
$error = "Error creating job: " . $e->getMessage();
}
}
$jobs = db()->prepare("SELECT j.*, s.name as status_name, c.name as client_name
FROM jobs j
LEFT JOIN job_statuses s ON j.status_id = s.id
LEFT JOIN clients c ON j.client_id = c.id
WHERE j.company_id = ?
ORDER BY j.created_at DESC");
$jobs->execute([$company_id]);
$jobList = $jobs->fetchAll();
$statuses = getJobStatuses($company_id);
$clients = getClients($company_id);
?>
Dashboard - Repairs Pro
All Jobs
| Job Ref |
Client |
Address |
Status |
Approved |
Action |
|
|
|
|
Yes
No
|
View
|
| No jobs found. Start by creating one. |