@extends('clientarea.app')
@section('content')
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-file"></i> {{trans('application.edit_profile')}}</h1>
</div>
<section class="content">
    <div class="row">
        <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-body">
                {!! Form::model($user, ['url' => ['clientarea/cprofile'], 'files'=>true] ) !!}
                    @if (count($errors) > 0)
                        {!! form_errors($errors) !!}
                    @endif
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('client_no', trans('application.client_no').'*') !!}
                                {!! Form::text('client_no', null, ['class' => 'form-control input-sm','readonly', 'required']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('name', trans('application.name').'*') !!}
                                {!! Form::text('name', null, ['class' => 'form-control input-sm', 'required']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('email', trans('application.email').'*') !!}
                                {!! Form::text('email', null, ['class' => 'form-control input-sm', 'required']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('phone', trans('application.phone')) !!}
                                {!! Form::text('phone', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('mobile', trans('application.mobile')) !!}
                                {!! Form::text('mobile', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('address1', trans('application.address_1')) !!}
                                {!! Form::text('address1', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('address2', trans('application.address_2')) !!}
                                {!! Form::text('address2', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('password',  trans('application.password').trans('application.password_leave_blank_notification')) !!}
                                {!! Form::password('password', ['class' => 'form-control input-sm']) !!}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('city', trans('application.city')) !!}
                                {!! Form::text('city', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('state', trans('application.state')) !!}
                                {!! Form::text('state', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('postal_code', trans('application.postal_code')) !!}
                                {!! Form::text('postal_code', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('country', trans('application.country')) !!}
                                {!! Form::text('country', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('website', trans('application.website')) !!}
                                {!! Form::text('website', null, ['class' => 'form-control input-sm']) !!}
                            </div>
                            <div class="form-group">
                                {!! Form::label('notes', trans('application.notes')) !!}
                                {!! Form::textarea('notes', null, ['class' => 'form-control input-sm', 'rows' => '5']) !!}
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label for="photo">{{trans('application.photo')}}</label>
                                {!! HTML::image(asset($user->photo != '' ? 'assets/img/uploads/client_images/'.$user->photo : 'assets/img/uploads/no-image.jpg'), 'photo', array('class' => 'thumbnail')) !!}<br>
                                <div class=" form-group input-group input-file" style="margin-bottom: 10px;width:50%">
                                    <div class="form-control input-sm"></div>
                                    <span class="input-group-addon">
                                        <a class='btn btn-sm btn-primary' href='javascript:;'>
                                            {{ trans('application.browse') }}
                                            <input type="file" name="photo" id="photo" onchange="$(this).parent().parent().parent().find('.form-control').html($(this).val());">
                                        </a>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <button type="submit" class="btn btn-sm btn-success">
                                    <i class=" fa fa-refresh "></i>
                                    {{trans('application.update_profile')}}
                                </button>
                            </div>
                        </div>
           {!! Form::close() !!}
        </div>
        <div class="clearfix"></div>
        </div>
     </div>
   </div>
</section>
@endsection