@extends('layouts.app') @section('css') @endsection @section('content')
@php $date_format = config('constants.APP_DATE_FORMAT'); if (config('constants.APP_TIME_FORMAT') == '12') { $date_format .= ' h:i A'; } else if (config('constants.APP_TIME_FORMAT') == '24') { $date_format .= ' H:i'; } else { $date_format = 'm/d/Y h:i A'; } @endphp
{{$form->name}}
@php $is_enabled_sub_ref_no = false; if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) { $is_enabled_sub_ref_no = true; } @endphp
@if(!empty($form->schema)) @php $schema = $form->schema['form']; $col_visible = $form['schema']['settings']['form_data']['col_visible']; $btn_enabled = $form['schema']['settings']['form_data']['btn_enabled']; $yesno_questions = array(); @endphp
@if($is_enabled_sub_ref_no) @endif @foreach($schema as $element) @php if($element['type'] == 'dropdown'){ if(stripos($element['options'],'yes') !== false && stripos($element['options'],'no') !== false){ array_push($yesno_questions, $element['name']); } } @endphp @if(in_array($element['name'], $col_visible)) @endif @endforeach @foreach($data as $k => $row) @if($is_enabled_sub_ref_no) @endif @foreach($schema as $row_element) @if(in_array($row_element['name'], $col_visible)) @endif @endforeach @endforeach
@lang('messages.action') @lang('messages.score') @lang('messages.review_score')@lang('messages.submission_numbering') {{ Str::limit($element['label'], 40)}} @lang('messages.submitted_on')
@php $yes_answers = 0; @endphp @foreach($schema as $row_element) @if(in_array($row_element['name'], $yesno_questions)) @isset($row->data[$row_element['name']]) @if(strcasecmp($row->data[$row_element['name']], 'yes') == 0) @php $yes_answers++; @endphp @endif @endisset @endif @endforeach {{ $yes_answers. "/" .count($yesno_questions) }} {{ number_format($row->comments()->average('score')) }} {{$row['submission_ref']}} @isset($row->data[$row_element['name']]) @if($row_element['type'] == 'file_upload') @include('form_data.file_view', ['form_upload' => $row->data[$row_element['name']]]) @elseif($row_element['type'] == 'signature') @if(!empty($row->data[$row_element['name']])) @endif @elseif($row_element['type'] == 'table') @foreach(explode("\n",$row_element['columns']) as $col_name) @endforeach @php $table_rows = explode("\n",$row_element['rows']); @endphp @foreach($row->data[$row_element['name']] as $key1 => $table_row) @if(array_key_exists($key1, $table_rows)) @foreach($table_row as $table_row_column) @endforeach @endif @endforeach
{{ explode("|",$col_name)[0]}}
{{$table_rows[$key1]}}{{$table_row_column}}
@elseif(is_array($row->data[$row_element['name']]) && $row_element['type'] != 'file_upload') {{implode(', ', $row->data[$row_element['name']])}} @elseif(in_array($row_element['type'], array('dropdown','checkbox','radio'))) {!! nl2br(str_replace('_',' ',$row->data[$row_element['name']])) !!} @else {!! nl2br($row->data[$row_element['name']]) !!} @endif @endisset
{{\Carbon\Carbon::createFromTimestamp(strtotime($row->created_at))->format($date_format)}}
{{$row->created_at->diffForHumans()}}
@else

Form Not found

@endif
@endsection @section('footer') @endsection