@extends('layouts.main') @section('page-title') {{ __('Edit Employee') }} @endsection @section('page-breadcrumb') {{ __('Employee') }} @endsection @php $company_settings = getCompanyAllSetting(); @endphp @section('content')
@if (!empty($employee)) {{ Form::model($employee, ['route' => ['employee.update', $employee->id], 'method' => 'PUT', 'enctype' => 'multipart/form-data', 'class' => 'needs-validation', 'novalidate' ,'id'=>'personal-details-form']) }} @else {{ Form::open(['route' => ['employee.store'], 'method' => 'post', 'enctype' => 'multipart/form-data', 'class' => 'needs-validation', 'novalidate','id'=>'personal-details-form']) }} @endif @if (!empty($user->id)) @endif
{{ __('Personal Details') }}

{{ Form::label('name', __('Name'), ['class' => 'form-label']) }}
{{ Form::text('name', !empty($user->name) ? $user->name : '', ['class' => 'form-control', 'required' => 'required', 'placeholder' => __('Enter employee Name')]) }}
{!! Form::label('dob', __('Date of Birth'), ['class' => 'form-label']) !!} {!! Form::date('dob', null, [ 'class' => 'form-control ', 'required' => 'required', 'placeholder' => __('Select Date of Birth'), 'max' => date('Y-m-d'), ]) !!}
{!! Form::label('gender', __('Gender'), ['class' => 'form-label']) !!}
gender == 'Male' ? 'checked' : '') : 'checked' }}>
gender == 'Female' ? 'checked' : '') : '' }}>
{{ Form::label('passport_country', __('Passport country'), ['class' => 'form-label']) }}
{{ Form::text('passport_country', null, ['class' => 'form-control', 'placeholder' => __('Enter Passport Country')]) }}
{{ Form::label('passport', __('Passport'), ['class' => 'form-label']) }}
{{ Form::text('passport', null, ['class' => 'form-control', 'placeholder' => __('Enter Passport')]) }}
{{ __('Location Details') }}

{{ Form::label('location_type', __('Location Type'), ['class' => 'form-label']) }} {{ Form::select('location_type', $location_type, null, ['class' => 'form-control select']) }}
{{ Form::label('country', __('Country'), ['class' => 'form-label']) }}
{{ Form::text('country', null, ['class' => 'form-control', 'placeholder' => __('Enter Country')]) }}
{{ Form::label('state', __('State'), ['class' => 'form-label']) }}
{{ Form::text('state', null, ['class' => 'form-control', 'placeholder' => __('Enter State')]) }}
{{ Form::label('city', __('City'), ['class' => 'form-label']) }}
{{ Form::text('city', null, ['class' => 'form-control', 'placeholder' => __('Enter City')]) }}
{{ Form::label('zipcode', __('Zip code'), ['class' => 'form-label']) }}
{{ Form::text('zipcode', null, ['class' => 'form-control', 'placeholder' => __('Enter Zip code')]) }}
{!! Form::label('address', __('Address'), ['class' => 'form-label']) !!} {!! Form::textarea('address', null, [ 'class' => 'form-control', 'rows' => 3, 'placeholder' => __('Enter employee address'), 'required' => 'required', ]) !!}
@if (\Auth::user()->type != 'employee')
{{ __('Document') }}

@foreach ($document_types as $key => $document)
{{ Form::label('document', $document->name, ['class' => 'float-left pt-1 form-label']) }} @if ($document->is_required == 1) @endif @php $employeedoc = !empty($employee->documents) ? $employee->documents()->pluck('document_value', 'document_id'): []; @endphp
@php $docPath = isset($employeedoc[$document->id]) ? $employeedoc[$document->id] : null; $ext = $docPath ? strtolower(pathinfo($docPath, PATHINFO_EXTENSION)) : null; @endphp @if ($docPath && strtolower($ext) === 'pdf') @elseif ($docPath) @else @endif
@endforeach
{{ __('Bank Account Detail') }}

