{{-- View Employee --}} @if ($employee)

@if ($employee) {{ $employee->employee_ref }} - {{ $employee->name }} @endif

{{-- Contents goes here --}}

Personal

Full name: {{ $employee->title }} {{ $employee->name}}
Date of birth: {{ date('d/m/Y', strtotime($employee->dob)) }}
Age: @php $startDate = $employee->dob; // Convert the start date to a DateTime object $startDateObj = new DateTime($startDate); // Get the current date $currentDateObj = new DateTime(); // Calculate the interval $interval = $startDateObj->diff($currentDateObj); // Get the difference in years and months $years = $interval->y; $months = $interval->m; echo "$years years and $months months."; @endphp
Gender: {{ $employee->gender }}
Marital staus: {{ $employee->marital_status }}

Contact Details

Email: {{ $employee->email }}
Personal email: {{ $employee->personal_email }}
Telephone number: {{ $employee->tel_no }}
Mobile number: {{ $employee->mob_no }}
Address: {{ $employee->address1 }}, {{ $employee->address2 }}, @if (!empty($employee->address3)) {{ $employee->address3 }}, @endif {{ $employee->town }}, {{ $employee->postcode }}, {{ $employee->country }}
@foreach ($countryNames as $countryName) @endforeach

Diversity

Nationally: {{ $employee->nationally }} @foreach ($nationallyNames as $nationallyName) @endforeach
Ethnicity: {{ $employee->ethnicity }}
Religion: {{ $employee->religion }}
Disability: @if($employee->disability == 1) Yes @else No @endif
Sexual orientation: {{ $employee->sexorientation }}

Employment

Employee ref: {{ $employee->employee_ref }}
Job title: {{ $employee->jobtitle }}
Company: {{ $employee->getCompany->companyname }}
Department: {{ $employee->getDepartment->departmentname }}
Division: {{ $employee->getDivision->divisionname }}
Role: {{ $employee->getRole->rolename }}
@php // Split the comma-separated role IDs into an array $Teams = explode(',', $employee->team); // Retrieve the corresponding role names from the roles table $TeamNames = App\Models\Team::whereIn('id', $Teams)->pluck('team'); @endphp Team: @foreach ($TeamNames as $teamName) {{ $teamName }} @endforeach
Level: {{ $employee->level }}
Location: {{ $employee->getLocation->locationname }}

Employee

Employee type: {{ $employee->employee_type }}
Person type: {{ $employee->person_type }}
Line manager: {{ $employee->line_manager ? $employee->getLineManager->name : 'Not Assigned' }}
Holiday approver: {{ $employee->holiday_approver ? $employee->getHolidayApprover->name : 'Not Assigned' }}
Is director: @if($employee->is_director == 1) Yes @else No @endif
Report to: {{ $employee->report_to ? $employee->report_to : 'Not Assigned' }} @foreach ($reportto as $report_to) @endforeach
Full time/Part time: @if ($employee->fullparttime == 'Part Time') Part Time:- @php $selectedDays = explode(',', $employee->workingdays); $selectedDays = array_unique( array_map(function ($day) { return date('D', strtotime("Sun +$day days")); }, $selectedDays), ); @endphp Working Days: {{ implode(', ', $selectedDays) }} @else {{ $employee->fullparttime }} @endif @if($employee['fullparttime'] == "Part Time") @php $selectedDays = str_split($employee->workingdays); @endphp @foreach (range(1, 7) as $day)

@endforeach @endif
Weekly hours: {{ $employee->weeklyhours }}
Join date: {{ date("d/m/Y", strtotime($employee->join_date)) }}
Length of service: @php $startDate = $employee->join_date; // Convert the start date to a DateTime object $startDateObj = new DateTime($startDate); // Get the current date $currentDateObj = new DateTime(); // Calculate the interval $interval = $startDateObj->diff($currentDateObj); // Get the difference in years and months $years = $interval->y; $months = $interval->m; echo "$years years and $months months."; @endphp
Probation date: {{ date("d/m/Y", strtotime($employee->probation_date)) }}
Notice period: {{ $employee->notice_period }}
@if($employee->ext_prob == 1)
Extend Probation date: {{ date('d/m/Y', strtotime($employee->extend_probation_date)) }}
Reason: {{ $employee->ext_probation_reason }}
@endif

Holiday

Holiday assigned: {{ $employee->holiday_assign }}
Holiday maximum: {{ $employee->holiday_max }}
Holiday increment: @if($employee->holiday_increasement == 1) Yes @else No @endif
Recieve Statutory Holidays @if($employee->receive_statutory_holidays == 1) Yes @else No @endif

Miscellaneous

Is fire warden: @if($employee->fire_warden == 1) Yes @else No @endif
Is first aider: @if($employee->first_aider == 1) Yes @else No @endif
Is health & safety: @if($employee->health_and_safety == 1) Yes @else No @endif
Is mental health 1st aider @if($employee->mental_health_1st_aider == 1) Yes @else No @endif

Permisison

Is line manager: @if($employee->is_line_manager == 1) Yes @else No @endif
Is holiday approver: @if($employee->is_holiday_approver == 1) Yes @else No @endif
Admin/Regular: @if ($employee->isadmin == '1') Administrator @else Regular @endif
Current or Ex: @if ($employee->status == '1') Current Employee @else Ex-Employee @endif
{{-- end of Contents --}}
@endif @script @endscript