@extends('layouts.master') @section('title') Supplier Surveys @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Procurement @endslot @slot('title') Supplier Satisfaction Insights @endslot @endcomponent {{-- KPI cards --}}
@php $cards = [ ['l' => 'Satisfaction', 'v' => $stats['satisfaction'].'%', 'i' => 'ri-emotion-happy-line', 'b' => 'success'], ['l' => 'Avg Rating', 'v' => number_format($stats['avg_rating'],1).' / 5', 'i' => 'ri-star-line', 'b' => 'warning'], ['l' => 'Responses', 'v' => $stats['completed'].' / '.$stats['total'], 'i' => 'ri-survey-line', 'b' => 'info'], ['l' => 'Response Rate', 'v' => $stats['response_rate'].'%', 'i' => 'ri-pie-chart-line', 'b' => 'primary'], ]; @endphp @foreach($cards as $c)

{{ $c['l'] }}

{{ $c['v'] }}

@endforeach
Sentiment
👍

{{ $stats['thumbs_up'] }}

Thumbs Up
👎

{{ $stats['thumbs_down'] }}

Thumbs Down
@php $totalSent = $stats['thumbs_up'] + $stats['thumbs_down']; @endphp
{{ $stats['pending'] }} survey(s) awaiting response
Star Distribution
@for($r=5;$r>=1;$r--) @php $rc = $ratingBreakdown[$r] ?? 0; $pct = $stats['completed'] ? round($rc/$stats['completed']*100) : 0; @endphp
{{ $r }}
{{ $rc }}
@endfor
Recent Responses
@forelse($recent as $s) @empty @endforelse
SupplierRequisitionSentimentRatingCommentDate
{{ $s->supplier?->name }} {{ $s->requisition?->reference_no ?? '—' }} {{ $s->sentiment === 'up' ? '👍' : '👎' }} @for($i=1;$i<=5;$i++){{ $i <= $s->rating ? '★' : '☆' }}@endfor {{ \Illuminate\Support\Str::limit($s->comment, 50) ?: '—' }} {{ optional($s->submitted_at)->format('d M Y') }}
No completed surveys yet.
@endsection