<div class="">
    <div class="page-title">
        <div class="title_left">
            <h3>Grupo</h3>
        </div>
    </div>

    <div class="clearfix"></div>

    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>Registrar un nuevo grupo</h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form id="form-nueva" data-parsley-validate class="form-horizontal form-label-left"
                        enctype="multipart/form-data">
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label for="periodo" class="text-sm-left">Periodo
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <select id="periodo" name="periodo" required="required" class="form-control">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($periodo as $p)
                                        <option value="{{ $p->id }}">{{ $p->nombre }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_periodo" style="display: none">
                                </div>
                            </div>
                        </div>

                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="reticula">Retícula <span
                                        class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <select id="reticula" name="reticula" required="required" class="form-control">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($reticula as $r)
                                        <option value="{{ $r->cve_rec }}">{{ $r->nombre_rec }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_reticula" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="carrera">Carrera
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <select id="carrera" name="carrera" required="required" class="form-control">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($car as $c)
                                        <option value="{{ $c->id }}">{{ $c->nombre }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>

                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_carrera" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="grupo">Grupo
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <input type="text" id="grupo" name="grupo" required="required" class="form-control">
                            </div>

                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_grupo" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="campus">Campus
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <input type="text" id="campus" name="campus" required="required" class="form-control">
                            </div>

                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_campus" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="departamento">Departamento
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <select id="departamento" name="departamento" required="required"
                                    class="form-control">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($deto as $d)
                                        <option value="{{ $d->id }}">{{ $d->nombre }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>

                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_depto" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="semestre">Semestre <span
                                        class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <input type="text" id="semestre" name="semestre" required="required"
                                    class="form-control">
                            </div>

                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_semestre" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="materia">Materia
                                    (Clave
                                    interna) <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <select id="materia" name="materia" required="required" class="form-control">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($mat as $m)
                                        <option value="{{ $m->cve_mat }}">{{ $m->nombre_mat }} -
                                            {{ $m->clave_mat }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_materia" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="x_title">
                            <h2>Agregar grupo paralelo</h2>
                            <div class="clearfix"></div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="carrerad">Carrera
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <select id="carrerad" name="carrerad" required="required" class="form-control">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($car as $c)
                                        <option value="{{ $c->id }}">{{ $c->nombre }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="noest">No. de
                                    estudiantes
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <input type="text" id="noest" name="noest" required="required" class="form-control">
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_noest" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-sm-right">
                                <label class="text-sm-left" for="clavemat">Clave
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <input type="text" id="clavemat" name="clavemat" required="required"
                                    class="form-control">
                            </div>
                            <div class="col-md-2 col-sm-2 col-xs-12">
                                <button type="button" class="btn btn-secondary btn-block" onclick="mas_grupoParalelo()"><i
                                        class="fa fa-plus"></i>
                                </button>
                            </div>

                            <div class="col-md-2 col-sm-2 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_clavemat" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div id="contenedor_grupoParalelo" class="mb-1 row">
                        </div>
                        <div class="ln_solid"></div>
                        <div class="mb-1 row">
                            <div class="col-md-3 col-sm-12"></div>
                            <div class="col-md-6 col-sm-12">
                                <div class="row">
                                    <div class="col">
                                        <button type="button" onclick="add_carrera(this.form)"
                                            class="btn btn-success btn-block" form="form-nueva"><i
                                            class=" fa fa-pencil"></i> Guardar</button>
                                    </div>
                                    <div class="col">
                                        <button class="btn btn-dark btn-block" type="button"
                                            onclick="listado_grupo()"><i class="fa fa-times"></i> Cancelar</button>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-12"></div>
                        </div>
                    </form>
                    <br>

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