DK2/templates/pages/home.php

22 lines
814 B
PHP
Raw Normal View History

<?php if (!user()): ?>
<h2>Welcome!</h2>
2024-09-27 18:45:33 -05:00
<?php else: ?>
<?php if (char_count(user('id')) > 0): ?>
<h3>Characters</h3>
2024-10-03 12:02:32 -05:00
<form action="/character/select" method="post">
<input type="hidden" name="csrf" value="<?= csrf() ?>">
<?php foreach (char_list(user('id')) as $id => $char): ?>
<input type="radio" name="char_id" value="<?= $id ?>" id="char_<?= $id ?>">
<label for="char_<?= $id ?>"><?= $char['name'] ?> (Level <?= $char['level'] ?>)</label><br>
<?php endforeach; ?>
<input type="submit" value="Select Character">
</form>
<?php endif; ?>
<form action="/character/create" method="post">
<input type="hidden" name="csrf" value="<?= csrf() ?>">
<input type="text" name="name" placeholder="Character Name">
<input type="submit" value="Create Character">
</form>
2024-09-27 18:45:33 -05:00
<?php endif; ?>