<?php
include 'ominterior_db.php';

// Get ID from URL
$id = $_GET['id'] ?? 0;

// Delete record
if ($id > 0) {
    $sql = "DELETE FROM about_section WHERE id = ?";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("i", $id);

    if ($stmt->execute()) {
        echo "<div class='alert alert-success'>Record deleted successfully.</div>";
    } else {
        echo "<div class='alert alert-danger'>Error: " . $stmt->error . "</div>";
    }
} else {
    echo "<div class='alert alert-danger'>Invalid ID.</div>";
}

$stmt->close();
$conn->close();

// Redirect back to the list page after deletion
header("Location: texts.php");
exit;
?>
