<?= $this->layout('_layout', ['title' => $title]); ?>

<main class="main">
    <?= $this->insert('includes/aside_info') ?>
    <div class="content">
        <div class="h2-title h2-title-content flex-s-c">
            <span>My Account</span>
        </div>

        <?= $this->insert('user/_user'); ?>
        <br>

        <div class="h2-title h2-title-content flex-s-c">
            <span>Manage Character</span>
        </div>


        <div>
            <?php if ($character) : ?>

                <div class="my-avatar-manage">
                    <img src="<?= __avatar($character['image']) ?>" alt="">
                </div>


                <ul class="_links">
                    <li><a class="button" href="<?= __redirect('user/manage/nick/' . $character['name']) ?>">Nick</a></li>
                    <li><a class="button" href="<?= __redirect('user/manage/class/' . $character['name']) ?>">Class</a></li>
                    <li><a class="button" href="<?= __redirect('user/manage/move/' . $character['name']) ?>">Move </a></li>
                    <li><a class="button" href="<?= __redirect('user/manage/avatar/' . $character['name']) ?>">Image</a></li>
                </ul>


                <div class="p-1 bg-neutral-200/80 mt-4">
                    <table class="w-full">
                        <tbody class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700">
                            <tr class="bg-white border-b">
                                <td colspan="2" class="px-6 py-4 font-bold text-gray-900 bg-gray-200">Character: <?= $character['name'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Strength:</td>
                                <td class="px-6 py-4" align="right"><?= $character['strength'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Dexterity:</td>
                                <td class="px-6 py-4" align="right"><?= $character['dexterity'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Vitality:</td>
                                <td class="px-6 py-4" align="right"><?= $character['vitality'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Energy:</td>
                                <td class="px-6 py-4" align="right"><?= $character['energy'] ?></td>
                            </tr>
                            <?php if ($character['command']) : ?>
                                <tr class="bg-white border-b">
                                    <td class="px-6 py-4 font-bold text-gray-900">Command:</td>
                                    <td class="px-6 py-4" align="right"><?= $character['command'] ?></td>
                                </tr>
                            <?php endif; ?>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Map:</td>
                                <td class="px-6 py-4" align="right"><?= maps[$character['map']]['name'] ?> (<?= $character['mapx'] ?> x <?= $character['mapy'] ?>)</td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Class:</td>
                                <td class="px-6 py-4" align="right"><?= characters["classes"][$character['class']]['name'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Level:</td>
                                <td class="px-6 py-4" align="right"><?= $character['level'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Resets:</td>
                                <td class="px-6 py-4" align="right"><?= $character['resets'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">MResets:</td>
                                <td class="px-6 py-4" align="right"><?= $character['mresets'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Killer:</td>
                                <td class="px-6 py-4" align="right"><?= $character['killer'] ?></td>
                            </tr>
                            <tr class="bg-white border-b">
                                <td class="px-6 py-4 font-bold text-gray-900">Hero:</td>
                                <td class="px-6 py-4" align="right"><?= $character['hero'] ?></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            <?php endif; ?>

        </div>
    </div>
</main>