{!! Form::model($user, [ 'action' => $user->exists ? ['Admin\UsersController@update', $active_tab, $user->id] : ['Admin\UsersController@store', $active_tab], 'method' => $user->exists ? 'PUT' : 'POST', 'class' => 'form-horizontal', 'id' => 'form-users', 'files' => true ]) !!}
{!! Form::hidden('role', $user->exists ? $user->role : @$active_tab) !!} {!! $user->exists ? Form::hidden('page', Input::get('page', 1)) : '' !!}
{!!Form::label('first_name', 'Nombre(s)',['class'=>'control-label'])!!} {!!Form::text('first_name', old('first_name'), ['class' => 'form-control', 'maxlength' => 40])!!}
{!!Form::label('last_name', 'Apellido(s)',['class'=>'control-label'])!!} {!!Form::text('last_name', old('last_name'), ['class' => 'form-control', 'maxlength' => 40])!!}
{!!Form::label('phone', 'Teléfono',['class'=>'control-label'])!!} {!!Form::text('phone', NULL, ['class' => 'form-control', 'maxlength' => 12])!!}
{!!Form::label('cusp', 'Usuario CUSP',['class'=>'control-label'])!!} {!!Form::text('cusp', old('cusp'), ['class' => 'form-control', 'maxlength' => 8])!!}
{!!Form::label('no_emp', 'Número de empleado',['class'=>'control-label'])!!} {!!Form::text('no_emp', NULL, ['class' => 'form-control', 'maxlength' => 6])!!}
@if(@$active_tab == 'manager' or $user->is_manager or @$active_tab == 'executive' or $user->is_executive)
{!!Form::label('management_id', 'Centro de costos',['class'=>'control-label'])!!} {!!Form::select('management_id', App\Management::select(DB::raw('CONCAT(cc, " - ", name) AS fullname'), 'id')->pluck('fullname', 'id')->all(), NULL, ['class'=>'control-label'])!!}
@endif {{-- @if(@$active_tab == 'manager' or $user->is_manager)
{!! Form::label('management_id', 'Gerencia', ['class' => 'control-label']) !!} {!! Form::select('management_id', $managements, NULL, ['class' => 'form-control']) !!}
@endif @if(@$active_tab == 'executive' or $user->is_executive)
{!! Form::label('management_id', 'Gerencia', ['class' => 'control-label']) !!} {!! Form::select('management_id',App\Management::lists('name','id'), NULL, ['class' => 'form-control']) !!}
@endif --}}
{!!Form::label('password', 'Contrasena',['class'=>'control-label'])!!} {!!Form::password('password', ['class' => 'form-control'])!!}
@if($user->is_regional) {!!Form::select('region_id')!!} @endif
Cancelar {!!Form::submit('Guardar', ['class' => 'btn btn-lg btn-primary']) !!}
{!! Form::close() !!}