<div class="row">
    <div class="col-12">
        <div class="page-title-box d-sm-flex align-items-center justify-content-between">
            <h4 class="mb-sm-0">Gestión de usuarios</h4>

            <div class="page-title-right">
                <ol class="breadcrumb m-0">
                    <li class="breadcrumb-item">Sistema</li>
                    <li class="breadcrumb-item">Usuarios</li>
                    <li class="breadcrumb-item active">Gestión de usuarios</li>
                </ol>
            </div>

        </div>
    </div>
</div>
<div class="card">
    <div class="border">
        <ul class="nav nav-pills custom-hover-nav-tabs">
            <li class="nav-item">
                <a href="#contenedor-usuarios" data-bs-toggle="tab" aria-expanded="false" class="nav-link active" id="usuarios-tab">
                    <i class="fas fa-users nav-icon nav-tab-position"></i>
                    <h5 class="nav-titl nav-tab-position m-0">Usuarios</h5>
                </a>
            </li>
            <li class="nav-item">
                <a href="#contenedor-edicion" data-bs-toggle="tab" aria-expanded="true" class="nav-link disabled" id="editar-usuario-tab">
                    <i class="fas fa-user-edit nav-icon nav-tab-position"></i>
                    <h5 class="nav-titl nav-tab-position m-0">Edición</h5>
                </a>
            </li>
            <li class="nav-item ms-auto" id="btns-nuevo-usuario">
                <div class="h-100 pe-1 d-flex align-items-center">
                    <button class="btn btn-sm btn-primary btn-rounded waves-effect waves-light" id="btn-agregar-usuario" type="button">
                        <i class="fas fa-user-plus"></i>
                        <span>Nuevo usuario</span>
                    </button>
                </div>
            </li>
            <li class="nav-item ms-auto d-none" id="btns-guardar-usuario">
                <div class="h-100 pe-1 d-flex align-items-center">
                    <button class="btn btn-sm btn-primary btn-rounded waves-effect waves-light" id="btn-guardar-usuario" type="submit" form="usuario-form">
                        <i class="fas fa-save"></i>
                        <span>Guardar</span>
                    </button>
                    <button class="btn btn-sm btn-danger btn-rounded waves-effect waves-light ms-2" id="btn-cancelar-usuario" type="button">
                        <i class="fas fa-times"></i>
                        <span>Cancelar</span>
                    </button>
                </div>
            </li>
        </ul>
    </div>
    <div class="card-body pt-0">
        <div class="tab-content text-muted">
            <div class="tab-pane show active pt-3" id="contenedor-usuarios">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <table class="table table-bordered" id="usuarios-tbl" style="text-align:center; width:100% !important;">
                            <thead>
                                <tr>
                                    <th class="text-center">#</th>
                                    <th class="text-center">Foto</th>
                                    <th>Nombre completo</th>
                                    <th>Email</th>
                                    <th class="text-center">Fecha de creación</th>
                                    <th class="text-center">Último ingreso</th>
                                    <th class="text-center">Estado</th>
                                    <th class="text-center">Acciones</th>
                                </tr>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="contenedor-edicion">
                <div class="row">
                    <div class="col-sm-12 col-md-12 col-lg-6">
                        <form id="usuario-form" name="usuario-form" accept-charset="utf-8" method="POST" class="needs-validation" novalidate>
                            <fieldset class="w-auto border pt-0">
                                <legend>Datos generales</legend>
                                <div class="row">
                                    <div class="col-sm-12 col-md-6 col-lg-6">
                                        <div class="d-flex h-100 align-items-center justify-content-center">
                                            <img src="main/assets/images/users/default.png" alt="" class="img-thumbnail img-sized" id="img-foto-usuario">
                                        </div>
                                    </div>
                                    <div class="col-sm-12 col-md-6 col-lg-6">
                                        <div class="row">
                                            <div class="col-12 mayusculas">
                                                <label for="txt-username" class="form-label mt-0">Username <span class="required">*</span></label>
                                                <div class="input-group input-group-sm has-validation">
                                                    <input type="text" class="form-control" id="txt-username" name="txt-username" placeholder="Username" required>
                                                    <button class="btn btn-outline-secondary" type="button" id="btn-username-check" data-bs-toggle="tooltip" data-bs-placement="top" title="Verificar disponibilidad">
                                                        <i class="fas fa-check"></i>
                                                    </button>
                                                    <div class="invalid-feedback">
                                                        Por favor ingrese un username.
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-12">
                                                <label for="txt-nombres" class="form-label">Nombres <span class="required">*</span></label>
                                                <input type="text" class="form-control form-control-sm" id="txt-nombres" name="txt-nombres" placeholder="Nombres" required>
                                                <div class="invalid-feedback">
                                                    Por favor ingrese los nombres
                                                </div>
                                            </div>
                                            <div class="col-12">
                                                <label for="txt-apellidos" class="form-label">Apellidos <span class="required">*</span></label>
                                                <input type="text" class="form-control form-control-sm" id="txt-apellidos" name="txt-apellidos" placeholder="Apellidos" required>
                                                <div class="invalid-feedback">
                                                    Por favor ingrese los apellidos
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-12">
                                                <label for="txt-email" class="form-label">Email <span class="required">*</span></label>
                                                <input type="email" class="form-control form-control-sm" id="txt-email" name="txt-email" placeholder="Email" required>
                                                <div class="invalid-feedback">
                                                    Por favor ingrese un email válido.
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row" id="password-container">
                                            <div class="col-12">
                                                <label for="txt-contrasenia" class="form-label">Contraseña <span class="required">*</span></label>
                                                <input type="password" class="form-control form-control-sm" id="txt-contrasenia" name="txt-contrasenia" placeholder="Contraseña" required>
                                                <div class="invalid-feedback">
                                                    Por favor ingrese una contraseña.
                                                </div>
                                            </div>
                                            <div class="col-12">
                                                <label for="txt-confirmacion-contrasenia" class="form-label">Confirmar contraseña <span class="required">*</span></label>
                                                <input type="password" class="form-control form-control-sm" id="txt-confirmacion-contrasenia" name="txt-confirmacion-contrasenia" placeholder="Confirmar contraseña" required>
                                                <div class="invalid-feedback">
                                                    Por favor confirme la contraseña.
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                    <div class="col-sm-12 col-md-12 col-lg-6 pt-2">
                        <ul class="nav nav-pills arrow-navtabs nav-secondary bg-light mb-3" role="tablist">
                            <li class="nav-item">
                                <a class="nav-link active" data-bs-toggle="tab" href="#roles-container" role="tab">
                                    <span class="d-block d-sm-none"><i class="fas fa-user-cog"></i></span>
                                    <span class="d-none d-sm-block">Roles</span>
                                </a>
                            </li>
                            <li class="nav-item ms-auto">
                                <div class="h-100 d-flex pe-1 align-items-center">
                                    <button type="button" class="btn btn-primary btn-sm" id="btn-asignar-rol" title="Asignar rol">
                                        <i class="fas fa-plus"></i> Rol
                                    </button>
                                </div>
                            </li>
                        </ul>
                        <div class="tab-content text-muted">
                            <div class="tab-pane active" id="roles-container" role="tabpanel">
                                <div class="row">
                                    <div class="col-sm-12 col-md-12">
                                        <table class="table table-sm table-bordered" id="roles-tbl" style="text-align:center; width:100% !important;">
                                            <thead>
                                                <tr>
                                                    <th>#</th>
                                                    <th>Rol</th>
                                                    <th>Tipo de rol</th>
                                                    <th>Acciones</th>
                                                </tr>
                                            </thead>
                                            <tbody>

                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-rol" data-bs-keyboard="false" data-bs-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Configuración de rol</h4>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body pt-1">
                <form id="rol-form" name="rol-form" accept-charset="utf-8" method="POST" class="needs-validation" novalidate>
                    <div class="row">
                        <div class="col-sm-12 col-md-12" id="cbo-rol-container">
                            <label for="cbo-rol" class="form-label">Rol <span class="required">*</span></label>
                            <div class="form-group has-validation">
                                <select class="form-control selectpicker" title="" required id="cbo-rol" name="cbo-rol" data-live-search="true">
                                    <option value="" selected disabled>Seleccione</option>
                                </select>
                                <div class="invalid-feedback">
                                    Por favor seleccione un rol
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-12 d-none" id="txt-rol-container">
                            <label for="txt-rol" class="form-label">Rol <span class="required">*</span></label>
                            <input type="text" class="form-control" id="txt-rol" name="txt-rol" placeholder="Ingrese el rol">
                            <div class="invalid-feedback">
                                Por favor ingrese el rol
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-12">
                            <label for="cbo-tipo-rol" class="form-label">Tipo de rol <span class="required">*</span></label>
                            <select class="form-select" title="" required id="cbo-tipo-rol" name="cbo-tipo-rol" disabled>
                                <option selected disabled value="">Seleccione</option>
                            </select>
                            <div class="invalid-feedback">
                                Por favor seleccione el tipo de rol
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn btn-sm btn-primary" type="submit" form="rol-form">Guardar</button>
                <button class="btn btn-sm btn-secondary" type="button" data-bs-dismiss="modal">Cerrar</button>
            </div>
        </div>
    </div>
</div>

<?php
$jsModules = [
    'usuariosPage'
];
