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

require_once(dirname(__FILE__) . '\header.php');

// ambil id data di URL
$id = $_GET["id"];

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

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .ccc {
            float: right;
        }

        .atas {
            background-color: red;
            color: white;
            height: 50px;
        }

        .aaaa {
            background-color: red;
            color: white;
            height: 30px;
        }
    </style>
</head>

<body>
    <div class="container-sm">
        <form action="" method="" enctype="">
            <!-- membuat pilihan keluhan -->
            <div class="atas1">
                From : <?= $mhs['nama']; ?> |
                Email : <?= $mhs["email"]; ?>
            </div>
            <div class="atas">
                <h1><a style="float: left; margin-left:10px; "><?= $mhs["subjek"] ?></a></h1>
            </div>
            <div class="tengah">
                <a style="color: red"><b>: <?= $mhs["tanggal"]; ?>
            </div>
            <div class="hampir_isi">
                <hr>
            </div>
            <div class="isi">
                <textarea class="form-control" id="keluhan" name="keluhan" required cols="40" rows="20" readonly><?= $mhs["pesan"]; ?></textarea>
            </div>
            <div>
                <br>
                <a href="Admin_HapusPesan.php?id=<?php echo $mhs["id"] ?>" class="btn btn-danger btn-lg active" role="button" aria-pressed="true" style="float : right; margin-right: 20px;" onclick="return confirm('yakin?');">Hapus</a>
                <br>
                <br>
            </div>
    </div>
</body>
<?php
require 'footer.php';
?>

</html>