@extends('layouts.app') @section('content')

Viewing Checklist for Job: {{ $insjob->id }} by Eng.{{ $insjob->user->name }}


Checklist Content
    @php $divs = $insjob->equipment->chklist->chklistdivs; @endphp @foreach ($divs as $div)
  • {{$div->name}}
  • @endforeach
  • Images
@php $field_number =0; @endphp @foreach ($divs as $div) @php $checkListContent=''; @endphp
    @php foreach ($insjob->chklistfields as $job_chklistfield) { if($job_chklistfield->chklistdiv->id == $div->id) { $input_type = $job_chklistfield->type; //0=>text, 1=>radio, 2=>info if ($input_type==0) { $text_input = ''; $field_inputs = $text_input; } elseif ($input_type==1) { $checked_safe = $job_chklistfield->pivot->value == 1 ? "checked" : ""; $checked_unsafe = $job_chklistfield->pivot->value == 2 ? "checked" : ""; $checked_r = $job_chklistfield->pivot->value == 4 ? "checked" : ""; $checked_nat = $job_chklistfield->pivot->value == 5 ? "checked" : ""; if($job_chklistfield->pivot->value ==3){ $checked_na="checked"; }else{ $checked_na=""; if($job_chklistfield->pivot->value ==0){ $checked_safe="checked"; } } $radio_1 = '
    id.'" type="radio" value="1" '.$checked_safe.'>
    '; $radio_2 = '
    id.'" type="radio" value="2" '.$checked_unsafe.'>
    '; $radio_3 = '
    id.'" type="radio" value="3" '.$checked_na.' >
    '; $radio_4 = '
    id.'" type="radio" value="4" '.$checked_r.' >
    '; $radio_5 = '
    id.'" type="radio" value="4" '.$checked_nat.' >
    '; $radio_input = $radio_1.$radio_2.$radio_3.$radio_4.$radio_5; $field_inputs = $radio_input; } elseif ($input_type==2 and $div->id == 1 ) { $info_input= ''; $field_inputs = $info_input; } elseif ($input_type==2) { $info_input= ''; $field_inputs = $info_input; } elseif ($input_type==3){ $checked_yes_type_3 = $job_chklistfield->pivot->value == 1 ? "checked" : ""; $checked_no_type_3 = $job_chklistfield->pivot->value == 0 ? "checked" : ""; $radio_1 = '
    id.'" type="radio" disabled value="1" '.$checked_yes_type_3.'>
    '; $radio_2 = '
    id.'" type="radio" disabled value="0" '.$checked_no_type_3.'>
    '; $radio_input = $radio_1.$radio_2; $field_inputs = $radio_input; }else{ } $field_number+=1; $checkListContent .='
  • '.$field_number.': '.$job_chklistfield["description"].'
    '.$field_inputs.'
  • '; } else{} } echo ($checkListContent); @endphp
@endforeach
@endsection