<?php include app()->basePath('app/Views/partials/header.php'); ?>

<section class="panel narrow">
    <p class="eyebrow">Modulo 1</p>
    <h1>Criar conta</h1>
    <form method="post" action="/register" class="form">
        <?= csrf_field() ?>
        <label>
            Nome completo
            <input name="name" value="<?= e((string) old('name')) ?>" required>
        </label>
        <label>
            Email
            <input type="email" name="email" value="<?= e((string) old('email')) ?>" required>
        </label>
        <label>
            Telefone
            <input name="phone" value="<?= e((string) old('phone')) ?>">
        </label>
        <label>
            Tipo de conta
            <select name="role" required>
                <option value="student" <?= old('role', 'student') === 'student' ? 'selected' : '' ?>>Aluno</option>
                <option value="instructor" <?= old('role') === 'instructor' ? 'selected' : '' ?>>Instrutor</option>
                <option value="institution" <?= old('role') === 'institution' ? 'selected' : '' ?>>Instituicao</option>
            </select>
        </label>
        <div class="grid two">
            <label>
                Provincia
                <input name="province" value="<?= e((string) old('province')) ?>">
            </label>
            <label>
                Cidade
                <input name="city" value="<?= e((string) old('city')) ?>">
            </label>
        </div>
        <label>
            Senha
            <input type="password" name="password" required minlength="8">
        </label>
        <label>
            Confirmar senha
            <input type="password" name="password_confirmation" required minlength="8">
        </label>
        <button class="button" type="submit">Criar conta</button>
    </form>
    <p class="small">Ja tem conta? <a href="/login">Entrar</a></p>
</section>

<?php include app()->basePath('app/Views/partials/footer.php'); ?>
