<?php
// =====================================================
// DELETE /delete_lineman.php?id=X
// Response: plain text
// =====================================================
require_once 'config.php';

$conn = getConnection();

$id = $_GET['id'] ?? '';

if (empty($id)) {
    echo "ID is required";
    exit;
}

$stmt = $conn->prepare("DELETE FROM line_man WHERE id = ?");
$stmt->bind_param("i", $id);

if ($stmt->execute()) {
    echo "Deleted successfully";
} else {
    echo "Failed to delete";
}

$stmt->close();
$conn->close();
