<?php
require_once '../Clases/db.php';
require_once '../Clases/Categoria.php';
$mostrar = new categorias ();
$categorias = $mostrar->getAllDelete();
?>

<!DOCTYPE html>
<html>
      <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

            <!--##::Link del DataTables::##-->
            <link href="../DataTables/datatables.min.css" rel="stylesheet">
      </head>

<div class="modal fade" id="eliminadacat" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"
data-bs-backdrop="static" data-bs-keyboard="false">
  <div class="modal-dialog modal-xl">
    <div class="modal-content">
      <div class="modal-header">
        <h1 class="modal-title fs-5" id="exampleModalLabel">Categorias Eliminadas </h1>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body">
      
            <table id="myTable1" class="table table-dark table-striped w-100" >
                <thead>
                        <tr>
                        <td>ID</td>
                        <td>Nombre</td>
                        <td>Acciones</td>                         
                        </tr>
                </thead>
                      <tbody>
                           <?php foreach ($categorias as $categoria) { ?>
                                 <tr>
                                     <td><?php echo $categoria['ID']; ?></td>
                                     <td><?php echo $categoria['Nombre']; ?></td>
                                     <td>
                                         <button type="submit" class="btn btn-success btnRestaurar" data-bs-dismiss="modal" id=" <?php echo $categoria['ID']; ?> ">
                                             <i class="bi bi-arrow-counterclockwise"></i></button>
                                     </td>
                                  </tr>
                                      
                            <?php } ?>
                    </tbody>
          </table>


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

    <script src="../ArchivosJS/jquery-3.6.0.min.js"></script> 
   
    <script src="../DataTables/datatables.min.js"></script>

    <script type="text/javascript">
    $(document).ready( function () {
    $('#myTable1').DataTable({
        language: {
            processing:     "Tratamiento en curso...",
            search:         "Buscar:" ,
            lengthMenu:    "Filtro de _MENU_ categorias",
            info:           "Mostrando de la categoria _START_ al _END_ de un total de _TOTAL_ categorias",
            infoEmpty:      "No existen registros",
            infoFiltered:   "(filtrado de _MAX_ categorias en total)",
            infoPostFix:    "",
            loadingRecords: "Cargando elementos...",
            zeroRecords:    "No se encontraron los datos de tu busquda..",
            emptyTable:     "No hay ningun registro en la tabla",
            paginate: {
                first:      "Primero",
                previous:   "Anterior",
                next:       "Siguiente",
                last:       "Ultimo"
            },
            aria: {
                sortAscending:  ": Active para odernar en modo ascendente",
                sortDescending: ": Active para ordenar en modo descendente  ",
            }
         }
       } );
      } );
     </script>
</html>