?
@extends('layoutsdashboard.dashboard-design', [
'webtitle' => 'Questions Manager',
])
@section('content')
<div class="section-userdata">
<div class="container py-2">
<div class="card shadow mt-4">
<div class="card-header card-title bg-transparent d-flex justify-content-between">
<h4 class="mb-2 mb-sm-0">Manage Testimonials</h4>
<a href="{{ route('testimonials.create') }}" class="btn btn-primary">
<i class="fas fa-plus fa-sm text-white-50"></i> Add New Testimonial
</a>
</div>
@if (session('success'))
<div class="alert alert-success" role="alert">
{{ session('success') }}
</div>
@endif
<div class="table-responsive border-0">
<table class="table table-dark-gray align-middle p-4 mt-0 table-hover">
<!-- Table head -->
<thead>
<tr>
<th>Name</th>
<th>Company</th>
<th>Rating</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@forelse ($testimonials as $testimonial)
<tr>
<td>{{ $testimonial->name }}</td>
<td>{{ $testimonial->company }}</td>
<td>{{ $testimonial->rating ? $testimonial->rating . ' ★' : 'N/A' }}</td>
<td>
@if ($testimonial->is_published)
<span class="badge bg-success">Published</span>
@else
<span class="badge bg-secondary">Draft</span>
@endif
</td>
<td>
<a href="{{ route('testimonials.edit', $testimonial) }}" class="btn btn-light btn-round me-1 mb-1 mb-md-1"><i class="bi bi-pencil-square"></i></a>
<form action="{{ route('testimonials.destroy', $testimonial) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this item?');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-light btn-round me-1 mb-1 mb-md-1"><i class="bi bi-trash"></i></button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="text-center">No testimonials found.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="d-flex justify-content-center">
{{ $testimonials->links() }}
</div>
</div></div></div>
@stop