Dragon-Knight/templates/admin/edit_level.php

34 lines
1.8 KiB
PHP

<h2>Edit Level <?= $level['id'] ?></h2>
Experience values for each level should be the cumulative total amount of experience up to this point. All other values should be only the new amount to add this level.<br><br>
<form action="/admin/levels" method="post" hx-post="/admin/levels" hx-target="#main">
<input type="hidden" name="save" value="true">
<input type="hidden" name="level" value="<?= $level['id'] ?>">
<table>
<colgroup><col><col></colgroup>
<tbody>
<tr>
<td>ID:</td>
<td><?= $level['id'] ?></td>
</tr>
<tr><td colspan="2"></td></tr>
<?php foreach ([1, 2, 3] as $n): ?>
<?php $class_name = env("class_{$n}_name"); ?>
<tr><td><?= $class_name ?> EXP</td> <td><input type="number" name="<?= $n ?>_exp" value="<?= $level["{$n}_exp"] ?>"></td></tr>
<tr><td><?= $class_name ?> HP</td> <td><input type="number" name="<?= $n ?>_hp" value="<?= $level["{$n}_hp"] ?>"></td></tr>
<tr><td><?= $class_name ?> MP</td> <td><input type="number" name="<?= $n ?>_mp" value="<?= $level["{$n}_mp"] ?>"></td></tr>
<tr><td><?= $class_name ?> TP</td> <td><input type="number" name="<?= $n ?>_tp" value="<?= $level["{$n}_tp"] ?>"></td></tr>
<tr><td><?= $class_name ?> Strength</td> <td><input type="number" name="<?= $n ?>_strength" value="<?= $level["{$n}_strength"] ?>"></td></tr>
<tr><td><?= $class_name ?> Dexterity</td><td><input type="number" name="<?= $n ?>_dexterity" value="<?= $level["{$n}_dexterity"] ?>"></td></tr>
<tr><td><?= $class_name ?> Spells</td> <td><input type="number" name="<?= $n ?>_spells" value="<?= $level["{$n}_spells"] ?>"></td></tr>
<?= $n !== 3 ? '<tr><td colspan="2"></td></tr>' : '' ?>
<?php endforeach; ?>
</tbody>
</table>
<button type="submit">Save</button>
<button type="reset">Reset</button>
</form>