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

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

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

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