<?php require APPROOT . '/views/inc/header.php'; ?>
<div class="row">
    <div class="col-md-6 mx-auto">
        <div class="card bg-light mt-5">
            <div class="card-header card-text">
                <h2 class="card-text">Registro de Cuenta</h2>
            <p class="card-text">Complete este formulario para registrarse con nosotros</p>
            </div>
        
            <div class="card-body">
                <form method="post" action="<?php echo URLROOT2 ;?>/users/register">
                    <div class="form-group">
                        <label for="name">Nombre<sub>*</sub></label>
                        <input type="text" name="name" class="form-control form-control-lg <?php echo (!empty($data['name_err'])) ? 'is-invalid' : '' ;?>" value="<?php echo $data['name'] ;?>">
                        <span class="invalid-feedback">Introduzca Nombre</span>
                    </div>

                    <div class="form-group">
                        <label for="email">Correo Electr&oacute;nico<sub>*</sub></label>
                        <input type="email" name="email" class="form-control form-control-lg <?php echo (!empty($data['email_err'])) ? 'is-invalid' : '' ;?>" value="<?php echo $data['email'] ;?>">
                        <span class="invalid-feedback">Introduzca Correo...<!--<?php echo $data['email_err'] ;?> --></span>
                    </div>
                    
                    <div class="form-group">
                        <label for="password">Contrase&ntilde;a<sub>*</sub></label>
                        <input type="password" name="password" class="form-control form-control-lg <?php echo (!empty($data['password_err'])) ? 'is-invalid' : '' ;?>" value="<?php echo $data['password'] ;?>">
                        <span class="invalid-feedback">Introduzca Contrase&ntilde;a...<!--<?php echo $data['password_err'] ;?>--> </span>
                    </div>

                    <div class="form-group">
                        <label for="confirm_password">Confirma Contrase&ntilde;a<sub>*</sub></label>
                        <input type="password" name="confirm_password" class="form-control form-control-lg <?php echo (!empty($data['confirm_password_err'])) ? 'is-invalid' : '' ;?>" value="<?php echo $data['confirm_password'] ;?>">
                        <span class="invalid-feedback">Introduzca Confirmaci&oacute;n de Contrase&ntilde;a...</span>
                    </div>
                    <div class="form-group">
                        <div class="row">
                            <div class="col">
                                <input type="submit" class="btn btn-success btn-block pull-left" value="Registrar">
                            </div>
                            <div class="col">
                                <a href="<?php echo URLROOT2 ;?>/users/login" class="btn btn-light btn-block pull-right">Iniciar sesi&oacute;n</a>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<?php require APPROOT . '/views/inc/footer.php'; ?>