@extends('layouts.main_frontend') @section('title','RCSA - Questionaire') @section('main-content') @php if(count($risks)<1){ $risks = [json_decode(json_encode(['id'=>1,'reference_no'=>'12345']))]; } //dd($matrix_data); $matrix = $matrix_data['matrix_labels']; $matrix = $matrix[$matrix_data['matrix_length']]; $matrix_types = [1=>'likelihood',2=>'impact',3=>'control_effectiveness',4=>'control_design']; if(!empty($matrix_data['risk_matrix'])){ //$matrix = $matrix_data['risk_matrix']; } $thresold = $matrix_data['matrix_layout']['thresold']; //dd($matrix); @endphp Questionaire @php $i=0; @endphp @if(!empty($risks)) @foreach($risks as $key=>$risk) @php $i++; @endphp {{$risk->reference_no}} @if($i%3==0)@endif @endforeach @endif @if(!empty($risks)) @foreach($risks as $key=>$risk) 0) style="display:none" @endif data-index="{{$key}}"> Organization Department Name / Business Entity / Process RCSA Ref. No Risk Ref. No. Risk Event Name Risk Description {{$risk->description ?? ''}} Inherent Risk Likelihood Select Risk Likelihood @if(!empty($matrix['likelihood'])) @foreach($matrix['likelihood'] as $key => $val) id]->inherent_risk_likelyhood) ? $model[$risk->id]->inherent_risk_likelyhood : old('inherent_risk_likelyhood')) == ($key) ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @else @foreach($inherentLikelyhood as $key => $val) id]->inherent_risk_likelyhood) ? $model[$risk->id]->inherent_risk_likelyhood : old('inherent_risk_likelyhood')) == $key ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @endif Impact Select Risk Impact @if(!empty($matrix['impact'])) @foreach($matrix['impact'] as $key => $val) id]->inherent_risk_impact) ? $model[$risk->id]->inherent_risk_impact : old('inherent_risk_impact')) == ($key) ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @else @foreach($inherentImpact as $key => $val) id]->inherent_risk_impact) ? $model[$risk->id]->inherent_risk_impact : old('inherent_risk_impact')) == $key ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @endif @php $i=1; $colours = $matrix_data['matrix_layout']['colours']; @endphp @foreach($matrix_data['matrix_layout']['risk'] as $key=>$row) @if($i == 1) Impact @endif {{@ucwords($matrix['impact'][$key])}} @foreach($row as $key2=>$column) @endforeach @php $i++; @endphp @endforeach @foreach($matrix['likelihood'] as $level) {{ucwords($level)}} @endforeach Likelihood @php $controlNum=0; @endphp @if($riskControls) @foreach($riskControls[$risk->id] as $r) @php $controlNum++; @endphp {{$r->control_reference_no}} @endforeach @endif @php $controlNum=1; @endphp @if($riskControls) @foreach($riskControls[$risk->id] as $ctrl => $r) Control Reference {{$controlNum++}}.{{$r->control_reference_no ?? ''}} Name: {{ $r->control_title ?? '' }} and Details: {{$r->control_details ?? ''}} @php $controlSelectedDesigns = explode(',', @$model[$risk->id]->control_designs); $controlSelectedPerformance = explode(',', @$model[$risk->id]->control_performance); @endphp Control Designs @if(!empty($matrix['control_design'])) Select Control Effectiveness @foreach($matrix['control_design'] as $key => $val) {{ ucwords($val) }} @endforeach @else @foreach($controlDesigns as $key => $val) id]->control_designs) ? $model[$risk->id]->control_designs : old('control_designs')) == $key ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @endif Control Performance @if(!empty($matrix['control_performance'])) Select Control Performance @foreach($matrix['control_performance'] as $key => $val) {{ ucwords($val) }} @endforeach @else @foreach($controlPerformance as $key => $val) id]->control_performance) ? $model[$risk->id]->control_performance : old('control_performance')) == $key ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @endif @php $i=1; @endphp @foreach($matrix_data['matrix_layout']['controls'] as $key=>$row) @if($i == 1) Control Performance @endif {{@ucwords($matrix['control_performance'][$key])}} @foreach($row as $key2=>$column) @endforeach @php $i++; @endphp @endforeach @foreach($matrix['control_design'] as $level) {{ucwords($level)}} @endforeach Control Design @endforeach @endif Calculated Residual Risk @php $c_risk = ''; if(!empty($model[$risk->id])){ $c_risk = $model[$risk->id]->calculated_residual_risk_impact; } @endphp Perceived Residual Risk Impact @if(!empty($matrix['residual_risk'])) {{-- @foreach($matrix['residual_risk'] as $key => $val) id]->inherent_risk_impact) ? $model[$risk->id]->inherent_risk_impact : old('inherent_risk_impact')) == $key ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach --}} @foreach($matrix['residual_risk'] as $key => $val) id]->perceived_residual_risk_impact) ? $model[$risk->id]->perceived_residual_risk_impact : old('perceived_residual_risk_impact')) == $key ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @else @foreach($perceivedResidualImpact as $key => $val) id]->perceived_residual_risk_impact) ? $model[$risk->id]->perceived_residual_risk_impact : old('perceived_residual_risk_impact')) == $key ? 'selected' : '' }}>{{ ucwords($val) }} @endforeach @endif Disagree Comments {{ isset($model[$risk->id]->comment) ? $model[$risk->id]->comment : old('comment') }} @can('questionnaire.add') Draft Save @endcan @endforeach < > @else Please select risk for this RCSA planner @endif @endsection @section('additionaljs') @endsection
{{$controlNum++}}.{{$r->control_reference_no ?? ''}} Name: {{ $r->control_title ?? '' }} and Details: {{$r->control_details ?? ''}}