Files
CRM-IKZ/app/Views/admin/boards/edit.php
T
2026-07-14 08:19:56 +04:00

85 lines
3.0 KiB
PHP

<h1 class="h3 mb-3">Редактирование доски</h1>
<?php if (!empty($_SESSION['success'])): ?>
<div class="alert alert-success">
<?= htmlspecialchars($_SESSION['success']) ?>
</div>
<?php unset($_SESSION['success']); ?>
<?php endif; ?>
<?php if (!empty($_SESSION['error'])): ?>
<div class="alert alert-danger">
<?= htmlspecialchars($_SESSION['error']) ?>
</div>
<?php unset($_SESSION['error']); ?>
<?php endif; ?>
<div class="card shadow-sm">
<div class="card-body">
<form method="post" action="/admin/boards/update">
<input type="hidden" name="id" value="<?= (int)$board['id'] ?>">
<div class="mb-3">
<label class="form-label">Название</label>
<input
type="text"
name="name"
class="form-control"
value="<?= htmlspecialchars((string)$board['name']) ?>"
required
>
</div>
<div class="mb-3">
<label class="form-label">Код</label>
<input
type="text"
name="code"
class="form-control"
value="<?= htmlspecialchars((string)$board['code']) ?>"
required
>
<div class="form-text">Используется в URL, например: /boards/supply</div>
</div>
<div class="mb-3">
<label class="form-label">Описание</label>
<textarea
name="description"
class="form-control"
rows="4"
><?= htmlspecialchars((string)($board['description'] ?? '')) ?></textarea>
</div>
<div class="form-check mb-3">
<input
class="form-check-input"
type="checkbox"
name="is_active"
id="is_active"
<?= (int)$board['is_active'] ? 'checked' : '' ?>
>
<label class="form-check-label" for="is_active">
Активная доска
</label>
</div>
<div class="form-check mb-3">
<input
class="form-check-input"
type="checkbox"
name="show_on_home"
id="show_on_home"
<?= (int)$board['show_on_home'] ? 'checked' : '' ?>
>
<label class="form-check-label" for="show_on_home">
Показывать на главной
</label>
</div>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-success">Сохранить</button>
<a href="/admin/boards" class="btn btn-secondary">Назад</a>
</div>
</form>
</div>
</div>