@extends('layouts.landing')

@section('title',"Crear")

@section('content')

<div class="container-fluid">
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <div class="d-sm-flex align-items-center justify-content-between">
                        <h6 class="m-0 font-weight-bold text-primary">Crear grupo</h6>
                        <a href="{{route('grupo.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
            </div>
        </div>

        <div class="card-body">
            <form action="{{route('grupo.store')}}" method="POST">
                @csrf
                <div class="mb-3">
                    <label for="status">Seleccionar Carrera</label>
                    <select class="form-control" name="plan_id">

                        <option value="">Seleccionar plan</option>

                        @foreach ($plans as $nivel => $grupo)
                            <optgroup label="{{ $nivel }}">
                                @foreach ($grupo as $plan)
                                    <option value="{{ $plan->id }}">
                                        {{ $plan->carreraRel->name }}
                                        ({{ $plan->name }}-{{ $plan->rvoe }})
                                    </option>
                                @endforeach
                            </optgroup>
                        @endforeach

                    </select>
                </div>

                <div class="mb-3">
                    <label for="status">Seleccionar turno</label>
                    <select class="form-control" name="turno">
                        <option value="0">Seleccionar turno</option>
                        @foreach ($turnos as $turno)
                        <option value="{{ $turno->id }}">{{$turno->name}}</option>
                        @endforeach
                    </select>
                </div>

                <div class="mb-3">
                    <label for="status">Seleccionar plantel</label>
                    <select class="form-control" name="plantel">
                        <option value="0">Seleccionar plantel</option>
                        @foreach ($planteles as $plantel)
                        <option value="{{ $plantel->id }}">{{$plantel->name}}</option>
                        @endforeach
                    </select>
                </div>

                <div class="mb-3">
                    <label for="status">Seleccionar status</label>
                    <select class="form-control" name="status" id="status">
                        <option value="1">Activo</option>
                        <option value="0">Inactivo</option>
                    </select>
                </div>

            <input class="btn btn-primary" type="submit" value="Crear">
            </form>
        </div>
    </div>
</div>

@endsection
