@if(isset($field['old']) && !empty($field['old']) && isset($field['updated']) && !empty($field['updated']))
@if(isset($field['old']) && !empty($field['old']) && isset($field['updated']) && !empty($field['updated']))
@foreach ($field['old'] as $key => $value)
@if($key=='id' || $key=='user_id' || $key=='company_id' || $key=='candidate_id' || $key=='created_at' || $key=='updated_at' || $key=='deleted_at' || $key=='employee_pic_status' || $key=='employee_pic_status_updated_by' || $key=='employee_pic_status_updated_date' || $key=='forms_id' || $key=='frequency' || $key=='supervised_by' || $key=='supervision_date' || $key=='last_run_on' || $key=='homes_id')
@elseif($key == 'employee_pic')
@elseif($key == 'resident_pic')
@elseif($key == 'home_pic')
@elseif($key == 'document')
@elseif($key == 'document_category_id')
@elseif($key == 'reminder_needed')
@elseif($key == 'home_id' || $key == 'work_place' || $key == 'location')
@elseif($key == 'gender')
@elseif($key == 'status')
@elseif($key == 'start_date' || $key == 'end_date' || $key == 'notice_start_date' || $key == 'pat_date' || $key == 'electrical_certificate' || $key == 'gas_certificate' || $key == 'full_ofstedrating_date' || $key == 'ofsted_rating_date' || $key == 'admission_date' || $key == 'placement_end_date' || $key == 'birthday' || $key == 'expiry_date')
@elseif($key == 'emp_notice_notify')
@elseif($key == 'job_title')
@elseif($key == 'home_manager' || $key == 'responsible_individual')
@elseif($key == 'probation')
@elseif($key == 'probation_end_date')
@elseif($key == 'administrator_id')
@elseif($key == 'likely_tobe_victimized')
@elseif($key == 'likely_to_bullyothers')
@elseif($key == 'verbally_aggressive_toothers')
@elseif($key == 'criminal_damage_inresidentialunits')
@elseif($key == 'serious_frequent')
@elseif($key == 'non_accidental_injury')
@elseif($key == 'on_at_risk_register')
@elseif($key == 'sexual_abuse')
@elseif($key == 'sexual_active')
@elseif($key == 'on_contraception')
@elseif($key == 'sexually_coercive')
@elseif($key == 'sexualized_behaviour')
@elseif($key == 'self_harm_history')
@elseif($key == 'drug_alcohol_abuse')
@elseif($key == 'arson_attempted_convicted')
@elseif($key == 'understands_consequences')
@elseif($key == 'outspokenly_racist_sexist')
@elseif($key == 'understands_responsibility')
@elseif($key == 'relate_wellto_adults')
@elseif($key == 'relate_wellto_peers')
@elseif($key == 'have_communication_difficulties')
@elseif($key == 'person_missing')
@elseif($key == 'smokes')
@elseif($key == 'drug')
@elseif($key == 'solvent_abuse')
@elseif($key == 'makes_allegations')
@elseif($key == 'medication')
@elseif($key == 'registered_disabled')
@elseif($key == 'eating_disorder')
@elseif($key == 'enuresis')
@elseif($key == 'soiling')
@elseif($key == 'hivaids')
@elseif($key == 'geographical_areasnot_placable')
@elseif($key == 'hepatitisborc')
@elseif($key == 'fire_starter')
@elseif($key == 'previous_assaulton_policeofficer')
@elseif($key == 'is_emergency_placement')
@elseif($key == 'physical_assault_on_adults_history')
@elseif($key == 'physical_assault_on_peers_history')
@elseif($key == 'team_members')
@elseif($key == 'created_by')
@elseif($key == 'updated_by')
@else
@endif
@endforeach
@foreach ($field['updated'] as $key => $value)
@if($key=='id' || $key=='user_id' || $key=='company_id' || $key=='candidate_id' || $key=='created_at' || $key=='updated_at' || $key=='deleted_at' || $key=='employee_pic_status' || $key=='employee_pic_status_updated_by' || $key=='employee_pic_status_updated_date' || $key=='forms_id' || $key=='frequency' || $key=='supervised_by' || $key=='supervision_date' || $key=='last_run_on' || $key=='homes_id')
@elseif($key == 'employee_pic')
Profile Picture
@if(!empty($value) && (file_exists(public_path('crm/employee/'.$value))))
@endif
@elseif($key == 'resident_pic')
Profile Picture
@if(!empty($value) && (file_exists(public_path('crm/resident/'.$value))))
@endif
@elseif($key == 'home_pic')
Profile Picture
@if(!empty($value) && (file_exists(public_path('crm/homeimages/'.$value))))
@endif
@elseif($key == 'document')
Document
@if(!empty($value) && (file_exists(public_path('crm/documents/'.$value))))
@php
$allowed = array('doc', 'docx');
$ext = pathinfo($value, PATHINFO_EXTENSION);
@endphp
@if (in_array($ext, $allowed))
@else
@endif
@else -
@endif
@elseif($key == 'document_category_id')
Document Category
@if(!empty($value))
{{ ($docCategory = \App\Models\DocumentCategory::find($value)) ? $docCategory->name : $value }}
@endif
@elseif($key == 'reminder_needed')
Reminder Needed
{{ ($value == 1) ? 'Yes' : 'No' }}
@elseif($key == 'home_id' || $key == 'work_place' || $key == 'location')
@if($key == 'home_id')
Home Name
@else
{{ ucwords(str_replace("_"," ",$key)) }}
@endif
@if($value)
{{ ($home = \App\Models\Home::find($value)) ? $home->name : $value }}
@endif
@elseif($key =='gender')
Gender
@foreach (config('choicescrm.gender') as $genderKey => $gender)
@if($value == $genderKey)
{{ $gender }}
@endif
@endforeach
@elseif($key == 'status')
Status
@foreach (config('choicescrm.status_home') as $statuskey => $status)
@if($value == $statuskey)
{{ $status }}
@endif
@endforeach
@elseif($key == 'start_date' || $key == 'end_date' || $key == 'notice_start_date' || $key == 'pat_date' || $key == 'electrical_certificate' || $key == 'gas_certificate' || $key == 'full_ofstedrating_date' || $key == 'ofsted_rating_date' || $key == 'admission_date' || $key == 'placement_end_date' || $key == 'birthday' || $key == 'expiry_date')
{{ ucwords(str_replace("_"," ",$key)) }}
@if(!empty($value))
{{ date(config('choicescrm.date_format_forms'), strtotime($value)) }}
@endif
@elseif($key == 'emp_notice_notify')
@elseif($key == 'job_title')
Job Title
@if($value)
{{ ($role = \App\Models\EmployeeRole::find($value)) ? ucwords($role->name) : '' }}
@endif
@elseif($key == 'home_manager' || $key == 'responsible_individual')
{{ ucwords(str_replace("_"," ",$key)) }}
@if($value)
{{ ($employee = \App\Models\Employee::find($value)) ? ucwords($employee->name) : '' }}
@endif
@elseif($key == 'probation')
Probation
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'probation_end_date')
Probation End Date
@if(!empty($value))
{{ date(config('choicescrm.date_format_forms'), strtotime($value)) }}
@endif
@elseif($key == 'administrator_id')
@elseif($key == 'likely_tobe_victimized')
{{ ucwords('IS THE YOUNG PERSON LIKELY TO BE VICTIMIZED?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'likely_to_bullyothers')
{{ ucwords('IS THE YOUNG PERSON LIKELY TO BULLY OTHERS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'verbally_aggressive_toothers')
{{ ucwords('HAS THE YOUNG PERSON HAD ANY HISTORY OF BEING VERBALLY AGGRESSIVE TO OTHERS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'criminal_damage_inresidentialunits')
{{ ucwords('IS THERE ANY HISTORY OF CRIMINAL DAMAGE IN RESIDENTIAL UNITS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'serious_frequent')
{{ ucwords('WAS THE ABOVE EITHER SERIOUS OR FREQUENT?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'non_accidental_injury')
{{ ucwords('IS THERE ANY HISTORY OF NON-ACCIDENTAL INJURY?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'on_at_risk_register')
{{ ucwords('IS THE YOUNG PERSON CURRENTLY ON THE AT RISK REGISTER?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'sexual_abuse')
{{ ucwords('IS THERE ANY HISTORY OF SEXUAL/EMOTIONAL ABUSE?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'sexual_active')
{{ ucwords('IS THE YOUNG PERSON SEXUALLY ACTIVE?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'on_contraception')
{{ ucwords('IS THIS YOUNG PERSON ON ANY CONTRACEPTION?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'sexually_coercive')
{{ ucwords('IS THERE ANY REASON TO BELIEVE THE YOUNG PERSON IS SEXUALLY COERCIVE OR MAY ABUSE OTHER YOUNG PEOPLE?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'sexualized_behaviour')
{{ ucwords('DOES THE YOUNG PERSON DEMONSTRATE ANY SEXUALIZED BEHAVIOUR?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'self_harm_history')
{{ ucwords('IS THERE ANY HISTORY OF SELF HARM?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'drug_alcohol_abuse')
{{ ucwords('IS THERE ANY HISTORY OF DRUG /ALCOHOL ABUSE?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'arson_attempted_convicted')
{{ ucwords('IS THERE ANY HISTORY OF ARSON EITHER ATTEMPTED OR CONVICTED?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'understands_consequences')
{{ ucwords('DOES THE YOUNG PERSON UNDERSTAND CONSEQUENCES?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'outspokenly_racist_sexist')
{{ ucwords('IS THERE ANY HISTORY OF THE YOUNG PERSON BEING OUTSPOKENLY RACIST/SEXIST IN EXPRESSION?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'understands_responsibility')
{{ ucwords('DOES THE YOUNG PERSON UNDERSTAND PERSONAL RESPONSIBILITY?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'relate_wellto_adults')
{{ ucwords('CAN THE YOUNG PERSON RELATE WELL TO ADULTS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'relate_wellto_peers')
{{ ucwords('CAN THE YOUNG PERSON RELATE WELL TO PEERS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'have_communication_difficulties')
{{ ucwords('DOES THE YOUNG PERSON HAVE ANY COMMUNICATION DIFFICULTIES?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'person_missing')
{{ ucwords('IS THERE A HISTORY OF THE YOUNG PERSON BEING MISSING?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'smokes')
{{ ucwords('DOES YOUNG PERSON SMOKES?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'drug')
{{ ucwords('DOES YOUNG PERSON TAKES DRUGS') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'solvent_abuse')
{{ ucwords('IS YOUNG PERSON INVOLVED IN SOLVENT ABUSE?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'makes_allegations')
{{ ucwords('DOES YOUNG PERSON MAKE ALLEGATIONS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'medication')
{{ ucwords('IS YOUNG PERSON ON MEDICATION ?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'registered_disabled')
{{ ucwords('REGISTERED DISABLED?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'eating_disorder')
{{ ucwords('DOES YOUNG PERSON HAS EATING DISORDER?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'enuresis')
{{ ucwords('DOES YOUNG PERSON SUFFER FROM ENURESIS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'soiling')
{{ ucwords('DOES YOUNG PERSON SUFFER FROM SOILING ?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'hivaids')
{{ ucwords('DOES YOUNG PERSON SUFFER FROM HIV/AIDS?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'geographical_areasnot_placable')
{{ ucwords('ARE THERE ANY GEOGRAPHICAL AREA THE YOUNG PERSON CAN NOT BE PLACED ?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'hepatitisborc')
{{ ucwords('DOES YOUNG PERSON SUFFER FROM HEPATITIS B OR C?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'fire_starter')
{{ ucwords('Is YOUNG PERSON FIRE STARTER?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'previous_assaulton_policeofficer')
{{ ucwords('HAS THE YOUNG PERSON HAD ANY HISTORY OF POLICE CASE?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'is_emergency_placement')
{{ ucwords('IS THIS AN EMERGENCY PLACEMENT?') }}
@if($value == 1)
Yes
@else
No
@endif
@elseif($key == 'physical_assault_on_adults_history')
{{ ucwords('HAS THE YOUNG PERSON HAD ANY HISTORY OF PHYSICAL ASSAULT ON ADULTS?') }}
@if($value == 1)
Low
@elseif($value == 2)
Medium
@elseif($value == 3)
High
@else
None
@endif
@elseif($key == 'physical_assault_on_peers_history')
{{ ucwords('HAS THE YOUNG PERSON HAD ANY HISTORY OF PHYSICAL ASSAULT ON PEERS?') }}
@if($value == 1)
Low
@elseif($value == 2)
Medium
@elseif($value == 3)
High
@else
None
@endif
@elseif($key == 'team_members')
Team Members
@if(is_array($value))
@php
$teamMembers = [];
\App\Models\Employee::withTrashed()->whereIn('id', $value)->get('name')->each(function($emp) use (&$teamMembers) {
$teamMembers[] = $emp->name;
});
@endphp
{{ implode(', ', $teamMembers) }}
@endif
@elseif($key == 'created_by')
Created By
{{ \App\Models\User::withTrashed()->find($value)->value('name') }}
@elseif($key == 'updated_by')
Updated By
{{ \App\Models\User::withTrashed()->find($value)->value('name') }}
@else
{{ ucwords(str_replace("_"," ",$key)) }}
@if(is_array($value))
{{ implode(',', $value) }}
@else
{{ $value }}
@endif
@endif
@endforeach
@else
@if(isset($field['old']) && !empty($field['old']))
@php $fields = $field['old']; @endphp
@else
@php $fields = $field['updated']; @endphp
@endif
@foreach ($fields as $key => $value)
@if($key=='id' || $key=='user_id' || $key=='company_id' || $key=='candidate_id' || $key=='created_at' || $key=='updated_at' || $key=='deleted_at' || $key=='employee_pic_status' || $key=='employee_pic_status_updated_by' || $key=='employee_pic_status_updated_date' || $key=='forms_id' || $key=='frequency' || $key=='supervised_by' || $key=='supervision_date' || $key=='last_run_on' || $key=='homes_id')
@elseif($key == 'employee_pic')
@elseif($key == 'resident_pic')
@elseif($key == 'home_pic')
@elseif($key == 'document')
@elseif($key == 'document_category_id')
@elseif($key == 'reminder_needed')
@elseif($key == 'home_id' || $key == 'work_place' || $key == 'location')
@elseif($key == 'gender')
@elseif($key == 'status')
@elseif($key == 'start_date' || $key == 'end_date' || $key == 'notice_start_date' || $key == 'pat_date' || $key == 'electrical_certificate' || $key == 'gas_certificate' || $key == 'full_ofstedrating_date' || $key == 'ofsted_rating_date' || $key == 'admission_date' || $key == 'placement_end_date' || $key == 'birthday' || $key == 'expiry_date')
@elseif($key == 'job_title')
@elseif($key == 'emp_notice_notify')
@elseif($key == 'home_manager' || $key == 'responsible_individual')
@elseif($key == 'probation')
@elseif($key == 'probation_end_date')
@elseif($key == 'administrator_id')
@elseif($key == 'likely_tobe_victimized')
@elseif($key == 'likely_to_bullyothers')
@elseif($key == 'verbally_aggressive_toothers')
@elseif($key == 'criminal_damage_inresidentialunits')
@elseif($key == 'serious_frequent')
@elseif($key == 'non_accidental_injury')
@elseif($key == 'on_at_risk_register')
@elseif($key == 'sexual_abuse')
@elseif($key == 'sexual_active')
@elseif($key == 'on_contraception')
@elseif($key == 'sexually_coercive')
@elseif($key == 'sexualized_behaviour')
@elseif($key == 'self_harm_history')
@elseif($key == 'drug_alcohol_abuse')
@elseif($key == 'arson_attempted_convicted')
@elseif($key == 'understands_consequences')
@elseif($key == 'outspokenly_racist_sexist')
@elseif($key == 'understands_responsibility')
@elseif($key == 'relate_wellto_adults')
@elseif($key == 'relate_wellto_peers')
@elseif($key == 'have_communication_difficulties')
@elseif($key == 'person_missing')
@elseif($key == 'smokes')
@elseif($key == 'drug')
@elseif($key == 'solvent_abuse')
@elseif($key == 'makes_allegations')
@elseif($key == 'medication')
@elseif($key == 'registered_disabled')
@elseif($key == 'eating_disorder')
@elseif($key == 'enuresis')
@elseif($key == 'soiling')
@elseif($key == 'hivaids')
@elseif($key == 'geographical_areasnot_placable')
@elseif($key == 'hepatitisborc')
@elseif($key == 'fire_starter')
@elseif($key == 'previous_assaulton_policeofficer')
@elseif($key == 'is_emergency_placement')
@elseif($key == 'physical_assault_on_adults_history')
@elseif($key == 'physical_assault_on_peers_history')
@elseif($key == 'team_members')
@elseif($key == 'created_by')
@elseif($key == 'updated_by')
@else
@endif
@endforeach
@endif
{{-- --}}