@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('officelocations') !!}">Branch Offices</a></li>
          <li class="active">Update Branch Offices</li>
        </ol>
      </div>
    </div>
    <div class="clearfix"></div>
      <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
          <div class="x_panel">
              <div class="x_title">
                Update Branch Offices
                @include('commons.notifications')
                <div class="clearfix"></div>
              </div>
              {{-- start of content --}}
              <div class="x_content">
              <br>

                  {!! Form::model($officelocation, [
                    'method' => 'PATCH',
                    'files' => 'true',
                    'url' => ['officelocations', $officelocation],
                    'class' => 'form-horizontal form-label-left'
                  ]) !!}
                  <div class="row">

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="streetName">Street Name</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('street_name') ? 'has-error' : ''}}">
                          {!! Form::text('street_name', old('street_name'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Street Name' , 'id' => 'streetName']) !!}
                          {!! $errors->first('street_name', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="physicalAddress">Physical Address *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('physical_address') ? 'has-error' : ''}}">
                          {!! Form::text('physical_address', old('physical_address'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter physical number' , 'id' => 'physicalAddress', 'required' => 'true']) !!}
                          {!! $errors->first('physical_address', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="postalAddress">Postal Address *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('postal_address') ? 'has-error' : ''}}">
                          {!! Form::text('postal_address', old('postal_address'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter postal address' , 'id' => 'postalAddress', 'required' => 'true']) !!}
                          {!! $errors->first('postal_address', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">Block Number</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}">
                          {!! Form::text('block_number', old('block_number'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter block number' , 'id' => 'blockNumber']) !!}
                          {!! $errors->first('block_number', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="blockNumber">City/Town *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('block_number') ? 'has-error' : ''}}">
                          {!! Form::text('city_town', old('city_town'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter city/town ' , 'id' => 'cityTown', 'required' => 'true']) !!}
                          {!! $errors->first('city_town', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="theCountry">Country *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('country') ? 'has-error' : ''}}">
                          {!! Form::select('country', $countries ,old('country'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select country ' , 'id' => 'theCountry', 'required' => 'true']) !!}
                          {!! $errors->first('country', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="countryManager">Country Manager *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('country_manager_id') ? 'has-error' : ''}}">              
                          {!! Form::select('country_manager_id', $staffmembers, old('country_manager_id'),  ['class' => 'form-control', 'placeholder'=>'Select Country Manager' , 'id' => 'countryManager', 'required' => 'true']) !!}
                          {!! $errors->first('country_manager_id', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="officePhone">Office Phone *</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('office_phone') ? 'has-error' : ''}}">
                          {!! Form::text('office_phone', old('office_phone'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter office phone number' , 'id' => 'officePhone']) !!}
                          {!! $errors->first('office_phone', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                  
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Update</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
