<?= $this->layout('_theme', ['title' => $title, 'subtitle' => 'Editando personagem: ' . $character->name]); ?>

<div class="p-4 bg-gray-100 rounded-lg">
    <form action="<?= __redirect('administration/auth/character/edit') ?>">
        <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="hidden" name="name" value="<?= $character->name ?>">
        <div>
            <p class="px-1 py-3 text-[13px]">Level</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="level" placeholder="Digite aqui o valor da força" maxlength="5" value="<?= $character->level ?>">
        </div>
        <div>
            <p class="px-1 py-3 text-[13px]">Força</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="strength" placeholder="Digite aqui o valor da força" maxlength="5" value="<?= $character->strength ?>">
        </div>
        <div>
            <p class="px-1 py-3 text-[13px]">Agilidade</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="dexterity" placeholder="Digite aqui o valor da agilidade" maxlength="5" value="<?= $character->dexterity ?>">
        </div>
        <div>
            <p class="px-1 py-3 text-[13px]">Vitalidade</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="vitality" placeholder="Digite aqui o valor da vitalidade" maxlength="5" value="<?= $character->vitality ?>">
        </div>
        <div>
            <p class="px-1 py-3 text-[13px]">Energia</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="energy" placeholder="Digite aqui o valor da energia" maxlength="5" value="<?= $character->energy ?>">
        </div>
        <?php if ($character->class == 64 or $character->class == 65) : ?>
            <div>
                <p class="px-1 py-3 text-[13px]">Comando</p>
                <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="command" placeholder="Digite aqui o valor do comando" maxlength="5" value="<?= $character->command ?>">
            </div>
        <?php endif; ?>
        <div>
            <p class="px-1 py-3 text-[13px]">Selecione a classe </p>
            <select class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" name="class" required>
                <option value="" selected> -- Selecione a nova classe</option>
                <?php foreach (characters['classes'] as $key => $class) : ?>
                    <option value="<?= $key ?>" <?= $key == $character->class ? 'selected' : '' ?>><?= $class['name'] ?></option>
                <?php endforeach; ?>
            </select>
        </div>

        <div>
            <p class="px-1 py-3 text-[13px]">Resets</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="resets" placeholder="Digite aqui o valor do resets" maxlength="5" value="<?= $character->resets ?>">
        </div>
        <div>
            <p class="px-1 py-3 text-[13px]">MResets</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="mresets" placeholder="Digite aqui o valor do master resets" maxlength="5" value="<?= $character->mresets ?>">
        </div>
        <div>
            <p class="px-1 py-3 text-[13px]">Kills</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="kills" placeholder="Digite aqui o valor do kills" maxlength="5" value="<?= $character->kills ?>">
        </div>
        <div>
            <p class="px-1 py-3 text-[13px]">Heros</p>
            <input class="rounded-sm p-2 my-1 text-xs w-full border border-neutral-400 focus:outline-none focus:bg focus:bg-neutral-100" type="number" name="hero" placeholder="Digite aqui o valor do heros" maxlength="5" value="<?= $character->hero ?>">
        </div>
        <button class="rounded-lg py-3 px-6 bg-sky-500 text-white block mt-4 mx-auto text-sm border-2 border-sky-400 hover:bg-sky-700 transition ease-in-out duration-500" type="submit">Salvar</button>
    </form>
</div>