@extends('layouts.index')
@section('contenido')
<div class="content">
	<div class="card">
        <div class="card-header header-elements-inline">
            <h5 class="card-title">LISTADO DE PARRILLAS</h5>
            <div class="header-elements">
                <div class="list-icons">
                    <a href="{{ route('marketing.create_parrilla') }}" class="btn btn-link btn-float text-default">
                        <i class="icon-file-plus2 text-primary"></i><span>Nueva parrilla</span>
                    </a>
                    <a class="list-icons-item" data-action="collapse"></a>
                </div>
            </div>
        </div>
        <table id="tablaJS" class="table datatable-basic">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Parrilla</th>
                    <th>Línea</th>
                    <th>Especialidad</th>
                    <th>Fecha inicio</th>
                    <th>Fecha final</th>
                    <th class="text-center">Acciones</th>
                </tr>
            </thead>
            <tbody>

                    
                        @foreach ($parrillas as $parrilla)
                        <tr class="{{strtotime($parrilla->fecha_final)<$fecha_actual?'':'table-success'}}">
                            <td>{{$parrilla->id}}</td>
                            <td>{{$parrilla->nombre}}</td>
                            <td>{{$parrilla->parrilla_linea->descripcion_linea}}</td>
                            <td>{{$parrilla->parrilla_especialidad->descripcion_especialidad}}</td>
                            <td>{{$parrilla->fecha_inicio}}</td>
                            <td>{{$parrilla->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('marketing.ver_parrilla',$parrilla->id)}}" class="dropdown-item">Ver parrilla</a>
                                            <a href="{{route('marketing.duplicar_parrilla',$parrilla->id)}}" class="dropdown-item">Duplicar</a>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        @endforeach


                    
            </tbody>
        </table>
    </div>
</div>
@endsection

@section('javascript')
<script>
    jQuery( document ).ready(function() {
       
    });
</script>
@endsection
