@extends('layouts.index')
@section('contenido')
<div class="content">
	<div class="card">
		<div class="card-header header-elements-inline">
			<h5 class="card-title">NUEVA PLANIFICACIÓN DE SUPERVISIÓN</h5>
			<div class="header-elements">
				<div class="list-icons">
				    <a class="list-icons-item" data-action="collapse"></a>
				</div>
			</div>
		</div>

		<div class="card-body">
			<form action="{{ route('marketing.guardar_planificacion_supervision') }}" method="POST">
                @csrf
                <fieldset>
                    <div class="form-group">
                        <label>Seleccione Gerente Producto</label>
                        <select class="form-control" name="id_gerente">
                            @foreach ($gerentesProductos as $gerente)
                                <option value="{{$gerente['id']}}">{{$gerente['primer_nombre']}} {{$gerente['segundo_nombre']}} {{$gerente['primer_apellido']}} {{$gerente['segundo_apellido']}}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="collapse show">
                        <div class="form-group">
                            <label>Ingrese la cantidad</label>
                            <input type="text" class="form-control" name="cantidad" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label>Seleccione GIRAS</label>
                        <select multiple="multiple" class="form-control select" name="id_giras[]">
                            @foreach ($giras as $gira)
                                <option value="{{$gira['id']}}">{{$gira['descripcion_gira']}}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="form-group">
                        <label>Seleccione APM</label>
                        <select class="form-control" name="id_apm">
                            @foreach ($apms as $apm)
                                <option value="{{$apm['id']}}">{{$apm['primer_nombre']}} {{$apm['segundo_nombre']}} {{$apm['primer_apellido']}} {{$apm['segundo_apellido']}}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="form-group">
                        <label>Fecha inicio:</label>
                        <div class="input-group">
                            <span class="input-group-prepend">
                                <span class="input-group-text"><i class="icon-calendar22"></i></span>
                            </span>
                            <input type="text" class="form-control daterange-single" name="fecha_inicio" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label>Fecha final:</label>
                        <div class="input-group">
                            <span class="input-group-prepend">
                                <span class="input-group-text"><i class="icon-calendar22"></i></span>
                            </span>
                            <input type="text" class="form-control daterange-single" name="fecha_final" value="">
                        </div>
                    </div>

                </fieldset>

				<div class="text-right">
					<button type="submit" class="btn btn-primary">Guardar asignación<i class="icon-floppy-disk ml-2"></i></button>
				</div>
            </form>

		</div>
	</div>
</div>

@endsection

@section('javascript')
<script>
    jQuery( document ).ready(function() {
        $('.select').select2({
            minimumResultsForSearch: Infinity
        });
    });
</script>
@endsection
