<?php
session_start();

if (!isset($_SESSION["login"])) {
    header("Location: login.php");
    exit;
}

require 'functions.php';

$id = $_GET["id"];

$mhs = query("SELECT * FROM kontak WHERE id= $id")[0];

if (hapusPesanMasuk($id) > 0) {
    echo "
            <script>
            alert('data berhasil dihapus!');
            document.location.href = 'Admin_PesanMasuk.php';
            </script>
        ";
} else {
    echo "
            <script>
            alert('data gagal dihapus!!');
            document.location.href = 'Admin_PesanMasuk.php';
            </script>
        ";
}
