@extends('template.layout')

@section('content')
    @include('sweet::alert')
    <h1 class="page-title">
        Reporte de deudores
    </h1>
    <div class="portlet light portlet-fit portlet-datatable bordered">

        <div class="portlet-body">

            <div class="tab-content">

                <div style="padding: 6% 6% 6% 6%;">
                    <table class="table table-hover nowrap dataTable dtr-inline collapsed tbdeudabiblioteca"
                           id="tbdeudabiblioteca" width="100%" role="grid"
                           aria-describedby="tbdeudabiblioteca_info">
                        <thead class="thead-default">
                        <tr>
                            <th> Nombre usuario</th>
                            <th> Rol</th>
                            <th>Concepto</th>
                            <th>Total a pagar</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($deudoresbiblioca as $item)
                            <tr>
                                <td> {{ $item->apellido_paterno }} {{ $item->apellido_materno }}
                                    , {{ $item->nombres }}</td>
                                <td> {{ $item->Roles }} </td>
                                <td> Sanción por no entregar el libro a tiempo</td>
                                <td> {{ $item->MontoDeuda }} </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>

            </div>

        </div>

    </div>


@endsection
@section('scripts')
    <script>
        $('#tbdeudabiblioteca').DataTable({
            "lengthMenu": [[25, 20, 50, -1], [25, 20, 50, "Todas"]],
            bFilter: true,
            "bLengthChange": false,
            bInfo: true,
            responsive: true,
            "autoWidth": true,
            "language": {
                "lengthMenu": "Mostrar _MENU_ Entradas",
                "zeroRecords": "No se encontraron registros",
                "info": "Mostrando la página _PAGE_ de _PAGES_",
                "infoEmpty": "No hay registros disponibles",
                "infoFiltered": "(filtrado de _MAX_ registros totales)",
                "search": "Buscar: ",
                "paginate": {
                    "first": "Primero",
                    "last": "Último",
                    "next": "Siguiente",
                    "previous": "Anterior"
                },
            },
            "order": [],
            "aoColumns": [
                {"bSearchable": true},
                {"bSearchable": true},
                {"bSearchable": true},
                {"bSearchable": false},
            ],
            "columns": [
                {"orderable": true},
                {"orderable": true},
                {"orderable": true},
                {"orderable": false},
            ],
            dom: 'Bfrtip',
            buttons: [
                {
                    extend: 'excel',
                    title: 'Reporte de deudores'
                }, {
                    extend: 'pdf',
                    title: 'Reporte de deudores'
                }

            ]
        });


    </script>
@endsection
