@extends('template.layout')

@section('content')
    @include('sweet::alert')
    <h1 class="page-title">
        Gesti&oacute;n de Bolsa de trabajo
    </h1>
    <div class="portlet light portlet-fit portlet-datatable bordered">

        <div class="portlet-body">

            <div class="portlet light portlet-fit portlet-form bordered">
                <div class="portlet-title col-lg-12 col-xs-12" style="padding: 25px 25px 25px 25px;">
                    <div class="caption">
                        <span class="caption-subject font-green sbold uppercase"> Alumnos candidatos </span>
                    </div>
                </div>

                <div class="col-lg-12 col-xs-12" style="padding: 25px 25px 25px 25px;">

                    <div class="col-lg-3">
                        <span class="caption-subject uppercase">Especialidad: </span>

                        <select class="bs-select form-control" id="selectEspecialidad">
                            @foreach($especialidad as $item)
                                <option value="{{$item->id}}">{{$item->nombre}}</option>
                            @endforeach
                        </select>
                    </div>

                    <div class="col-lg-2">
                        <span class="caption-subject uppercase">Ciclo: </span>

                        <select class="bs-select form-control" id="selectCiclo">
                            @foreach($ciclo as $item)
                                <option value="{{$item->id}}">{{$item->nombre}}</option>
                            @endforeach
                        </select>
                    </div>

                    <div class="col-lg-1">
                        <button class="btn blue btn-outline sbold" onclick="filter()" style="margin-top: 20px;">Aplicar</button>
                    </div>


                </div>

                @if(count($alumnos) > 0)
                    <div id="divalumnos">

                        <div class="row margin-bottom-20 stories-cont">
                            @foreach($alumnos as $item)
                                <div class="col-lg-4 col-md-6">
                                    <div class="portlet light">
                                        <div class="photo">
                                            @if($item->urlimage == null)
                                                <img src="{{asset('img/demo/perfil.jpg')}}" alt=""
                                                     class="img-responsive"/>
                                            @else
                                                <img src="{{asset($item->urlimagen)}}" alt=""
                                                     class="img-responsive"/>
                                            @endif
                                        </div>
                                        <div class="title">
                                                <span> {{$item->apellido_paterno}} {{$item->apellido_materno}}
                                                    , {{$item->nombres}}</span>
                                        </div>
                                        <div class="desc">
                                            <span> {{$item->descripcion}} </span>
                                            <div class="row">
                                                <a type="button"
                                                   href="{{url('bolsatrabajo/usuario/detalle',['id' => $item->id ])}}"
                                                   class="btn green featured-price sbold uppercase price-button">
                                                    Ver Detalle
                                                </a>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        </div>

                        <div class="row margin-bottom-20 stories-cont" style="margin-left: 20px;">
                            {{ $alumnos->links() }}
                        </div>

                    </div>
                @else
                    <div class="row"></div>
                    <div class="portlet-body">
                        <div class="well" style="text-align: center;"> No se encontraron alumnos candidatos.</div>
                    </div>
                @endif

            </div>

        </div>

    </div>

    <script>
        function filter() {

            var cicloid = $("#selectCiclo").val();

            var especialidadid = $("#selectEspecialidad").val();

            window.location.href = "{{url('gestionbolsa/tbalumnos')}}" + "/" + especialidadid + "/" + cicloid;


        }

    </script>

@endsection