@extends('layouts.admin')
@section('page-title')
{{ $form->name.__("'s Response") }}
@endsection
@push('script-page')
@endpush
@section('breadcrumb')
{{__('Dashboard')}}
{{__('Form Builder')}}
{{__('Response')}}
@endsection
@section('content')
@if($form->response->count() > 0)
@php
$first = null;
$second = null;
$third = null;
$i = 0;
@endphp
@foreach ($form->response as $response)
@php
$i++;
$resp = json_decode($response->response,true);
if(count($resp) == 1)
{
$resp[''] = '';
$resp[' '] = '';
}
elseif(count($resp) == 2)
{
$resp[''] = '';
}
$firstThreeElements = array_slice($resp, 0, 3);
$thead= array_keys($firstThreeElements);
$head1 = ($first != $thead[0]) ? $thead[0] : '';
$head2 = (!empty($thead[1]) && $second != $thead[1]) ? $thead[1] : '';
$head3 = (!empty($thead[2]) && $third != $thead[2]) ? $thead[2] : '';
@endphp
@if(!empty($head1) || !empty($head2) || !empty($head3) && $head3 != ' ')
{{ $head1 }} |
{{ $head2 }} |
{{ $head3 }} |
# |
@endif
@php
$first = $thead[0];
$second = $thead[1];
$third = $thead[2];
@endphp
@foreach(array_values($firstThreeElements) as $ans)
{{$ans}} |
@endforeach
|
@endforeach
@else
{{__('No data available in table')}} |
@endif
@endsection