@if(session()->has('user_updated'))
{{session('user_updated')}}
@endif
@include('includes.form_errors')
{!! Form::model($user, ['method'=>'patch', 'action'=>['ManageCustomersController@update', $user->id], 'files'=>true, 'onsubmit'=>'submit_button.disabled = true; submit_button.value = "' . __('Please Wait...') . '"; return true;']) !!}
@if($user->photo)
@endif
{!! Form::label('name', __('Name:')) !!}
{!! Form::text('name', null, ['class'=>'form-control', 'placeholder'=>__('Enter name'), 'required'])!!}
{!! Form::label('mobile', __('Mobile:')) !!}
{!! Form::text('mobile', null, ['class'=>'form-control', 'placeholder'=>__('Enter Mobile'), 'required'])!!}
{!! Form::label('email',__('Email:')) !!}
{!! Form::email('email', null, ['class'=>'form-control', 'placeholder'=>__('Enter email'), 'required']) !!}
@if($user->id !== 1)
@can('update', App\User::class)
@if(!$user->location || $user->location->id == Auth::user()->location_id)
{!! Form::label('role', __('Role:')) !!}
{!! Form::select('role', ['0'=>__('None')] + $roles, $user->role_id, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']) !!}
@endif
@endcan
{!! Form::label('verified', __('Email Status:')) !!}
{!! Form::select('verified', [true=>__('verified'), false=>__('unverified')], $user->verified, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']) !!}
{!! Form::label('status', __('Status:')) !!}
{!! Form::select('status', [0=>__('inactive'), 1=>__('active')], $user->is_active, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']) !!}
@endif
{!! Form::label('password', __('Password:')) !!}
{!! Form::password('password', ['class'=>'form-control', 'placeholder'=>__('Enter password')]) !!}
{!! Form::label('password_confirmation', __('Confirm Password:')) !!}
{!! Form::password('password_confirmation', ['class'=>'form-control', 'placeholder'=>__('Enter password again')]) !!}
{!! Form::label('photo', __('Choose photo (100px*100px)'), ['class'=>'btn btn-default btn-file']) !!}
{!! Form::file('photo',['class'=>'form-control', 'style'=>'display: none;','onchange'=>'$("#upload-file-info").html(files[0].name)']) !!}
@lang('No photo chosen')
{!! Form::submit(__('Update Customer'), ['class'=>'btn btn-primary btn-block', 'name'=>'submit_button']) !!}
{!! Form::close() !!}