<div class="">
    <div class="page-title">
        <div class="title_left">
            <h3>Especialidad</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>Actualizar especialidad</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-md-right">
                                <label class="text-sm-left" for="nombre">Nombre
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-12 col-xs-12">
                                <input type="text" id="nombre" name="nombre" required="required"
                                    class="form-control form-control-sm" value="{{ $esp->nombre_esp }}">
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_nom" 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-md-right">
                                <label class="text-sm-left" for="clave">Clave
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-12 col-xs-12">
                                <input type="text" id="clave" name="clave" required="required"
                                    class="form-control form-control-sm" value="{{ $esp->clave_esp }}">
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_clave" 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-md-right">
                                <label class="text-sm-left" for="planestudios">Plan de
                                    estudios
                                    <span class="required">*</span>
                                </label>

                            </div>
                            <div class="col-md-4 col-sm-12 col-xs-12">
                                <select id="planestudios" name="planestudios" required="required"
                                    class="form-control form-control-sm">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($planest as $pe)
                                        @if ($pe->cve_planest == $esp->planestudio->cve_planest)
                                            <option value="{{ $pe->cve_planest }}" selected>
                                                {{ $pe->claveOfi_planest }}</option>
                                        @else
                                            <option value="{{ $pe->cve_planest }}">{{ $pe->claveOfi_planest }}
                                            </option>
                                        @endif
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_planest" 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-md-right">
                                <label class="text-sm-left" for="fechaIni">A
                                    partir de la
                                    fecha
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-12 col-xs-12">
                                <div class="input-group date" id="myDatepicker">
                                    <input id="fecha_inicio" name="fechaInicio"
                                        class="date-picker form-control form-control-sm" type="date"
                                        value="{{ $esp->fechaIni_esp }}" required="required">
                                </div>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_fechaIni" 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-md-right">
                                <label class="text-sm-left" for="fechafin">Hasta
                                    la fecha
                                    <span class="required">*</span>
                                </label>

                            </div>
                            <div class="col-md-4 col-sm-12 col-xs-12">
                                <input id="fecha_fin" name="fechaFin" class="date-picker form-control form-control-sm"
                                    type="date" value="{{ $esp->fechaFin_esp }}" required="required">
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_fechaFin" style="display: none">
                                </div>
                            </div>
                        </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="update_especialidad(this.form,{{ $esp->cve_esp }})"
                                            class="btn btn-success btn-block" form="form-nueva"><i
                                                class=" fa fa-pencil"></i> Actualizar </button>
                                    </div>
                                    <div class="col">
                                        <button class="btn btn-dark btn-block" type="button"
                                            onclick="listado_especialidad()"><i class="fa fa-times"></i>
                                            Cancelar</button>
                                    </div>
                                </div>
                                <div class="col-md-3 col-sm-12"></div>
                            </div>
                    </form>
                    <br>

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