80 lines
4.2 KiB
PHP
80 lines
4.2 KiB
PHP
@extends('layouts.admin.app')
|
|
|
|
@section('title', '| Sub-Kategori')
|
|
|
|
@section('content')
|
|
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-8 border border-gray-100 dark:border-gray-700">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h1 class="text-2xl font-bold text-gray-800 dark:text-white">Daftar Sub-Kriteria</h1>
|
|
<a href="{{ route('admin.subcategories.create') }}" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 cursor-pointer">
|
|
Tambah
|
|
</a>
|
|
</div>
|
|
|
|
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
|
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 overflow-hidden rounded-lg">
|
|
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
|
<tr class="h-12">
|
|
<th scope="col" class="px-6 py-3 rounded-tl-lg">
|
|
NO
|
|
</th>
|
|
<th scope="col" class="px-6 py-3">
|
|
NAMA SUB-KRITERIA
|
|
</th>
|
|
<th scope="col" class="px-6 py-3">
|
|
KRITERIA
|
|
</th>
|
|
<th scope="col" class="px-6 py-3">
|
|
NILAI SMART
|
|
</th>
|
|
<th scope="col" class="px-6 py-3 text-right rounded-tr-lg">
|
|
AKSI
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($subcategories as $index => $subcategory)
|
|
<tr class="h-16 bg-white dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600 transition-colors hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
<th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap {{ $loop->first ? 'rounded-tl-lg' : '' }} {{ $loop->last ? 'rounded-bl-lg' : '' }}">
|
|
{{ $index + 1 }}
|
|
</th>
|
|
<td class="px-6 py-4 text-gray-500 dark:text-gray-400 select-text">
|
|
{{ $subcategory->name }}
|
|
</td>
|
|
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">
|
|
{{ $subcategory->category->name }}
|
|
</td>
|
|
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">
|
|
{{ $subcategory->value ?? '-' }}
|
|
</td>
|
|
<td class="px-6 py-4 text-right {{ $loop->first ? 'rounded-tr-lg' : '' }} {{ $loop->last ? 'rounded-br-lg' : '' }}">
|
|
<div class="flex items-center justify-end space-x-4">
|
|
<a href="{{ route('admin.subcategories.edit', $subcategory) }}" class="text-xs font-semibold uppercase hover:underline text-blue-600 dark:text-blue-400">
|
|
Edit
|
|
</a>
|
|
<form action="{{ route('admin.subcategories.destroy', $subcategory) }}" method="POST" onsubmit="return confirm('Apakah Anda yakin ingin menghapus sub-kategori ini?');" class="inline">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-xs font-semibold uppercase hover:underline cursor-pointer text-blue-600 dark:text-blue-400">
|
|
Hapus
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr class="h-16 bg-white dark:bg-gray-700">
|
|
<td colspan="5" class="px-6 py-4 text-center text-gray-500 dark:text-gray-400 rounded-b-lg">
|
|
Tidak ada sub-kategori yang ditemukan.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="mt-6">
|
|
{{ $subcategories->links() }}
|
|
</div>
|
|
</div>
|
|
@endsection
|