<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Список работников</title>
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body { background-color: #f8f9fa; }
.search-block { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.table-wrapper { overflow-x: auto; margin-bottom: 20px; }
/* Классическая таблица с границами */
table.table-bordered { border: 2px solid #dee2e6; }
table.table-bordered th, table.table-bordered td { border: 1px solid #dee2e6; vertical-align: middle; }
thead.table-dark th { background-color: #343a40; color: white; }
</style>
</head>
<body>
<div class="container mt-4">
<h2 class="mb-4 text-center"> Список работников</h2>
{% if rows %}
<div class="table-wrapper">
<table class="table table-bordered table-hover">
<thead class="table-dark">
<tr>
{% for col in columns %}
<th>{{ col }}</th>
{% endfor %}
<th class="text-center">Действие</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
{% for cell in row %}
<td>{{ cell }}</td>
{% endfor %}
<td class="text-center">
<a href="/employee/{{ row[0] }}/posobiya" class="btn btn-success btn-sm">Выбрать</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="alert alert-info">Нет данных для отображения.</div>
{% endif %}
<!-- Поиск под таблицей -->
<div class="search-block mt-3">
<form method="get" action="/" class="row g-3">
<div class="col-md-4">
<label for="tabnum" class="form-label">Табельный номер</label>
<input type="text" class="form-control" id="tabnum" name="tabnum"
value="{{ search_tabnum }}" placeholder="Например, 06520001">
</div>
<div class="col-md-4">
<label for="fam" class="form-label">Фамилия</label>
<input type="text" class="form-control" id="fam" name="fam"
value="{{ search_fam }}" placeholder="Иванов">
</div>
<div class="col-md-4 d-flex align-items-end">
<button type="submit" class="btn btn-primary w-100">Поиск</button>
<a href="/" class="btn btn-outline-secondary ms-2 w-100">Сбросить</a>
</div>
</form>
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>