@extends('layouts.index')
@section('contenido')
<div class="content">
	<div class="card">
        <div class="card-header header-elements-inline">
            <h5 class="card-title">PLANIFICACIÓN DE SUPERVISIÓN</h5>
            <div class="header-elements">
                <div class="list-icons">
                    <a href="{{ route('marketing.create_gerente_producto') }}" class="btn btn-link btn-float text-default">
                        <i class="icon-file-plus2 text-primary"></i><span>Nueva planificación</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>APM</th>
                    <th>Gerente</th>
                    <th>Giras</th>
                    <th>Fecha inicio</th>
                    <th>Fecha final</th>
                    <th class="text-center">Acciones</th>
                </tr>
            </thead>
            <tbody>
                @foreach ($planificaciones as $planificacion)
                    <tr>
                        <td>{{$planificacion['id']}}</td>
                        <td>{{$planificacion->apm['primer_nombre']}} {{$planificacion->apm['primer_apellido']}}</td>
                        <td>{{$planificacion->gerente['primer_nombre']}} {{$planificacion->gerente['pirmer_apellido']}}</td>
                        <td>
                            @foreach ($planificacion->planificaciones_giras as $gira)
                                <span class="badge badge-success">{{$gira->gira['descripcion_gira']}}</span>
                            @endforeach
                        </td>
                        <td>{{$planificacion['fecha_inicio']}}</td>
                        <td>{{$planificacion['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="#" class="dropdown-item"><i class="icon-pencil6"></i> Editar</a>
                                        <a href="#" class="dropdown-item"><i class="icon-trash"></i> Eliminar</a>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@endsection

@section('javascript')
<script>
    jQuery( document ).ready(function() {

    });
</script>
@endsection
