70 lines
2.8 KiB
PHP
70 lines
2.8 KiB
PHP
<?php
|
|
require_once __DIR__ . '/db/config.php';
|
|
?>
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Inbox | Admin</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css">
|
|
</head>
|
|
<body class="bg-light">
|
|
<nav class="navbar navbar-expand-lg navbar-white bg-white border-bottom sticky-top">
|
|
<div class="container">
|
|
<a class="navbar-brand fw-bold" href="index.php">Portfolio Admin</a>
|
|
<div class="ms-auto">
|
|
<a href="index.php" class="btn btn-outline-secondary btn-sm">Back to Site</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container py-5">
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1 class="h3 mb-0">Contact Inquiries</h1>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>Name</th>
|
|
<th>Email</th>
|
|
<th>Subject</th>
|
|
<th>Message</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$contacts = db()->query("SELECT * FROM contacts ORDER BY created_at DESC")->fetchAll();
|
|
if ($contacts):
|
|
foreach ($contacts as $c):
|
|
?>
|
|
<tr>
|
|
<td class="text-nowrap small text-muted"><?= htmlspecialchars($c['created_at']) ?></td>
|
|
<td class="fw-bold"><?= htmlspecialchars($c['name']) ?></td>
|
|
<td><a href="mailto:<?= htmlspecialchars($c['email']) ?>"><?= htmlspecialchars($c['email']) ?></a></td>
|
|
<td><?= htmlspecialchars($c['subject']) ?></td>
|
|
<td><div class="small text-truncate" style="max-width: 300px;"><?= htmlspecialchars($c['message']) ?></div></td>
|
|
</tr>
|
|
<?php
|
|
endforeach;
|
|
else:
|
|
?>
|
|
<tr>
|
|
<td colspan="5" class="text-center py-5 text-muted">No messages found yet.</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
</body>
|
|
</html>
|