rpg-westreiche/westreiche_website/views/admin_spells.php

57 lines
2.2 KiB
PHP

<?php
/** @var string $school */
/** @var int $grade */
/** @var string $needle */
/** @var array $spells */
?>
<div class="page-head">
<div>
<h1>Zauber &amp; Liturgien</h1>
<p class="lede">Aus dem Vault übernommen (Arkan und Klerikal). Spieler wählen daraus beim Bogen aus.</p>
</div>
<a class="btn btn-ghost" href="<?= e(url('/admin/users')) ?>">Zurück</a>
</div>
<section class="panel">
<form method="get" action="<?= e(url('/admin/spells')) ?>" class="inline-form">
<label class="field">
<span>Schule</span>
<select name="school">
<option value="arkan"<?= $school === 'arkan' ? ' selected' : '' ?>>Arkan</option>
<option value="klerikal"<?= $school === 'klerikal' ? ' selected' : '' ?>>Klerikal</option>
</select>
</label>
<label class="field" style="max-width:8rem">
<span>Grad</span>
<select name="grade">
<option value="0">alle</option>
<?php for ($g = 1; $g <= 9; $g++): ?>
<option value="<?= $g ?>"<?= $grade === $g ? ' selected' : '' ?>><?= $g ?></option>
<?php endfor; ?>
</select>
</label>
<label class="field grow">
<span>Suche</span>
<input type="search" name="q" value="<?= e($needle) ?>" maxlength="60">
</label>
<button class="btn" type="submit">Filtern</button>
</form>
</section>
<section class="panel">
<p class="muted"><?= count($spells) ?> Einträge</p>
<table class="data">
<thead><tr><th>Grad</th><th>Name</th><th>Klasse</th><th>Dauer</th><th>Reichweite</th></tr></thead>
<tbody>
<?php foreach ($spells as $spell): ?>
<tr>
<td class="num"><?= (int) $spell['grade'] ?></td>
<td><?= e((string) $spell['name']) ?></td>
<td class="muted"><?= e((string) $spell['classes']) ?></td>
<td class="muted"><?= e((string) $spell['duration']) ?></td>
<td class="muted"><?= e((string) $spell['range_text']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</section>