<?php 
require_once ("includes/topo.php");  ?>

<div class="content-body">
    <div class="container-fluid">
        <div class="row">
            <div class="col-xl-12">
                <div class="row">
                    
                <div class="col-xl-12 col-lg-12">
                        <a href="usuarios.php" class="btn btn-primary btn-sm">Voltar</a>
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">Adicionar novo usuário</h4>
                                
                            </div>
                            <div class="card-body">
                                <div class="basic-form">
                                    <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">

                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Nome</label>
                                            <div class="col-sm-9">
                                                <input type="text" name="nome" class="form-control" value="<?php echo $nome; ?>" placeholder="Nome">
                                                
                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Usuário</label>
                                            <div class="col-sm-9">
                                                <input type="text" name="username" class="form-control <?php echo (!empty($username_err)) ? 'is-invalid' : ''; ?>" value="<?php echo $username; ?>" placeholder="Usuário">
                                                <span class="invalid-feedback"><?php echo $username_err; ?></span>
                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Senha</label>
                                            <div class="col-sm-9">
                                                <input type="password" name="password" class="form-control <?php echo (!empty($password_err)) ? 'is-invalid' : ''; ?>" value="<?php echo $password; ?>" placeholder="Senha">
                                                <span class="invalid-feedback"><?php echo $password_err; ?></span>
                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Confirmar senha</label>
                                            <div class="col-sm-9">
                                                <input type="password" name="confirm_password" class="form-control <?php echo (!empty($confirm_password_err)) ? 'is-invalid' : ''; ?>" value="<?php echo $confirm_password; ?>" placeholder="Confirmar senha">
                                                <span class="invalid-feedback"><?php echo $confirm_password_err; ?></span>
                                            </div>
                                        </div>
                                        
                                        
                                        <div class="mb-3 row">
                                            <div class="col-sm-10">
                                                <button type="submit" class="btn btn-primary">Criar usuário</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
					</div>
                
                </div>
            </div>
            
        </div>
    </div>
</div>

<?php require_once ("includes/rodape.php");  ?>