<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">Documentos de pago</h4>

            <div class="page-title-right">
                <ol class="breadcrumb m-0">
                    <li class="breadcrumb-item"><a href="javascript: void(0);">Recursos Humanos</a></li>
                    <li class="breadcrumb-item">Pago de empleados</li>
                    <li class="breadcrumb-item active">Documentos de pago</li>
                </ol>
            </div>

        </div>
    </div>
</div>

<div class="card">
    <div class="card-body pt-1">
        <form id="documentosPago-form" name="documentosPago-form" accept-charset="utf-8" class="needs-validation" novalidate>
            <div class="row">
                <div class="col-sm-12 col-md-12 col-lg-4">
                    <div class="row">
                        <div class="col-sm-12 col-md-6 col-lg-4">
                            <label for="cbo-anio" class="form-label">Año <span class="required">*</span></label>
                            <select id="cbo-anio" name="cbo-anio" class="form-select form-select-sm" required>
                                <option value="">Seleccione</option>
                            </select>
                            <div class="invalid-feedback">
                                Seleccione un año
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-6 col-lg-8">
                            <label for="cbo-tipoPlanilla" class="form-label">Tipo de planilla <span class="required">*</span></label>
                            <select id="cbo-tipoPlanilla" name="cbo-tipoPlanilla" class="form-select form-select-sm" required>
                                <option value="">Seleccione</option>
                            </select>
                            <div class="invalid-feedback">
                                Seleccione un tipo de planilla
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12 col-md-12 col-lg-4">
                    <label for="cbo-planilla" class="form-label">Planilla <span class="required">*</span></label>
                    <select id="cbo-planilla" name="cbo-planilla" class="form-control form-control-sm selectpicker" data-live-search="true" required>
                        <option value="">Seleccione</option>
                    </select>
                    <div class="invalid-feedback">
                        Seleccione una planilla
                    </div>
                </div>
                <div class="col-sm-12 col-md-12 col-lg-3">
                    &nbsp;
                    <div class="row" style="margin-top: 2px !important;">
                        <div class="col-sm-12 col-md-6 col-lg-5">
                            <div class="d-grid">
                                <button type="button" id="btn-enviar" class="btn btn-sm btn-primary waves-effect waves-light">
                                    <i class="fas fa-paper-plane"></i> Enviar
                                </button>
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-6 col-lg-5">
                            <div class="d-grid">
                                <button type="button" id="btn-descargar" class="btn btn-sm btn-info waves-effect waves-light">
                                    <i class="fas fa-download"></i> Descargar
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <div class="row mt-3">
            <div class="col-12">
                <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="#contenedor-departamentos" role="tab">
                            <span class="d-block d-sm-none"><i class="fas fa-users"></i></span>
                            <span class="d-none d-sm-block">Departamentos</span>
                        </a>
                    </li>
                </ul>
                <div class="tab-content text-muted">
                    <div class="tab-pane active" id="contenedor-departamentos" role="tabpanel">
                        <div class="row">
                            <div class="col-12">
                                <table class="table table-sm table-bordered" id="departamentos-tbl" style="text-align:center; width:100% !important;">
                                    <thead>
                                        <tr>
                                            <th class="text-center">ID</th>
                                            <th>
                                                <div class="d-flex justify-content-center">
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="checkbox" value="" id="chk-todosDepartamentos">
                                                        <label class="form-check-label" for="chk-todosDepartamentos">

                                                        </label>
                                                    </div>
                                                </div>
                                            </th>
                                            <th class="text-center">Email</th>
                                            <th class="text-center">Generación</th>
                                            <th>Departamento</th>
                                            <th class="text-center">Número de empleados</th>
                                            <th class="text-center">Empleados con correo</th>
                                            <th class="text-center">Enviados</th>
                                            <th class="text-center">Generados</th>
                                            <th class="text-center">Acciones</th>
                                        </tr>
                                    </thead>
                                    <tbody>

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

<div class="modal fade" id="modal-empleados" data-bs-backdrop="static" data-bs-keyboard="false">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">EMPLEADOS - <span id="spn-departamento"></span></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body pt-1">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <h5 id="spn-periodo"></h5>
                        <hr />
                    </div>
                    <div class="col-sm-12 col-md-12">
                        <table class="table table-sm table-bordered" id="empleados-tbl" style="text-align:center; width:100% !important;">
                            <thead>
                                <th class="text-center">N°</th>
                                <th class="text-center">Email</th>
                                <th class="text-center">Generación</th>
                                <th>Puesto</th>
                                <th>Nombre completo</th>
                                <th>Email</th>
                                <th>Líquido a pagar</th>
                                <th class="text-center">Acciones</th>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-email" data-bs-backdrop="static" data-bs-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Configuración de correo</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body pt-1">
                <form id="correo-form" name="correo-form" accept-charset="utf-8" method="POST" novalidate class="needs-validation">
                    <div class="row">
                        <div class="col-sm-12 col-md-12">
                            <label for="txt-empleado" class="form-label">Empleado <span class="required">*</span></label>
                            <input type="text" class="form-control form-control-sm" id="txt-empleado" name="txt-empleado" placeholder="Nombre del empleado" required readonly />
                            <div class="invalid-feedback">
                                Ingrese el nombre del empleado
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-12">
                            <label for="txt-email" class="form-label">Correo <span class="required">*</span></label>
                            <div class="input-group input-group-sm has-validation">
                                <input type="text" pattern="(?!.*@.*$).*" class="form-control form-control-sm float-end text-end" id="txt-email" name="txt-email" placeholder="Correo electrónico" required />
                                <span class="input-group-text" id="spnDominioEmail">@</span>
                                <div class="invalid-feedback">
                                    Ingrese un correo electrónico válido
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-sm btn-primary" form="correo-form">Guardar</button>
                <button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Cerrar</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-descripcion" data-bs-backdrop="static" data-bs-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Configuración de descripción</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body pt-1">
                <form id="descripcion-form" name="descripcion-form" accept-charset="utf-8" method="POST" novalidate class="needs-validation">
                    <div class="row">
                        <div class="col-sm-12 col-md-12">
                            <label for="txt-empleado-descripcion" class="form-label">Empleado <span class="required">*</span></label>
                            <input type="text" class="form-control form-control-sm" id="txt-empleado-descripcion" name="txt-empleado-descripcion" placeholder="Nombre del empleado" required readonly />
                            <div class="invalid-feedback">
                                Ingrese el nombre del empleado
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-12">
                            <label for="txt-descripcion" class="form-label">Descripción <span class="required">*</span></label>
                            <textarea class="form-control form-control-sm" id="txt-descripcion" name="txt-descripcion" required rows="3"></textarea>
                            <div class="invalid-feedback">
                                Por favor ingrese la descripción
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-sm btn-primary" form="descripcion-form">Guardar</button>
                <button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Cerrar</button>
            </div>
        </div>
    </div>
</div>

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