<div class="panel panel-default">
    <div class="panel-heading">
        <h4>{{trans('general.personales')}}</h4>
    </div>
    <div class="panel-body">
        
    <div class="form-group{{ $errors->has('customer_id') ? ' has-error' : '' }}">
    	{!! Form::label('customer_id', 'Cliente') !!}
    	{!! Form::select('customer_id', $customers, null, ['class' => 'form-control']) !!}
    	@if ($errors->has('customer_id'))
    		<span class="help-block">
    			<strong>{{ $errors->first('customer_id') }}</strong>
    		</span>
    	@endif
    </div>
        
        <div class="form-group{{ $errors->has('first_name') ? ' has-error' : '' }}">
        	{!! Form::label('first_name', trans('general.nombre')) !!}
        	{!! Form::text('first_name', null, ['class' => 'form-control']) !!}
        	@if ($errors->has('first_name'))
        		<span class="help-block">
        			<strong>{{ $errors->first('first_name') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('last_name') ? ' has-error' : '' }}">
        	{!! Form::label('last_name', trans('general.apellido')) !!}
        	{!! Form::text('last_name', null, ['class' => 'form-control']) !!}
        	@if ($errors->has('last_name'))
        		<span class="help-block">
        			<strong>{{ $errors->first('last_name') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
        	{!! Form::label('email', 'Email') !!}
        	{!! Form::text('email', null, ['class' => 'form-control']) !!}
        	@if ($errors->has('email'))
        		<span class="help-block">
        			<strong>{{ $errors->first('email') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('local_address') ? ' has-error' : '' }}">
        	{!! Form::label('local_address', trans('general.direccion')) !!}
        	{!! Form::text('local_address', null, ['class' => 'form-control']) !!}
        	@if ($errors->has('local_address'))
        		<span class="help-block">
        			<strong>{{ $errors->first('local_address') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('telephone') ? ' has-error' : '' }}">
        	{!! Form::label('telephone', trans('general.movil')) !!}
        	{!! Form::text('telephone', null, ['class' => 'form-control']) !!}
        	@if ($errors->has('telephone'))
        		<span class="help-block">
        			<strong>{{ $errors->first('telephone') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('birthday') ? ' has-error' : '' }}">
        	{!! Form::label('birthday', trans('general.birthday')) !!}
        	<div class="input-group">
        		<div class="input-group-addon">
        		<i class="fa fa-calendar"></i>
        		</div>
        		{!! Form::text('birthday', null, ['class' => 'form-control datepicker', 'data-inputmask' => "'alias': 'mm/dd/yyyy'", 'data-mask' => '']) !!}
        	</div>
        	@if ($errors->has('birthday'))
        		<span class="help-block">
        			<strong>{{ $errors->first('birthday') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group">
        	{!! Form::radio('gender', 'M', true) !!}
        	{!! Form::label('gender', trans('general.masculino'), ['class' => 'margin']) !!}
        	{!! Form::radio('gender', 'F') !!}
        	{!! Form::label('gender', trans('general.femenino'), ['class' => 'margin']) !!}
        </div>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-heading">
        <h4>{{ trans('general.titulacion') }}</h4>
    </div>
    <div class="panel-body">
        <div class="form-group{{ $errors->has('nauticaltitle') ? ' has-error' : '' }}">
        	{!! Form::label('nauticaltitle', trans('general.nauticaltitle')) !!}
        	{!! Form::text('nauticaltitle', null, ['class' => 'form-control']) !!}
        	@if ($errors->has('nauticaltitle'))
        		<span class="help-block">
        			<strong>{{ $errors->first('nauticaltitle') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('nauticaltitleexpedicion') ? ' has-error' : '' }}">
        	{!! Form::label('nauticaltitleexpedicion', trans('general.nauticaltitleexpedicion')) !!}
        	<div class="input-group">
        		<div class="input-group-addon">
        		<i class="fa fa-calendar"></i>
        		</div>
        		{!! Form::text('nauticaltitleexpedicion', null, ['class' => 'form-control datepicker', 'data-inputmask' => "'alias': 'mm/dd/yyyy'", 'data-mask' => '']) !!}
        	</div>
        	@if ($errors->has('nauticaltitleexpedicion'))
        		<span class="help-block">
        			<strong>{{ $errors->first('nauticaltitleexpedicion') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('nauticaltitleexpiration') ? ' has-error' : '' }}">
        	{!! Form::label('nauticaltitleexpiration', trans('general.nauticaltitleexpiration')) !!}
        	<div class="input-group">
        		<div class="input-group-addon">
        		<i class="fa fa-calendar"></i>
        		</div>
        		{!! Form::text('nauticaltitleexpiration', null, ['class' => 'form-control datepicker', 'data-inputmask' => "'alias': 'mm/dd/yyyy'", 'data-mask' => '']) !!}
        	</div>
        	@if ($errors->has('nauticaltitleexpiration'))
        		<span class="help-block">
        			<strong>{{ $errors->first('nauticaltitleexpiration') }}</strong>
        		</span>
        	@endif
        </div>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-heading">
        <h4>{{ trans('general.datosusuario') }}</h4>
    </div>
    <div class="panel-body">
        <!-- div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
        	{!! Form::label('username',  'Email') !!}
        	{!! Form::text('username', null, ['class' => 'form-control']) !!}
        	@if ($errors->has('username'))
        		<span class="help-block">
        			<strong>{{ $errors->first('username') }}</strong>
        		</span>
        	@endif
        </div -->
        <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
        	{!! Form::label('password', trans('general.password')) !!}
        	{!! Form::password('password', ['class' => 'form-control']) !!}
        	@if ($errors->has('password'))
        		<span class="help-block">
        			<strong>{{ $errors->first('password') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
        	{!! Form::label('password_confirmation', trans('general.password').' '.trans('general.confirmation')) !!}
        	{!! Form::password('password_confirmation', ['class' => 'form-control']) !!}
        	@if ($errors->has('password_confirmation'))
        		<span class="help-block">
        			<strong>{{ $errors->first('password_confirmation') }}</strong>
        		</span>
        	@endif
        </div>
		@if(Auth::user()->role->role_permission('delete_users'))
        <div class="form-group{{ $errors->has('role_id') || $errors->has('role') ? ' has-error' : '' }}">
        	{!! Form::label('role_id',  trans('general.rol')) !!}<br />
        	{!! Form::select('role_id', $roles, null, ['class' => 'form-control']) !!}
        	@if ($errors->has('role_id') || $errors->has('role'))
        		<span class="help-block">
        			<strong>{{ $errors->has('role') ? $errors->first('role') : $errors->first('role_id') }}</strong>
        		</span>
        	@endif
        </div>
		@else
		{!! Form::hidden('role_id', null, ['class' => 'form-control']) !!}
		@endif
        <div class="form-group{{ $errors->has('profile_picture') ? ' has-error' : '' }}">
            {!! Form::label('profile_picture', trans('general.photo')) !!}
        	{!! Form::file('profile_picture') !!}
        	@if ($errors->has('profile_picture'))
        		<span class="help-block">
        			<strong>{{ $errors->first('profile_picture') }}</strong>
        		</span>
        	@endif
        </div>
        <div class="form-group">
			<label>{{ trans('general.sendemail') }}</label>
        	{!! Form::radio('sendemail', '0', true) !!}
        	{!! Form::label('sendemail', trans('general.noenviado'), ['class' => 'margin']) !!}
        	{!! Form::radio('sendemail', '1') !!}
        	{!! Form::label('sendemail', trans('general.enviado'), ['class' => 'margin']) !!}
        </div>
        
        <div class="form-group">
			<label>{{ trans('general.sendsms') }}</label>
        	{!! Form::radio('sendsms', '0', true) !!}
        	{!! Form::label('sendsms', trans('general.noenviado'), ['class' => 'margin']) !!}
        	{!! Form::radio('sendsms', '1') !!}
        	{!! Form::label('sendsms', trans('general.enviado'), ['class' => 'margin']) !!}
        </div>
    </div>
</div>


<div class="pull-right">
	{!! Form::submit(trans('general.save'), ['class' => 'btn btn-success btn-flat']) !!}
	<a href="{{ isset($user) ? asset('/users/'.$user->id) : asset('/users') }}" type="button" class="btn btn-default btn-flat">{{trans('general.cancel')}}</a>
</div>
