<?php 
//activamos almacenamiento en el buffer
//ob_start();
//session_start();
if (!isset($_SESSION['nombre'])) {
  header("Location: login.html");
}else{
  if ($_SESSION['acceso']==1) {
 ?>
    <!-- Main content -->
    <section class="content">

      <!-- Default box -->
      <div class="row">
        <div class="col-md-12">
          <div class="box">
              <div class="box-header with-border">
                <button class="btn bg-green btn-app" onclick="mostrarform(true)" id="btnagregar"><i class="fa fa-plus-circle"></i>Agregar</button> 
                <div class="box-tools pull-right">
                  <h1 class="box-title">Configuración\Usuarios
                </div>
              </div>
              <!--box-header-->
              <!--centro-->
              <div class="panel-body table-responsive" id="listadoregistros">
                <table id="tbllistado" class="table table-striped table-bordered table-condensed table-hover">
                  <thead>
                    <th>Opciones</th>
                    <th>Nombre</th>
                    <th>Documento</th>
                    <th>Numero Documento</th>
                    <th>Telefono</th>
                    <th>Email</th>
                    <th>Login</th>
                    <th>Foto</th>
                    <th>Estado</th>
                  </thead>
                  <tbody>
                  </tbody>
                  <tfoot>
                    <th>Opciones</th>
                    <th>Nombre</th>
                    <th>Documento</th>
                    <th>Numero Documento</th>
                    <th>Telefono</th>
                    <th>Email</th>
                    <th>Login</th>
                    <th>Foto</th>
                    <th>Estado</th>
                  </tfoot>   
                </table>
              </div>
            <form action="" name="formulario" id="formulario" method="POST">
              <div class="panel-body" id="formularioregistros">
                <div class="form-group col-lg-12 col-md-12 col-xs-12">
                  <label for="">Nombre(*):</label>
                  <input class="form-control" type="hidden" name="idusuario" id="idusuario">
                  <input class="form-control" type="text" name="nombre" id="nombre" maxlength="100" placeholder="Nombre" required>
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Tipo Documento(*):</label>
                <select name="tipo_documento" id="tipo_documento" class="form-control select-picker" required>
                  <option value="RIF">RIF</option>
                  <option value="CEDULA">CÉDULA</option>
                </select>
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Número de Documento(*):</label>
                  <input type="text" class="form-control" name="num_documento" id="num_documento" placeholder="Documento" maxlength="20">
                </div>
                  <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Dirección</label>
                  <input class="form-control" type="text" name="direccion" id="direccion"  maxlength="70" placeholder="Dirección">
                </div>
                  <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Teléfono</label>
                  <input class="form-control" type="text" name="telefono" id="telefono" maxlength="20" placeholder="Número de teléfono">
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Email: </label>
                  <input class="form-control" type="email" name="email" id="email" maxlength="70" placeholder="email">
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Cargo</label>
                  <input class="form-control" type="text" name="cargo" id="cargo" maxlength="20" placeholder="Cargo">
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Login(*):</label>
                  <input class="form-control" type="text" name="login" id="login" maxlength="20" placeholder="nombre de usuario" required>
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Clave(*):</label>
                  <input class="form-control" type="password" name="clave" id="clave" maxlength="64" placeholder="Clave">
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label>Permisos</label>
                  <div class="checkbox">
                    <ul id="permisos" style="list-style: none;">
                    </ul>
                  </div>
                </div>
                <div class="form-group col-lg-6 col-md-6 col-xs-12">
                  <label for="">Imagen:</label>
                  <input class="form-control" type="file" name="imagen" id="imagen">
                  <input type="hidden" name="imagenactual" id="imagenactual">
                  <img src="" alt="" width="150px" height="120" id="imagenmuestra">
                </div>
              </div>
              <div class="box-footer" id="formularioregistros1">
                    <button class="btn bg-blue btn-app pull-right" type="submit" id="btnGuardar"><i class="fa fa-save"></i>  Guardar</button>
                    <button class="btn bg-red btn-app pull-right" onclick="cancelarform()" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button>
              </div>
            </form>
            <!--fin centro-->
          </div>
        </div>
      </div>
      <!-- /.box -->

    </section>
    <!-- /.content -->
  </div>
  <?php 
  }else{
    require 'vistas/contenidos/noacceso-view.php'; 
  }
  ?>
          <!-- Main Footer -->
          <?php include "vistas/modulos/mainfooter.php";?>
      </div>

      <!-- ./wrapper -->
      <!-- REQUIRED JS SCRIPTS -->
      <?php include "vistas/modulos/script.php";?>
 <script src="vistas/scripts/usuario.js"></script>
 </body>
  </html> 
<?php  
}
  ob_end_flush();
?>