22 lines
814 B
PHP
22 lines
814 B
PHP
<?php if (!user()): ?>
|
|
<h2>Welcome!</h2>
|
|
<?php else: ?>
|
|
<?php if (char_count(user('id')) > 0): ?>
|
|
<h3>Characters</h3>
|
|
<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>
|
|
<?php endif; ?>
|