<?php
/**
 * Controles compartidos para listados DataTables ya existentes.
 * Variables: $saFilters = ['search_id','search_placeholder','length_id','clear_id'].
 */
$saFilters = isset($saFilters) && is_array($saFilters) ? $saFilters : [];
$searchId = $saFilters['search_id'] ?? 'recordsSearch';
$lengthId = $saFilters['length_id'] ?? 'recordsLength';
$clearId = $saFilters['clear_id'] ?? 'clearRecordsFilters';
?>
<div class="sa-records-filters sa-records-filters--compact">
    <div class="sa-filter-field sa-filter-field--search">
        <label for="<?= sa_e($searchId) ?>"><i class="fas fa-magnifying-glass"></i> Buscar</label>
        <div class="sa-filter-control"><i class="fas fa-magnifying-glass"></i><input type="search" id="<?= sa_e($searchId) ?>" data-sa-table-search data-clear-placeholder placeholder="<?= sa_e($saFilters['search_placeholder'] ?? 'Nombre, correo, concepto o identificación') ?>"></div>
    </div>
    <div class="sa-filter-field sa-filter-field--per-page">
        <label for="<?= sa_e($lengthId) ?>"><i class="fas fa-list-ol"></i> Mostrar</label>
        <select id="<?= sa_e($lengthId) ?>" data-sa-table-length><option value="100">100 registros</option><option value="200">200 registros</option><option value="400">400 registros</option><option value="all">Todos</option></select>
    </div>
    <div class="sa-filter-actions"><button type="button" class="sa-btn sa-btn--secondary" id="<?= sa_e($clearId) ?>"><i class="fas fa-eraser"></i> Limpiar</button></div>
</div>
