@extends('admin.layouts.app')
@section('header-script')
    @include('admin.layouts.forms-header-script')
@endsection

    @section('content')
        <div class="row">
            <div class="col-sm-12">
                <div class="btn-group pull-right m-t-25">
                    <a  href="{{URL::to('admin/event/list')}}"  class="btn btn-custom  waves-effect waves-light"  >All events <span class="m-l-5"><i class="fa fa-list" aria-hidden="true"></i></span></a>
                </div>
                <h4 class="page-title">Update Events</h4>
                @foreach (['danger', 'warning', 'success', 'info'] as $key)
                    @if(Session::has($key))
                        <p class="alert alert-{{ $key }}"><i class="fa fa-info-circle" style="color: #fe6271;"></i> {{ Session::get($key) }}</p>
                    @endif
                @endforeach
            </div>
        </div>
        
        <div class="row">
            <div class="col-sm-12">
                <div class="card-box">
                    <h4 class="header-title m-t-0 m-b-30">Update Event</h4>
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="p-20">
                                <form class="form-horizontal" enctype="multipart/form-data" method="POST"
                                    action="{{action('AdminController@eventUpdate', $eventedit->id)}}">
                                    {{ csrf_field() }}
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Title <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <select class="form-control" name="title">
                                                <option selected>Please Select title</option>
                                                @foreach($sessions as $session)
                                                    <option value="{{$session->id}}" @if($session->id == $eventedit->title) selected @endif</option>{{$session->title}}</option>
                                                @endforeach
                                            </select>
                                            <!--<input class="form-control" name="title"  type="text" value="{{$eventedit->title}}"/>-->
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Images <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <small   class="form-text text-muted">Image Width 1050px &amp; Height 300px</small>
                                            <input type="file" name="image" id="filer_input2" value="{{$eventedit->image}}" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Event Category <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <select class="form-control" name="event_category" value="">
                                                <option selected>Please Select Category</option>
                                                <option value="upcoming" @if($eventedit->event_category == "upcoming") selected @endif>Upcoming</option>
                                                <option value="running" @if($eventedit->event_category == "running") selected @endif>Running</option>
                                                <option value="completed" @if($eventedit->event_category == "completed") selected @endif>Completed</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Start Date <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="start_date"  type="date" value="{{$eventedit->start_date}}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">End Date <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="end_date"  type="date" value="{{$eventedit->end_date}}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Location <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="location"  type="text" value="{{$eventedit->location}}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Description<i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <textarea  id="editor" class="form-control" name="descriptions">{{$eventedit->descriptions}}</textarea>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label"></label>
                                        <div class="col-lg-10">
                                            <button type="submit" class="btn btn-custom btn-bordred waves-effect waves-light w-md m-b-5 pull-left"><i class="fa  fa-save"></i> Update</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    @endsection

 @section('footer-script')
     @include('admin.layouts.form-elements-footer-script')
 @endsection
 