<nav class="navbar navbar-expand-lg navbar-dark bg-cdark rounded">
    <div class="container-fluid">
        <button class="navbar-toggler collapsed" type="button" data-toggle="collapse"
            data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse mb-" id="bs-example-navbar-collapse-1">
            <form class="navbar-form navbar-left" style="width: 100%;" id="form-materia">
                <div class="row">
                    {{ $existe = '' }}
                    {{ $existe2 = '' }}
                    {{ $existe3 = '' }}

                    <div class="col-md-3 col-sm-12">
                        @if (array_key_exists('nombre', $data))
                            @php
                                $existe = $data['nombre'];
                            @endphp
                        @endif
                        <input type="text" id="f_nombre" name="f_nombre" class="form-control form-control-sm"
                            placeholder="Nombre" value="{{ $existe }}">
                    </div>
                    <div class="col-md-3 col-sm-12">
                        @if (array_key_exists('clave', $data))
                            @php
                                $existe2 = $data['clave'];
                            @endphp
                        @endif
                        <input type="text" id="f_clave" name="f_clave" class="form-control form-control-sm"
                            placeholder="Clave" value="{{ $existe2 }}">
                    </div>
                    <div class="col-md-3 col-sm-12">
                        <select name="f_planest" id="f_planest" class="form-control form-control-sm">
                            <option value>.:PlandeEstudios:.</option>
                            @foreach ($planest as $pe)
                                @php
                                    $s2 = '';
                                @endphp
                                @if (array_key_exists('planest', $data))
                                    @if ($data['planest'] == $pe->cve_planest)
                                        @php
                                            $s2 = 'selected';
                                            $existe3 = $pe->cve_planest;
                                        @endphp
                                    @endif
                                @endif
                                <option value="{{ $pe->cve_planest }}" {{ $s2 }}>
                                    {{ $pe->claveOfi_planest }}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="col-md-3 col-sm-12 text-center">
                        <button type="button" class="btn btn-info btn-sm" form="form-materia" data-toggle="tooltip"
                            data-placement="top" title="" data-original-title="Buscar"
                            onclick="filtro_materia(this.form)"><i class="fa fa-search"></i></button>
                        <a
                            href="/exportarMateriaPdf?nombre={{ $existe }}&clave={{ $existe2 }}&planest={{ $existe3 }}">
                            <button type="button" class="btn btn-danger btn-sm" data-toggle="tooltip"
                                data-placement="top" title="" data-original-title="Descargar XLSX"><i
                                    class="fa fa-file-pdf-o"></i></button>
                        </a>
                        <a
                            href="/exportarMateriaExcel?nombre={{ $existe }}&clave={{ $existe2 }}&planest={{ $existe3 }}">
                            <button type="button" class="btn btn-success btn-sm" data-toggle="tooltip"
                                data-placement="top" title="" data-original-title="Descargar XLSX"><i
                                    class="fa fa-file-excel-o"></i></button>
                        </a>
                        <button type="button" class="btn btn-light btn-sm" form="form-materia" data-toggle="tooltip"
                            data-placement="top" title="" data-original-title="Limpiar"
                            onclick="limpiar_materia()"><i class="fa fa-undo"></i></button>

                    </div>
                </div>
            </form>
        </div>
    </div>
</nav>
