@extends('layouts.app')

@section('content')
<div class="panel panel-default">
    <div class="panel-heading">edit Xero customer {{ $xeroCustomer->xero_name }}</div>

    <div class="panel-body">
    @if ($errors->any())
	    <div class="alert alert-danger">
	        <ul>
	            @foreach ($errors->all() as $error)
	                <li>{{ $error }}</li>
	            @endforeach
	        </ul>
	    </div><br />
	@endif
       <form method="post" action="{{ route('xero-customers.update',$xeroCustomer->id)}}" >
	    <input type="hidden" value="{{csrf_token()}}" name="_token" />
	        <!--<div class="form-group">
	            <label for="title">Email:</label>
	            <input type="text" class="form-control" name="email" value="{{$xeroCustomer->email}}"/>
	        </div>-->
	        <div class="form-group">
                <label for="title">Tax rate type :</label>
                <select data-live-search="true" class="form-control" name="tax_type">
                     @foreach($xeroTaxes as $key => $rate)
                        <option <?php if( $key == $xeroCustomer->tax_type ) { ?> selected <?php } ?> data-tokens="{{$rate}}" value="{{$key}}">{{$rate}}</option>
                    @endforeach
                </select>
            </div>
	         <button type="submit" class="btn btn-primary">Edit</button>
	     </form>
    </div>
</div>
@endsection