@extends('layouts.app') @php $userRole = \Session::get('role'); $userPermission = \Session::get('userPermission'); @endphp @if($surveyDetail->call_attempt_1_datetime!='') @php $callAttempt1 = date('m/d/Y',strtotime($surveyDetail->call_attempt_1_datetime)); @endphp @else @php $callAttempt1 = ''; @endphp @endif @if($surveyDetail->call_attempt_2_datetime!='') @php $callAttempt2 = date('m/d/Y',strtotime($surveyDetail->call_attempt_2_datetime)); @endphp @else @php $callAttempt2 = ''; @endphp @endif @if($surveyDetail->call_attempt_3_datetime!='') @php $callAttempt3 = date('m/d/Y',strtotime($surveyDetail->call_attempt_3_datetime)); @endphp @else @php $callAttempt3 = ''; @endphp @endif @if($surveyDetail->call_attempt_4_datetime!='') @php $callAttempt4 = date('m/d/Y',strtotime($surveyDetail->call_attempt_4_datetime)); @endphp @else @php $callAttempt4 = ''; @endphp @endif @section('content')

View Response

@if(isset($userPermission['delete-survey-response'])) Delete Response @endif @if(isset($userPermission['update-survey-response'])) @if($userRole == 'super_admin') Edit Response @else @if($surveyDetail->survey_status != 'Feedback Collected') Edit Response @endif @endif @endif
  • Campaign Name
    {{$campaign->campaign_name}}
  • Survey Name
    {{$campaign->template_name}}
  • Start Date
    {{date('d M Y', strtotime($campaign->start_date))}}
  • End Date
    {{date('d M Y', strtotime($campaign->end_date))}}
  • Quarter
    {{$campaign->quarter}} {{$campaign->year}}
  • Customer Organization
    {{$customer->company!=''?$customer->company:'NA'}}
  • Customer Name
    {{$customer->customer_name}}
  • Segment
    {{$customer->segment!='' ? $customer->segment : 'NA'}}
  • Phone No.
    {{$customer->contact_number !='' ? $customer->contact_number : 'NA'}}
  • Language
    {{$customer->customer_language!='' ? $customer->customer_language : 'NA'}}
@if($userRole=='super_admin' || $userRole=='team_lead')
Survey Details
@if(isset($firstResponseDetail->created_at)) {{date('d/M/Y h:i:s', strtotime($firstResponseDetail->created_at))}} @endif
@if(isset($firstResponseDetail->filled_by)) @if($firstResponseDetail->filled_by=='customer_executive') Call @else Survey Link @endif @endif
Call Attempts ({{count($callAttempts)}})
@if(!$callAttempts->isEmpty()) @foreach($callAttempts as $key => $callAttempt) @if($callAttempt->status == 'Contacted') @php $statusClass = 'badge-success'; @endphp @elseif($callAttempt->status == 'Phone Off' || $callAttempt->status == 'Phone Busy' || $callAttempt->status == 'Wrong Number' || $callAttempt->status == 'Denied Feedback') @php $statusClass = 'badge-danger'; @endphp @else @php $statusClass = 'badge-warning'; @endphp @endif @endforeach @else @endif
Call Attempts Date & Time Status Call Back Time Remark
{{$key+1}} {{ date('d M Y H:i A', strtotime($callAttempt->created_at)) }} {{ $callAttempt->status }} {{ $callAttempt->callback_date!=null ? date('d M Y h:i A', strtotime($callAttempt->callback_date.' '.$callAttempt->callback_time)) : '-' }} {{ $callAttempt->remark != null ? $callAttempt->remark : '-' }}
No records found.
@else
Survey Details
    @if( $userRole != 'regional_coordinator' && $userRole != 'head_office')
  • Campaign Name
    {{ $campaign->campaign_name }}
  • Customer Care Executive
    {{ Auth::user()->name }}
  • @endif
  • Survey Start Date
    {{ $campaign->start_date }}
  • @if( $userRole != 'regional_coordinator' && $userRole != 'head_office')
  • Response Collection Mode
    Call
  • @endif
  • Survey Status
    {{ $surveyDetail->survey_status }}
  • @if( $userRole != 'regional_coordinator' && $userRole != 'head_office')
  • Team Lead
    {{ $campaign->team_lead }}
  • @endif
  • Survey Completion Date
    {{ $surveyDetail->survey_status }}
