- Add Field Engineer Management feature, allowing creation, and assignment of engineers to service requests. - Add Service Contract/AMC Management feature, allowing creation of contracts and linking them to service requests. - Update admin panel to manage engineers and contracts. - Update service request form to include contract selection.
19 lines
598 B
PHP
19 lines
598 B
PHP
<?php
|
|
require_once __DIR__ . '/../../db/config.php';
|
|
|
|
try {
|
|
$pdo = db();
|
|
|
|
// Check if the column already exists
|
|
$stmt = $pdo->query("SHOW COLUMNS FROM service_requests LIKE 'engineer_id'");
|
|
if ($stmt->rowCount() == 0) {
|
|
$pdo->exec("ALTER TABLE service_requests ADD COLUMN engineer_id INT NULL");
|
|
echo "Column 'engineer_id' added to 'service_requests' table successfully." . PHP_EOL;
|
|
} else {
|
|
echo "Column 'engineer_id' already exists in 'service_requests' table." . PHP_EOL;
|
|
}
|
|
|
|
} catch (PDOException $e) {
|
|
die("DB ERROR: " . $e->getMessage());
|
|
}
|