{!! Form::label('account_holder_name', __('Account Holder Name'), ['class' => 'form-label']) !!} {!! Form::text('account_holder_name', null, [ 'class' => 'form-control', 'placeholder' => __('Enter Account Holder Name'), ]) !!}
{!! Form::label('account_number', __('Account Number'), ['class' => 'form-label']) !!} {!! Form::number('account_number', null, [ 'class' => 'form-control', 'placeholder' => __('Enter Account Number'), ]) !!}
{!! Form::label('bank_name', __('Bank Name'), ['class' => 'form-label']) !!} {!! Form::text('bank_name', null, ['class' => 'form-control', 'placeholder' => __('Enter Bank Name')]) !!}
{!! Form::label('bank_identifier_code', __('Bank Identifier Code'), ['class' => 'form-label']) !!} {!! Form::text('bank_identifier_code', null, [ 'class' => 'form-control', 'placeholder' => __('Enter Bank Identifier Code'), ]) !!}
{!! Form::label('branch_location', __('Branch Location'), ['class' => 'form-label']) !!} {!! Form::text('branch_location', null, [ 'class' => 'form-control', 'placeholder' => __('Enter Branch Location'), ]) !!}
{!! Form::label('tax_payer_id', __('Tax Payer Id'), ['class' => 'form-label']) !!} {!! Form::text('tax_payer_id', null, [ 'class' => 'form-control', 'placeholder' => __('Enter Tax Payer Id'), ]) !!}
@else
{{ __('Document Detail') }}
@php $employeedoc = $employee ->documents() ->pluck('document_value', __('document_id')); @endphp @foreach ($document_types as $key => $document) @endforeach
{{ __('Bank Account Detail') }}
{{ __('Account Holder Name') }} {{ $employee->account_holder_name }}
{{ __('Account Number') }} {{ $employee->account_number }}
{{ __('Bank Name') }} {{ $employee->bank_name }}
{{ __('Bank Identifier Code') }} {{ $employee->bank_identifier_code }}
{{ __('Branch Location') }} {{ $employee->branch_location }}
{{ __('Tax Payer Id') }} {{ $employee->tax_payer_id }}
@endif
{{ Form::close() }}
@if (\Auth::user()->type != 'employee')
{{ __('Company Detail') }}

{!! Form::label('employee_id', __('Employee ID'), ['class' => 'form-label']) !!} {!! Form::text('employee_id', $employeesId, ['class' => 'form-control', 'disabled' => 'disabled']) !!}
{{ Form::label('branch_id', !empty($company_settings['hrm_branch_name']) ? $company_settings['hrm_branch_name'] : __('Branch'), ['class' => 'form-label']) }} {{ Form::select('branch_id', $branches, isset($employee->branch_id) ? $employee->branch_id : null, ['class' => 'form-control', 'required' => 'required', 'placeholder' => __('Select ' . (!empty($company_settings['hrm_branch_name']) ? $company_settings['hrm_branch_name'] : __('select Branch')))]) }}
{{ Form::label('department_id', !empty($company_settings['hrm_department_name']) ? $company_settings['hrm_department_name'] : __('Department'), ['class' => 'form-label']) }} {{ Form::select('department_id',$departments, isset($employee->department_id) ? $employee->department_id : null, ['class' => 'form-control', 'id' => 'department_id', 'required' => 'required', 'placeholder' => __('Select ' . (!empty($company_settings['hrm_department_name']) ? $company_settings['hrm_department_name'] : __('Department')))]) }}
{{ Form::label('designation_id', !empty($company_settings['hrm_designation_name']) ? $company_settings['hrm_designation_name'] : __('Designation'), ['class' => 'form-label']) }} {{ Form::select('designation_id',$designations, isset($employee->designation_id) ? $employee->designation_id : null, ['class' => 'form-control', 'id' => 'designation_id', 'required' => 'required', 'placeholder' => __('Select ' . (!empty($company_settings['hrm_designation_name']) ? $company_settings['hrm_designation_name'] : __('Designation')))]) }}
{!! Form::label('company_doj', 'Company Date Of Joining', ['class' => 'form-label']) !!} {!! Form::date('company_doj', isset($employee->company_doj) ? $employee->company_doj : null, [ 'class' => 'form-control', 'required' => 'required', 'placeholder' => __('Select Date Of Joining'), ]) !!}
{{-- Biometric Attendance Emp Field --}} @stack('biometric_emp_id') @if (module_is_active('CustomField') && !$customFields->isEmpty())
@include('custom-field::formBuilder', [ 'fildedata' => isset($employee->customField) ? $employee->customField : '', ])
@endif
@else
{{ __('Company Detail') }}
{{ !empty($company_settings['hrm_branch_name']) ? $company_settings['hrm_branch_name'] : __('Branch') }} {{ !empty($employee->branch) ? $employee->branch->name : '' }}
{{ !empty($company_settings['hrm_department_name']) ? $company_settings['hrm_department_name'] : __('Department') }} {{ !empty($employee->department) ? $employee->department->name : '' }}
{{ !empty($company_settings['hrm_designation_name']) ? $company_settings['hrm_designation_name'] : __('Designation') }} {{ !empty($employee->designation) ? $employee->designation->name : '' }}
{{ __('Date Of Joining') }} {{ company_date_formate($employee->company_doj) }}
@endif
{{ __('Hours and Rates Detail') }}

