<?= $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>

        <?php if (plugin()->jewels) : ?>
            <div class="w-80 mx-auto">
                <form action="<?= __redirect("auth/coins/convete/to/jewel") ?>" method="post" class="p-2 m-auto w-full">
                    <?= __csrf(); ?>
                    <div class="fields">
                        <div class="fieldGroup">
                            <span>Quantity of jewelry <sup>*</sup></span>
                            <input type="number" name="quantity" required autocomplete="off" placeholder="0">
                        </div>

                        <div class="fieldGroup">
                            <span>Select currency <sup>*</sup></span>
                            <select name="coin">
                                <?php foreach (jewels_trade as $jewel) : ?>
                                    <option value="<?= $jewel ?>"><?= ucfirst($jewel) ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>

                    <button type="submit">To replace</button>
                </form>
            </div>
        <?php else : ?>
            <div class="p-1 bg-yellow-500 text-white text-center">Function disabled by administration</div>
        <?php endif; ?>
    </div>
</main>