@extends('layouts.app') @section('title', 'Dasbor') @section('page-title', 'Dasbor') @section('plain-content', true) @php $user = Auth::user(); $isAdmin = $user->role === 'admin'; if ($isAdmin) { $pendingCount = \App\Models\User::where('role', 'alumni')->where('status', 'pending')->count(); $approvedCount = \App\Models\User::where('role', 'alumni')->where('status', 'approved')->count(); $rejectedCount = \App\Models\User::where('role', 'alumni')->where('status', 'rejected')->count(); $activeSurveysCount = \App\Models\Survei::where('aktif', true)->count(); $recentAlumni = \App\Models\AlumniProfile::with('programStudi')->latest()->take(6)->get(); $prodiLabels = $alumniPerProdi->pluck('nama')->values(); $prodiCounts = $alumniPerProdi->pluck('alumni_profiles_count')->values(); $approvalLabels = [ __('static_ui.Menunggu'), __('static_ui.Disetujui'), __('static_ui.Ditolak'), ]; } else { $profile = $profile ?? null; $pekerjaan = $pekerjaan ?? collect(); $profileChecklist = $profileChecklist ?? collect(); $profileCompletion = $profileCompletion ?? 0; $isProfileComplete = $profileCompletion >= 100; $workCount = $profile ? $pekerjaan->count() : 0; $pendidikanCount = $pendidikanCount ?? 0; $activeSurveys = $activeSurveys ?? collect(); $availableSurveyCount = $availableSurveyCount ?? 0; $recommendedJobs = $recommendedJobs ?? collect(); $pekerjaanTerkini = $pekerjaanTerkini ?? null; $statusLabels = [ 'approved' => 'Disetujui', 'pending' => 'Menunggu Persetujuan', 'rejected' => 'Ditolak', ]; $statusBadgeClass = $user->status === 'approved' ? 'bg-emerald-100 text-emerald-800' : ($user->status === 'pending' ? 'bg-amber-100 text-amber-800' : 'bg-rose-100 text-rose-800'); } @endphp @section('content') @if($isAdmin)
Panel Pengelola

Ringkasan operasional tracer study

Status akun alumni

Disetujui {{ $approvedCount }}
Menunggu {{ $pendingCount }}
Ditolak {{ $rejectedCount }}

Profil Alumni

{{ number_format($totalAlumni, 0, ',', '.') }}

Pengguna Alumni

{{ number_format($totalUser, 0, ',', '.') }}

Program Studi

{{ number_format($totalProdi, 0, ',', '.') }}

Riwayat Kerja

{{ number_format($riwayatPekerjaan, 0, ',', '.') }}

Survei Aktif

{{ number_format($activeSurveysCount, 0, ',', '.') }}

Sebaran data

Alumni per program studi

{{ $totalProdi }} prodi

Data terbaru

Alumni terbaru

Lihat semua
@forelse($recentAlumni as $alumni) @php $fotoName = $alumni->foto ? basename($alumni->foto) : null; $fotoPath = $fotoName ? 'alumni/' . $fotoName : null; $fotoUrl = $fotoPath && \Illuminate\Support\Facades\Storage::disk('public')->exists($fotoPath) ? asset('storage/' . $fotoPath) : null; @endphp
@if($fotoUrl) Foto {{ $alumni->nama_lengkap }} @else @endif

{{ $alumni->nama_lengkap }}

ID Profil #{{ $alumni->id }}

NIM

{{ $alumni->nim ?: '-' }}

Tahun

{{ $alumni->tahun_lulus ?: '-' }}

Program Studi

{{ $alumni->programStudi->nama ?? 'Belum diisi' }}

Detail
@empty
Belum ada data alumni.
@endforelse
@else
@php $profileFotoName = $profile && $profile->foto ? basename($profile->foto) : null; $profileFotoPath = $profileFotoName ? 'alumni/' . $profileFotoName : null; $profileFotoUrl = $profileFotoPath && \Illuminate\Support\Facades\Storage::disk('public')->exists($profileFotoPath) ? asset('storage/' . $profileFotoPath) : null; $profileActionUrl = $profile ? route('alumni.profile') : route('alumni.profile.create'); $profileActionLabel = $profile ? 'Perbarui Profil' : 'Buat Profil'; @endphp
@if($profileFotoUrl) Foto Profil @else @endif
Dasbor Mahasiswa

{{ $profile ? $profile->nama_lengkap : $user->name }}

{{ $profile ? ($profile->nim ?: ($user->nim ?: 'NIM belum diisi')) : ($user->nim ?: 'NIM belum diisi') }} {{ $profile && $profile->programStudi ? $profile->programStudi->nama : 'Program studi belum diisi' }} {{ $statusLabels[$user->status] ?? ucfirst($user->status ?? 'pending') }}
@if($user->status === 'pending')
Akun Anda sedang menunggu persetujuan admin. Beberapa fitur akan terbuka setelah akun disetujui.
@elseif($user->status === 'rejected')
Pendaftaran Anda ditolak. Hubungi administrator untuk pengecekan data pendaftaran.
@endif

Profil

{{ $profileCompletion }}%

{{ $isProfileComplete ? 'Data utama lengkap' : 'Perlu dilengkapi' }}

Survei Perlu Diisi

{{ number_format($availableSurveyCount) }}

{{ number_format($activeSurveys->count()) }} survei aktif

Riwayat Kerja

{{ number_format($workCount) }}

{{ $pekerjaanTerkini ? 'Pekerjaan terkini tersedia' : 'Belum ada data kerja' }}

Pendidikan Lanjut

{{ number_format($pendidikanCount) }}

Data studi lanjutan

Survei

Survei Aktif

Semua Survei
@if($user->status === 'approved' && $profile)
@forelse($activeSurveys as $survei)
{{ number_format($survei->pertanyaan_survei_count) }} pertanyaan {{ $survei->selesai_diisi ? 'Selesai' : 'Perlu diisi' }}

{{ $survei->judul }}

{{ \Illuminate\Support\Str::limit($survei->deskripsi ?: 'Tidak ada deskripsi.', 120) }}

{{ $survei->jawaban_count }}/{{ $survei->pertanyaan_survei_count }} jawaban . Batas {{ \Carbon\Carbon::parse($survei->tanggal_selesai)->format('d M Y') }}

{{ $survei->selesai_diisi ? 'Lihat' : 'Isi Survei' }}
@empty

Tidak ada survei aktif saat ini.

Survei baru akan tampil otomatis ketika periode dibuka.

@endforelse
@else

Survei belum tersedia

Akses survei terbuka setelah akun disetujui dan profil alumni dibuat.

@endif

Lowongan

Rekomendasi Karir

Lihat Lowongan
@forelse($recommendedJobs as $lowongan)

{{ $lowongan->judul }}

{{ $lowongan->perusahaan ?: 'Perusahaan belum diisi' }}

{{ $lowongan->lokasi ?: 'Lokasi fleksibel' }} {{ $lowongan->tipe_pekerjaan ?: 'Tipe belum diisi' }}
@empty

Belum ada lowongan relevan.

Lowongan baru akan tampil ketika admin membuka publikasi karir.

@endforelse
@endif @endsection @if($isAdmin) @push('scripts') @endpush @endif