@extends('layouts.index')
@section('contenido')
<div class="content">
	<div class="card">
        <div class="card-header header-elements-inline">
            <h5 class="card-title">LISTADO DE COMBOS</h5>
            <div class="header-elements">
                <div class="list-icons">
                    <a href="{{ route('marketing.create_combo') }}" class="btn btn-link btn-float text-default">
                        <i class="icon-file-plus2 text-primary"></i><span>Nuevo combo</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>Combo</th>
                    <th>Tipo Socio</th>
                    <th>Fecha inicio</th>
                    <th>Fecha final</th>
                    <th>EVA</th>
                    <th>Status</th>
                    <th class="text-center">Acciones</th>
                </tr>
            </thead>
            <tbody>
                @foreach ($combos as $combo)
                    <tr>
                        <td>{{$combo['id']}}</td>
                        <td>{{$combo['nombre']}}</td>
                        <td>
                            @foreach ($combo->tipo_socio as $socio)
                                <span class="badge badge-success">{{$socio->tipo_socio['descripcion_tipo_socio']}}</span>
                            @endforeach
                        </td>
                        <td>{{$combo['fecha_inicio']}}</td>
                        <td>{{$combo['fecha_final']}}</td>
                        <td>{{$combo['eva']}}</td>
                        <td>
                            @if ($combo['status'])
                                Activo
                            @else
                                Inactivo
                            @endif
                        </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.editar_combo', $combo['id']) }}" class="dropdown-item"><i class="icon-pencil6"></i> Editar</a>
                                        <a href="{{ route('marketing.eliminar_combo', $combo['id']) }}" 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
