@if (isset($user))
{!! Form::model($user, array('url' => url('users/'.$user->id), 'method' => 'put', 'files'=> true,'id'=>'fvalidate')) !!}
@else
{!! Form::open(array('url' => route('users.store'), 'method' => 'post', 'files'=> true,'id'=>'fvalidate')) !!}
@endif
{!! Form::label('full_name', 'Tên người dùng', array('class' => ' required')) !!}
{!! Form::text('full_name', null, array('class' => 'form-control')) !!}
{{ $errors->first('full_name', ':message') }}
{!! Form::label('phone', 'Số điện thoại', array('class' => ' required')) !!}
{!! Form::number('phone', null, array('id' => 'phone','class' => 'form-control')) !!}
{{ $errors->first('phone', ':message') }}
{!! Form::label('name_display', 'Tên xuất báo cáo', array('class' => '')) !!}
{!! Form::text('name_display', null, array('class' => 'form-control')) !!}
{{ $errors->first('branch_id', ':message') }}
{!! Form::label('branch_id', 'Chi nhánh') !!}
{{ $errors->first('branch_id', ':message') }}
{{--
--}}
{{--
--}}
{{--{!! Form::label('email', 'Email', array('class' => ' required')) !!}--}}
{{--{!! Form::email('email', null, array('id' => 'email', 'class' => 'form-control')) !!}--}}
{{--{{ $errors->first('email', ':message') }}--}}
{{--
--}}
{{--
--}}
{!! Form::label('gender', 'Giới tính', array('class' => ' required')) !!}
{!! Form::select('gender',[0 => 'Nữ', 1 => 'Nam'], null, array('class' => 'form-control select2', 'placeholder' => 'Chọn giới tính')) !!}
{{ $errors->first('gender', ':message') }}
@if(\Illuminate\Support\Facades\Auth::user()->department_id==\App\Constants\UserConstant::ADMIN)
{!! Form::label('department_id', 'Phòng ban', array('class' => ' required')) !!}
{!! Form::select('department_id', $departments, null, array('id'=>'departments','class' => 'form-control select2', 'placeholder' => 'Phòng ban')) !!}
{{ $errors->first('branch_id', ':message') }}
{!! Form::label('role', 'Quyền', array('class' => ' required')) !!}
{{ $errors->first('role', ':message') }}
@endif
{!! Form::label('location_id', 'Chọn cụm', array('class' => '')) !!}
{{ $errors->first('branch_id', ':message') }}