@extends('template.layout')

@section('content')
    <h1 class="page-title">
        Gestión de Eventos
    </h1>
    <div class="portlet light portlet-fit portlet-datatable bordered" style="padding-top: 25px;">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green sbold uppercase"> Editar eventos </span>
            </div>
        </div>
        <div class="portlet-body">
            @include('alerts.index')
            <div class="form-horizontal">
                <div class="form-group hidden">
                    {!! Form::label('id', 'id:', ['class' => 'control-label']) !!}
                    {!! Form::text('id', null, ['class' => 'form-control','required'=>'required']) !!}
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="form-group col-lg-6 col-xs-6" style="margin-right: 10px;">
                            {!! Form::label('nombre', 'Nombre:', ['class' => 'control-label']) !!}
                            <p>{{ $evento->nombre }}</p>
                        </div>
                        <div class="form-group col-lg-6 col-xs-6" style="margin-right: 10px;">
                            {!! Form::label('lugar', 'Lugar:', ['class' => 'control-label']) !!}
                            <p>{{ $evento->lugar }}</p>
                        </div>
                        <div class="form-group col-lg-6 col-xs-6" style="margin-right: 10px;">
                            {!! Form::label('fecha_inicio', 'Fecha Inicio:', ['class' => 'control-label']) !!}
                            <p>{{ $evento->fecha_inicio }}</p>
                        </div>
                        <div class="form-group col-lg-6 col-xs-6" style="margin-right: 10px;">
                            {!! Form::label('fecha_fin', 'Fecha Fin:', ['class' => 'control-label']) !!}
                            <p>{{ $evento->fecha_fin }}</p>
                        </div>
                        <div class="form-group col-lg-6 col-xs-6" style="margin-right: 10px;">
                            {!! Form::label('costo', 'Costo:', ['class' => 'control-label']) !!}
                            <p>{{ $evento->costo == 0.00 ? "Gratis" : "No" }}</p>
                        </div>
                        <div class="form-group col-lg-6 col-xs-6" style="margin-right: 10px;">
                            {!! Form::label('pago', 'Pago:', ['class' => 'control-label']) !!}
                            <p>{{ $evento->pago == 1 ? "Si" : "No" }}</p>
                        </div>
                    </div>
                </div>
                <div class="form-actions" style="text-align: center; padding-top: 50px;">
                    <button type="button" id="inscritos" data-id="{{ $evento->id }}" class="btn green confirm">Ver inscritos</button>
                    <button type="button" id="regresar" class="btn red cancel" btnCancel="N">Regresar</button>
                </div>
            </div>

        </div>
    </div>
@endsection

@section('scripts')
    <script>
        $('#inscritos').on('click',function(){
            var id = $(this).data('id');
            window.location.href = "{{ url('evento/inscrito') }}"+"/"+ id;
        });

        $('#regresar').on('click',function(){
            window.location.href = "{{ url('evento') }}";
        });
    </script>
@endsection