@extends('layouts.index')
@section('contenido')
<div class="content">
	<div class="card">
        <div class="card-header header-elements-inline">
            <h5 class="card-title">DISTRIBUCIÓN DE FICHERO</h5>
            <div class="header-elements">
                <div class="list-icons">
                    <a href="{{ route('fichero.buscar') }}" class="btn btn-link btn-float text-default">
                        <i class="icon-file-plus2 text-primary"></i><span>Nuevo Fichero</span>
                    </a>
                    <a class="list-icons-item" data-action="collapse"></a>
                </div>
            </div>
        </div>
        <table id="contenedorFarmacias" class="table">
            <thead>
                <tr>
                    <th>Nombre</th>
                    <th>Fecha inicio</th>
                    <th>Fecha Final</th>
                    <th class="text-center">Acciones</th>
                </tr>
            </thead>
            <tbody>
                @foreach ($distribucionFichero as $fichero)
                    <tr>
                        <td>{{$fichero['nombre_fichero']}}</td>
                        <td>{{$fichero['fecha_inicio']}}</td>
                        <td>{{$fichero['fecha_final']}}</td>
                        <td class="text-center">
                            <div class="list-icons">
                                <div class="dropdown">
                                    <a href="#" class="list-icons-item" data-toggle="dropdown">
                                        <i class="icon-menu9"></i>
                                    </a>

                                    <div class="dropdown-menu dropdown-menu-right">
                                        <a href="{{ route('fichero.editar',$fichero->id) }}" class="dropdown-item"><i class="icon-pencil6"></i> Editar</a>
                                        <a href="{{ route('fichero.eliminar',$fichero->id) }}" onclick="return eliminar(this)" class="dropdown-item"><i class="icon-trash"></i> Eliminar</a>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@endsection
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.5.6/css/buttons.dataTables.min.css"/>
<style>
    #contenedorFarmacias_filter{
        clear: both!important;
    }
    .dataTables_info{
        display: none;
    }
    .datatable-header .dataTables_filter{
        display: none!important;
    }
    #contenedorFarmacias_paginate{
        display: none!important;
    }
</style>
@section('javascript')
<script src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js"></script>

<script>
    

$(document).ready(function() {
    $('#contenedorFarmacias').DataTable({
        dom: 'Bfrtip <"datatable-header"fl><"datatable-scroll"t><"datatable-footer"ip>',
        buttons: [
            'excel','print'
        ],
    });
} );
</script>
@endsection


