diff --git a/admin/contracts.php b/admin/contracts.php index 10264a1..470b2ac 100644 --- a/admin/contracts.php +++ b/admin/contracts.php @@ -116,8 +116,8 @@ require_once __DIR__ . '/../header.php';
+ Email: | + Phone: +
+| ID | +Job Title | +Job Description | +Contract | +Status | +Submitted | +Last Updated | +
|---|---|---|---|---|---|---|
| + | + | + | + + + + N/A + + | ++ | + | + |
No service requests found for this customer.
+ +| Customer Name | +Phone | +Service Requests | +Action | +|
|---|---|---|---|---|
| + | + | + | + | + View History + | +
No customers found.
+ +'; - var_dump($name, $phone, $email, $address, $service_type, $preferred_date, $description, $contract_id); - echo ''; + try { $pdo = db(); - $sql = "INSERT INTO service_requests (name, phone, email, address, service_type, preferred_date, description, contract_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; + $sql = "INSERT INTO service_requests (name, phone, email, address, job_description, preferred_date, description, contract_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; $stmt = $pdo->prepare($sql); // Handle empty date and contract $date_to_insert = !empty($preferred_date) ? $preferred_date : null; $contract_to_insert = !empty($contract_id) ? $contract_id : null; - $stmt->execute([$name, $phone, $email, $address, $service_type, $date_to_insert, $description, $contract_to_insert]); + $stmt->execute([$name, $phone, $email, $address, $job_description, $date_to_insert, $description, $contract_to_insert]); $success_message = "Thank you! Your service request has been submitted successfully. We will contact you shortly."; // Clear form data on success @@ -55,7 +50,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { } catch (PDOException $e) { // Debugging: show exact error - var_dump($e->getMessage()); + //var_dump($e->getMessage()); error_log("Service Request Error: " . $e->getMessage()); $error_message = 'Sorry, there was an error submitting your request. Please try again later.'; } @@ -101,13 +96,13 @@ include 'header.php';