<?php $r="../../";
require_once($r."inc/funciones.php");
$title = "Nuevo Usuario";
validNotSession($r);
$mysqli = connectDB($r);
$spe=$_SESSION['perfil'];
roleaccess(1210);
$error="";
?>
<!DOCTYPE html>
<html lang="en">
  <?php include $r."inc/head.php"; ?>
<body class="fixed-nav sticky-footer  sidenav-toggled  bg-dark" id="page-top">
  <?php include $r."inc/nav.php"; ?>
  
  <div class="content-wrapper">
    <div class="container-fluid">
      <h2 class="text-center"><i class="fa fa-gears"></i> NUEVO ADMINISTRADOR</h2><hr/>
      <form id="formulario" name="nuevo" action="acciones.php" method="post">
        <h6>INFORMACION PERSONAL</h6><hr/>
        <div class="form-group row">
            <label for="nombre" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Nombres y apellidos</label>
            <div class="col-sm-9">
                <input type="text" class="form-control" id="nombre" name="nombre" value="<? if($row1["nombre"]!=""){echo $row1["nombre"]; } ?>" placeholder="Nombres y apellidos" autocomplete="off" required>
            </div>
        </div>
        <div class="form-group row">
            <label for="cedula" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Cédula</label>
            <div class="col-sm-9">
                <input type="number" class="form-control" id="cedula" name="cedula" value="<? if($row1["cedula"]!=""){echo $row1["cedula"]; } ?>" maxlength="14" placeholder="Número identificación personal" autocomplete="off" required>
            </div>
        </div>
        <div class="form-group row">
            <label for="telefono" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Número de contacto</label>
            <div class="col-sm-9">
                <input type="number" class="form-control" id="telefono" name="telefono" value="<? if($row1["telefono"]!=""){echo $row1["telefono"]; } ?>" maxlength="14" placeholder="Número de celular" autocomplete="off" required>
            </div>
        </div>
        <div class="form-group row">
            <label for="correo" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Correo Electrónico</label>
            <div class="col-sm-9">
                <input type="email" class="form-control" id="correo" name="correo" value="<? if($row1["correo"]!=""){echo $row1["correo"]; } ?>" placeholder="Correo Electrónico" autocomplete="off">
            </div>
        </div> 
        <div class="form-group row">
            <label for="correo" class="col-sm-2 col-form-label"><span class="text-danger h5">*</span>Perfil</label>
            <div class="col-sm-9">
                <select class="form-control" name="perfil">
                    <option selected disabled>Seleccione el Perfil de Usuarios...</option>
                    <? $sqlperfiles = $mysqli->query("SELECT * FROM z_perfiles WHERE administrables=1");
                    while($rowperfil = $sqlperfiles->fetch_assoc()) { ?><option value="<?= $rowperfil['id']; ?>"><?= $rowperfil['nombre']; ?></option><? } ?>
                    
                </select>
            </div>
        </div>
        <input type="hidden" name="nuevo" value="nuevo">
        <hr/>
        <button type="submit" class="btn btn-primary float-right">CREAR</button>
        <button type="button" onclick="history.back()" class="btn btn-danger float-left">ATRAS</button>
      </form>
    </div>
  </div>
  <? include $r."inc/foot.php"; ?>
</body>
</html>