Dragon-Knight/templates/admin/edit_level.php
Valithor Obsidion 4d5c345528 functions.php
2025-08-14 15:47:25 -04:00

34 lines
2.0 KiB
PHP

<h2>Edit Level <?php echo $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="<?php echo $level['id'] ?>">
<table>
<colgroup><col><col></colgroup>
<tbody>
<tr>
<td>ID:</td>
<td><?php echo $level['id'] ?></td>
</tr>
<tr><td colspan="2"></td></tr>
<?php foreach ([1, 2, 3] as $n): ?>
<?php $class_name = DragonKnight\env("class_{$n}_name"); ?>
<tr><td><?php echo $class_name ?> EXP</td> <td><input type="number" name="<?php echo $n ?>_exp" value="<?php echo $level["{$n}_exp"] ?>"></td></tr>
<tr><td><?php echo $class_name ?> HP</td> <td><input type="number" name="<?php echo $n ?>_hp" value="<?php echo $level["{$n}_hp"] ?>"></td></tr>
<tr><td><?php echo $class_name ?> MP</td> <td><input type="number" name="<?php echo $n ?>_mp" value="<?php echo $level["{$n}_mp"] ?>"></td></tr>
<tr><td><?php echo $class_name ?> TP</td> <td><input type="number" name="<?php echo $n ?>_tp" value="<?php echo $level["{$n}_tp"] ?>"></td></tr>
<tr><td><?php echo $class_name ?> Strength</td> <td><input type="number" name="<?php echo $n ?>_strength" value="<?php echo $level["{$n}_strength"] ?>"></td></tr>
<tr><td><?php echo $class_name ?> Dexterity</td><td><input type="number" name="<?php echo $n ?>_dexterity" value="<?php echo $level["{$n}_dexterity"] ?>"></td></tr>
<tr><td><?php echo $class_name ?> Spells</td> <td><input type="number" name="<?php echo $n ?>_spells" value="<?php echo $level["{$n}_spells"] ?>"></td></tr>
<?php echo $n !== 3 ? '<tr><td colspan="2"></td></tr>' : '' ?>
<?php endforeach; ?>
</tbody>
</table>
<button type="submit">Save</button>
<button type="reset">Reset</button>
</form>