{{ __('Hours') }}

{{ __('Rates') }}

{{ Form::label('hours_per_day', __('Hours Per day'), ['class' => 'form-label']) }}
{{ Form::number('hours_per_day', isset($employee->hours_per_day) ? $employee->hours_per_day : null, ['class' => 'form-control', 'step' => '0.01', 'placeholder' => __('Enter Hours Per Day')]) }}
{{ Form::label('annual_salary', __('Annual salary'), ['class' => 'form-label']) }}
{{ Form::number('annual_salary', isset($employee->annual_salary) ? $employee->annual_salary : null, ['class' => 'form-control', 'placeholder' => __('Enter Annual Salary')]) }}
{{ Form::label('days_per_week', __('Days Per week'), ['class' => 'form-label']) }}
{{ Form::number('days_per_week', isset($employee->days_per_week) ? $employee->days_per_week : null, ['class' => 'form-control', 'placeholder' => __('Enter Days Per Week')]) }}
{{ Form::label('fixed_salary', __('Fixed Salary'), ['class' => 'form-label']) }}
{{ Form::number('fixed_salary', isset($employee->fixed_salary) ? $employee->fixed_salary : null, ['class' => 'form-control', 'placeholder' => __('Enter Fixed Salary')]) }}
{{ Form::label('hours_per_month', __('Hours Per month'), ['class' => 'form-label']) }}
{{ Form::number('hours_per_month', isset($employee->hours_per_month) ? $employee->hours_per_month : null, ['class' => 'form-control', 'step' => '0.01', 'placeholder' => __('Enter Hours Per Month')]) }}
{{ Form::label('rate_per_day', __('Rate per day'), ['class' => 'form-label']) }}
{{ Form::number('rate_per_day', isset($employee->rate_per_day) ? $employee->rate_per_day : null, ['class' => 'form-control', 'placeholder' => __('Enter Rate Per Day')]) }}
{{ Form::label('days_per_month', __('Days per month'), ['class' => 'form-label']) }}
{{ Form::number('days_per_month', isset($employee->days_per_month) ? $employee->days_per_month : null, ['class' => 'form-control', 'placeholder' => __('Enter Days Per Month')]) }}
{{ Form::label('rate_per_hour', __('Rate per hour'), ['class' => 'form-label']) }}
{{ Form::number('rate_per_hour', isset($employee->rate_per_hour) ? $employee->rate_per_hour : null, ['class' => 'form-control','step' => '0.01', 'placeholder' => __('Enter Rate Per Hour')]) }}
payment_requires_work_advice == 'on' ? 'checked' : '') : '' }}>
{{ __('Cancel') }}
@endsection @push('scripts') @endpush