@if( $userRole != 'regional_coordinator' && $userRole != 'head_office')
{{ $campaign->opening_script }}
@endif
@endif
@csrf
Customer Response
@if(isset($response[0])) @php $responseIndex = $response[0]['response_index']; @endphp @else @php $responseIndex = 0; @endphp @endif
@foreach($questions as $key => $question) @php $question_no = $key+1; @endphp
@if(in_array($question->id, array_column($previousResponse, 'question_id'))) @php $index = array_search($question->id, array_column($previousResponse, 'question_id')); @endphp @if($previousResponse[$index]['response'] == $response[$index]['response']) @php $isChanged = 0; @endphp @else @php $isChanged = 1; @endphp @endif @else @php $isChanged = 0; @endphp @endif @if(in_array($question->id, array_column($response, 'question_id'))) @php $index = array_search($question->id, array_column($response, 'question_id')); $cardColor = 'bg-primary-light'; if($response[$index]['option_colour'] == 'green'){ $cardColor = 'bg-success'; } elseif ($response[$index]['option_colour'] == 'red'){ $cardColor = 'bg-danger'; } elseif ($response[$index]['option_colour'] == 'yellow'){ $cardColor = 'bg-warning'; } elseif ($response[$index]['option_colour'] == 'black'){ $cardColor = 'bg-dark'; } else{ $cardColor = 'bg-primary-light'; } @endphp @else @php $cardColor = 'bg-primary-light'; @endphp @endif
Q.{{$question_no}} @php $q = $question->question; @endphp @if(stripos($question->question, 'How likely is it that you will recommend') !== false) @if($campaign->aftermarket_touch_point == 1) @php $q = str_replace('< dealer name of dealership >', 'dealer '.$customer->workshop_name, $question->question); @endphp @elseif($campaign->aftermarket_touch_point == 2) @php $q = str_replace('< dealer name of dealership >', 'Volvos Site support', $question->question); @endphp @elseif($campaign->aftermarket_touch_point == 3) @php $q = str_replace('< dealer name of dealership >', 'Volvos services', $question->question); @endphp @endif @elseif(stripos($question->question, 'How likely is that you will prefer') !== false) @if($campaign->aftermarket_touch_point == 1) @php $q = str_replace('< visit Name of dealership >', 'visit '.$customer->workshop_name, $question->question); @endphp @elseif($campaign->aftermarket_touch_point == 2) @php $q = str_replace('< visit Name of dealership >', 'avail site support from Volvo', $question->question); @endphp @elseif($campaign->aftermarket_touch_point == 3) @php $q = str_replace('< visit Name of dealership >', 'avail services from Volvo', $question->question); @endphp @endif @endif {{$q}}
{{$question->commitment}}
{{$question->help_text}}
@if($question->question_type == 'radio') @foreach(explode(',', $question->options) as $key => $option) @php $checked = ''; $option_id = explode(',', $question->option_ids)[$key]; @endphp @if(in_array($question->id, array_column($response, 'question_id'))) @php $index = array_search($question->id, array_column($response, 'question_id')); @endphp @if($response[$index]['response'] == $option_id) @php $checked = 'checked'; @endphp @endif @if($previousResponse) @if($previousResponse[$index]['response'] == $option_id) @php $previousValue = $option; @endphp @endif @endif @endif
@endforeach @if($isChanged) (Previous Response : {{$previousValue}}) @endif @endif @if($question->question_type == 'checkbox') @foreach(explode(',', $question->options) as $key => $option) @php $checked = ''; $option_id = explode(',', $question->option_ids)[$key]; @endphp @if(in_array($question->id, array_column($response, 'question_id'))) @php $index = array_search($question->id, array_column($response, 'question_id')); @endphp @if(in_array($option_id, explode(',', $response[$index]['response']))) @php $checked = 'checked'; @endphp @endif @endif
@endforeach @endif @if($question->question_type == 'select')
@endif
{{-- @if(in_array($question->id, array_column($response, 'question_id'))) @php $index = array_search($question->id, array_column($response, 'question_id')); @endphp @if($response[$index]['option_colour'] == 'green')
Green
@elseif($response[$index]['option_colour'] == 'red')
Red
@elseif($response[$index]['option_colour'] == 'yellow')
Yellow
@elseif($response[$index]['option_colour'] == 'black')
Black
@endif @endif --}}
@if($question->additional_textbox == 1)
@php $remark = $textColour = $isRequired = ''; @endphp @if($question->textbox_mandatory == 1) @php $isRequired = 'required'; @endphp @endif @if(in_array($question->id, array_column($response, 'question_id'))) @php $index = array_search($question->id, array_column($response, 'question_id')); $remark = trim($response[$index]['response_remark']); @endphp @if($response[$index]['response_index'] > 1) @php $textColour = 'text-danger'; @endphp @endif @endif
@if($remark) {{$remark}} @else N.A @endif
@endif
@endforeach
Final Comments