@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/winner/list')}}"  class="btn btn-custom  waves-effect waves-light"  >All Winners <span class="m-l-5"><i class="fa fa-list" aria-hidden="true"></i></span></a>
                </div>
                <h4 class="page-title">Update winner</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 Winner</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@winnerUpdate', $winneredit->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">
                                            {{-- <input class="form-control" name="title"  type="text" value="{{$winneredit->title}}"/> --}}
                                            <select class="form-control" name="title">
                                                <option selected>Please Select title</option>
                                                @foreach($sessions as $session)
                                                    <option value="{{$session->id}}" @if($session->id == $winneredit->session_id) selected @endif</option>{{$session->title}}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Categories <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <select class="form-control" name="categories" value="">
                                                <option selected>Please Select categories</option>
                                                <option value="Champion" @if($winneredit->categories == "Champion") selected @endif>Champion</option>
                                                <option value="First Runner-Up" @if($winneredit->categories == "First Runner-Up") selected @endif>First Runner-Up</option>
                                                <option value="Second Runner-Up" @if($winneredit->categories == "Second Runner-Up") selected @endif>Second Runner-Up</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Winner Name <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="winnername"  type="text" value="{{$winneredit->winnername}}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Institute Name <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="institutename"  type="text" value="{{$winneredit->institutename}}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Address <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="address"  type="text" value="{{$winneredit->address}}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Mobile <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="mobile"  type="text" value="{{$winneredit->mobile}}"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Email <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <input class="form-control" name="email"  type="text" value="{{$winneredit->email}}"/>
                                        </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="{{$winneredit->image}}" />
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-lg-2 control-label">Status <i style="color: red;">*</i></label>
                                        <div class="col-lg-10">
                                            <select class="form-control" name="status" value="{{$winneredit->status}}">
                                                <option value="" selected>Please Select Status</option>
                                                <option value="active" @if($winneredit->status == "active") selected @endif>Active</option>
                                                <option value="inactive" @if($winneredit->status == "inactive") selected @endif>Inactive</option>
                                            </select>
                                        </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
 