67 lines
3.8 KiB
PHP
67 lines
3.8 KiB
PHP
|
|
@extends('layouts.app')
|
||
|
|
|
||
|
|
@section('content')
|
||
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||
|
|
<div class="mb-8">
|
||
|
|
<h2 class="text-2xl font-bold text-slate-800 tracking-tight">Laporan Pelatihan Karyawan</h2>
|
||
|
|
<p class="text-sm text-slate-500 mt-1">Pantau progres evaluasi CPOB dan kelulusan ujian setiap karyawan secara realtime.</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="bg-white rounded-2xl shadow-sm border border-slate-200 overflow-hidden">
|
||
|
|
<div class="overflow-x-auto">
|
||
|
|
<table class="w-full text-left text-sm whitespace-nowrap">
|
||
|
|
<thead class="bg-slate-50 text-slate-500 text-xs uppercase tracking-wider">
|
||
|
|
<tr>
|
||
|
|
<th class="px-6 py-4 font-semibold">Nama Karyawan</th>
|
||
|
|
<th class="px-6 py-4 font-semibold text-center">Total Ujian</th>
|
||
|
|
<th class="px-6 py-4 font-semibold text-center">Lulus</th>
|
||
|
|
<th class="px-6 py-4 font-semibold text-center">Rata-rata Nilai</th>
|
||
|
|
<th class="px-6 py-4 font-semibold text-right">Aksi</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody class="divide-y divide-slate-100 text-slate-700">
|
||
|
|
@forelse($trainees as $trainee)
|
||
|
|
@php
|
||
|
|
$totalExams = $trainee->examResults->count();
|
||
|
|
$passed = $trainee->examResults->where('is_passed', true)->count();
|
||
|
|
$avgScore = $totalExams > 0 ? $trainee->examResults->avg('score') : 0;
|
||
|
|
@endphp
|
||
|
|
<tr class="hover:bg-slate-50 transition-colors">
|
||
|
|
<td class="px-6 py-4">
|
||
|
|
<div class="font-bold text-slate-900">{{ $trainee->first_name }} {{ $trainee->last_name }}</div>
|
||
|
|
<div class="text-xs text-slate-500">{{ $trainee->email }}</div>
|
||
|
|
</td>
|
||
|
|
<td class="px-6 py-4 text-center font-medium">{{ $totalExams }}</td>
|
||
|
|
<td class="px-6 py-4 text-center">
|
||
|
|
<span class="px-2.5 py-1 text-xs font-bold rounded-full {{ $passed > 0 ? 'bg-emerald-100 text-emerald-700' : 'bg-slate-100 text-slate-500' }}">
|
||
|
|
{{ $passed }} Modul
|
||
|
|
</span>
|
||
|
|
</td>
|
||
|
|
<td class="px-6 py-4 text-center font-bold {{ $avgScore >= 70 ? 'text-emerald-600' : 'text-red-500' }}">
|
||
|
|
{{ number_format($avgScore, 1) }}
|
||
|
|
</td>
|
||
|
|
<td class="px-6 py-4 text-right">
|
||
|
|
<a href="{{ route('admin.reports.training.show', $trainee->id) }}" class="inline-flex items-center text-sm font-semibold text-indigo-600 hover:text-indigo-800 transition-colors">
|
||
|
|
Lihat Detail
|
||
|
|
<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
|
||
|
|
</a>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@empty
|
||
|
|
<tr>
|
||
|
|
<td colspan="5" class="px-6 py-12 text-center text-slate-500">
|
||
|
|
Belum ada data evaluasi karyawan yang dapat ditampilkan.
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@endforelse
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
@if($trainees->hasPages())
|
||
|
|
<div class="p-4 border-t border-slate-100">
|
||
|
|
{{ $trainees->links() }}
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
@endsection
|