<?php
include '../../db_connect.php';

$id = $_GET['id'];
$sql = "SELECT * FROM contact_us WHERE id = $id";
$result = $conn->query($sql);
$entry = $result->fetch_assoc();
?>

<?php
include "../layout/header.php";
?>
        <h2 class="text-center">Contact Us Entry Details</h2>
        <div class="card">
            <div class="card-body">
                <h5 class="card-title"><?= $entry['name'] ?></h5>
                <p class="card-text"><strong>Phone:</strong> <?= $entry['phone'] ?></p>
                <p class="card-text"><strong>Message:</strong> <?= $entry['message'] ?></p>
                <a href="index.php" class="btn btn-primary">Back to List</a>
            </div>
        </div>
    </div>
</body>
</html>

<?php $conn->close(); ?>
