{{ csrf_field() }}
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title"></h3>
    </div>

    <div class="box-body">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    {!! Form::label('name', 'Nome:') !!}
                    {!! Form::text('name', null, array('class' => 'form-control title')) !!}
                </div>                
            </div>
            <div class="col-md-6" style="display:none">
                <div class="form-group">
                    {!! Form::label('position', 'Posizione:') !!}<br>
                    {{isset($_GET["position"]) ? $_GET["position"] : $adv->position}}
                    <input type="hidden" name="position" value="{{isset($_GET["position"]) ? $_GET["position"] : $adv->position}}">
                </div>                
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    {!! Form::label('google_code', 'Codice Google:') !!}
                    {!! Form::text('google_code', null, array('class' => 'form-control')) !!}
                </div>                
            </div>
        </div>
        <h4>Oppure</h4>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    {!! Form::label('image', 'Immagine:') !!}
                    <div class="custom-file-upload">{!! Form::file('image', null, array('class' => 'form-control')) !!}</div>
                    @if (isset($adv) && $adv->image != '')
                        <br><img src="/files/adv/{{$adv->image}}" style="max-width:250px" />
                    @endif
                </div>                
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    {!! Form::label('jingle', 'Jingle:') !!}
                    <div class="custom-file-upload">{!! Form::file('jingle', null, array('class' => 'form-control')) !!}</div>
                    @if (isset($adv) && $adv->jingle != '')
                        
                    @endif
                </div>                
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    {!! Form::label('url', 'Url:') !!}
                    {!! Form::text('url', null, array('class' => 'form-control')) !!}
                </div>                
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    {!! Form::label('online', 'Online:') !!}<br>
                    {!! Form::checkbox('online', 'on', null) !!}
                </div>                
            </div>
        </div>
    </div>

    <div class="box-footer">
        @if(Auth::user()->only_read == false)
            {!! Form::submit($submit_text, ['class'=>'btn btn-success']) !!}
        @endif
        {!! link_to_route('sections.advs.index', 'Annulla', $section, array('class' => 'btn btn-info')) !!}
    </div>
</div>

@section('extra_js')

    <script>
        
        $(function () {

        
            
        });

    </script>
@stop