@extends('layouts.master')
@section('page_title')
    @if(isset($page_title))
        {{ $page_title }}
    @endif
@endsection
@section('content')
  <div class="">
    <div class="page-title">
      <div class="title_left" style="width:800px !important;">
        <ol class="breadcrumb">
          <li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
          <li class="active"><a href="{!! url('generaldocuments') !!}">General Documents</a></li>
          <li class="active">Update Document Details</li>
        </ol>
      </div>
    </div>
    <div class="clearfix"></div>
      <div class="row">
        <div class="col-md-6 col-sm-12 col-xs-12">
          <div class="x_panel">
              <div class="x_title">
                Update Document Details
                @include('commons.notifications')
                <div class="clearfix"></div>
              </div>
              {{-- start of content --}}
              <div class="x_content">
              <br>
                  {!! Form::model($document, [
                    'method' => 'PATCH',
                    'url' => ['generaldocuments', $document->id],
                    'files' => 'true',
                    'class' => 'form-horizontal form-label-left'
                  ]) !!}
                  <div class="row">
                    <div class="col-md-12">
                      <div class="form-group">            
                        <div class=" {{ $errors->has('how_we_got_client_other') ? 'has-error' : ''}}">
                          <label class="" for="documentOneName">Document Name</label>
                          {!! Form::text('name', old('name'), ['class' => 'form-control' , 'id' => 'documentOneName', 'placeholder' => 'Enter name of document']) !!}
                          {!! $errors->first('document_one_name', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                    </div>
                    <div class="col-md-12">
                      <div class="form-group">
                        <div class=" {{ $errors->has('document_one') ? 'has-error' : ''}}">
                          <label class="" for="documentOne">First Document</label>
                          {!! Form::file('document_one', null, ['class' => 'form-control' , 'id' => 'documentOne', 'placeholder' => 'Select file to upload']) !!}
                          {!! $errors->first('document_one', '<p class="help-block">:message</p>') !!}
                          <p class="help-block">This will replace the existing file</p>
                        </div>
                      </div>                            
                    </div>
                  
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-12 col-sm-12 col-xs-12">
                          <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Update Document</button>
                        </div>
                      </div>
                  {!! Form::close() !!}
                </div>
                {{-- end of x_content --}}
              </div>
              {{-- end of x_panel --}}
            </div>
          </div>
          
        </div>

@endsection

@section('javascript')
<script type="text/javascript">
  $(function(){
    $('select').select2();

  });
</script>
@endsection
