Perbaikan modul data karyawan dan staff + modul SOP import
This commit is contained in:
@@ -1,57 +1,79 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Master SOP - HRIS')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
|
||||
<div class="flex flex-col md:flex-row md:items-center justify-between mb-8 gap-4">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-slate-800 tracking-tight">Dokumen SOP & CPOB</h2>
|
||||
<p class="text-sm text-slate-500">Pusat data prosedur operasi standar perusahaan.</p>
|
||||
<h2 class="text-2xl font-bold text-slate-800 tracking-tight">Manajemen SOP & Training Matrix</h2>
|
||||
<p class="text-sm text-slate-500 mt-1">Kelola dokumen Standar Operasional Prosedur dan modul pelatihan.</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<a href="#" class="inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-semibold hover:bg-blue-700 shadow-sm transition-all">
|
||||
+ Tambah SOP Baru
|
||||
</a>
|
||||
</div>
|
||||
<a href="{{ route('admin.sops.create') }}" class="px-4 py-2 bg-indigo-600 text-white rounded-md text-sm font-semibold hover:bg-indigo-700 shadow-sm transition-all">
|
||||
+ Registrasi SOP
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
|
||||
<div class="bg-white p-5 rounded-t-2xl border border-slate-200 border-b-0">
|
||||
<form action="{{ route('admin.sops.index') }}" method="GET" class="flex flex-col md:flex-row gap-4">
|
||||
<div class="w-full md:w-1/3">
|
||||
<input type="text" name="search" value="{{ request('search') }}" placeholder="Cari judul SOP atau Modul..."
|
||||
class="w-full px-4 py-2 bg-slate-50 border border-slate-200 rounded-xl text-sm focus:ring-blue-500">
|
||||
</div>
|
||||
<button type="submit" class="px-5 py-2 bg-slate-800 text-white rounded-xl text-sm font-semibold hover:bg-slate-700">Cari</button>
|
||||
@if(request('search'))
|
||||
<a href="{{ route('admin.sops.index') }}" class="px-5 py-2 bg-red-50 text-red-600 border border-red-100 rounded-xl text-sm font-semibold hover:bg-red-100">Reset</a>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="bg-white border border-slate-200 rounded-b-2xl overflow-hidden shadow-sm">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left border-collapse">
|
||||
<thead>
|
||||
<tr class="bg-slate-50 border-b border-slate-200 text-xs uppercase tracking-wider text-slate-500 font-bold">
|
||||
<th class="p-4">Kode SOP</th>
|
||||
<th class="p-4">Judul Dokumen</th>
|
||||
<th class="p-4">Versi</th>
|
||||
<th class="p-4">Status</th>
|
||||
<th class="p-4 text-right">Aksi</th>
|
||||
<table class="w-full text-left text-sm whitespace-nowrap">
|
||||
<thead class="bg-slate-50/80 text-slate-500 text-xs uppercase tracking-wider border-b border-slate-200">
|
||||
<tr>
|
||||
<th class="px-6 py-4 font-semibold">No</th>
|
||||
<th class="px-6 py-4 font-semibold">Judul SOP / Modul</th>
|
||||
<th class="px-6 py-4 font-semibold">Departemen Terkait</th>
|
||||
<th class="px-6 py-4 font-semibold">Status</th>
|
||||
<th class="px-6 py-4 font-semibold text-right">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100 text-sm text-slate-700">
|
||||
@foreach($sops as $sop)
|
||||
<tbody class="divide-y divide-slate-100 text-slate-700">
|
||||
{{-- Ganti $sops dengan variabel yang Anda kirim dari DashboardController@sopIndex --}}
|
||||
@forelse($sops ?? [] as $index => $sop)
|
||||
<tr class="hover:bg-slate-50">
|
||||
<td class="p-4 font-mono font-medium">{{ $sop->sop_code }}</td>
|
||||
<td class="p-4 font-bold text-slate-800">{{ $sop->title }}</td>
|
||||
<td class="p-4">v{{ $sop->version }}</td>
|
||||
<td class="p-4">
|
||||
@if($sop->status == 'Active')
|
||||
<span class="px-2.5 py-1 bg-emerald-100 text-emerald-700 text-xs font-bold rounded-full">Active</span>
|
||||
@elseif($sop->status == 'Draft')
|
||||
<span class="px-2.5 py-1 bg-amber-100 text-amber-700 text-xs font-bold rounded-full">Draft</span>
|
||||
@else
|
||||
<span class="px-2.5 py-1 bg-slate-200 text-slate-700 text-xs font-bold rounded-full">Obsolete</span>
|
||||
@endif
|
||||
<td class="px-6 py-4 text-slate-500">{{ $index + 1 }}</td>
|
||||
<td class="px-6 py-4 font-bold text-slate-900">{{ $sop->title ?? $sop->name ?? 'Judul SOP' }}</td>
|
||||
<td class="px-6 py-4">{{ $sop->department->name ?? 'Semua Departemen' }}</td>
|
||||
<td class="px-6 py-4">
|
||||
<span class="px-2 py-1 bg-emerald-50 text-emerald-600 rounded text-[10px] font-bold uppercase tracking-wider border border-emerald-100">Aktif</span>
|
||||
</td>
|
||||
<td class="p-4 text-right">
|
||||
<a href="#" class="text-slate-500 hover:text-indigo-600 font-medium text-xs">Lihat Detail</a>
|
||||
<td class="px-6 py-4 text-right space-x-3">
|
||||
<a href="#" class="text-indigo-600 hover:text-indigo-800 font-medium text-sm">Lihat Dokumen</a>
|
||||
<a href="#" class="text-slate-400 hover:text-blue-600 font-medium text-sm">Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="px-6 py-12 text-center">
|
||||
<svg class="w-12 h-12 text-slate-300 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
|
||||
<p class="text-slate-500 font-medium">Belum ada data SOP atau Training Matrix.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="p-4 border-t border-slate-100">
|
||||
|
||||
{{-- Jika ada pagination --}}
|
||||
@if(isset($sops) && method_exists($sops, 'hasPages') && $sops->hasPages())
|
||||
<div class="p-4 border-t border-slate-100 bg-slate-50/50">
|
||||
{{ $sops->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user