sozday-mne-formu-registratsi-2/list.html

60 lines
2.7 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru" data-theme="auto">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Список зарегистрировавшихся — АО «Казахтелеком»</title>
<link rel="stylesheet" href="design-system/kt-ai-fonts.css">
<link rel="stylesheet" href="design-system/kt-ai-tokens.css">
<link rel="stylesheet" href="design-system/kt-ai-components.css">
<link rel="stylesheet" href="design-system/kt-ai-page.css">
<style>
table { width: 100%; border-collapse: collapse; font-size: var(--kt-ai-text-sm); }
th, td { text-align: left; padding: var(--kt-ai-space-3) var(--kt-ai-space-3); border-bottom: 1px solid var(--kt-ai-divider); vertical-align: top; }
th { color: var(--kt-ai-fg-muted); font-weight: var(--kt-ai-weight-semibold); }
td.num { color: var(--kt-ai-fg-faint); }
.table-wrap { overflow-x: auto; }
</style>
</head>
<body>
<header class="kt-ai-pagehead">
<div class="kt-ai-wrap kt-ai-pagehead-in">
<strong>Список зарегистрировавшихся</strong>
<span class="kt-ai-spacer"></span>
<a class="kt-ai-btn" data-variant="ghost" href="/">← К форме</a>
</div>
</header>
<section class="kt-ai-section">
<div class="kt-ai-wrap" data-width="wide">
<div class="kt-ai-section-head">
<h2>Заявки на мероприятие</h2>
<p id="total">Загружаем…</p>
</div>
<div class="kt-ai-card table-wrap" style="margin-top:var(--kt-ai-space-7)">
<table>
<thead>
<tr><th>#</th><th>ФИО</th><th>Подразделение</th><th>Должность</th><th>Телефон</th><th>Email</th><th>Гости</th><th>Комментарий</th><th>Дата</th></tr>
</thead>
<tbody id="rows"></tbody>
</table>
</div>
</div>
</section>
<script>
fetch("/api/registrations").then(r => r.json()).then(function (items) {
document.getElementById("total").textContent = "Всего заявок: " + items.length;
document.getElementById("rows").innerHTML = items.map(function (i, n) {
function esc(s) { return String(s || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); }
return "<tr><td class='num'>" + (n + 1) + "</td><td>" + esc(i.fio) + "</td><td>" + esc(i.dept) +
"</td><td>" + esc(i.position) + "</td><td>" + esc(i.phone) + "</td><td>" + esc(i.email) +
"</td><td>" + (i.guests > 0 ? "+" + i.guests : "—") + "</td><td>" + esc(i.comment) +
"</td><td class='num'>" + (i.date || "").slice(0, 16).replace("T", " ") + "</td></tr>";
}).join("") || "<tr><td colspan='9'>Пока никто не зарегистрировался</td></tr>";
});
</script>
</body>
</html>