210 lines
5.0 KiB
PHP
210 lines
5.0 KiB
PHP
@extends('layouts.admin')
|
|
|
|
@section('title', 'Data Gejala')
|
|
|
|
@section('content')
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
|
|
<!-- HEADER -->
|
|
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
|
|
|
|
<!-- BUTTON TAMBAH -->
|
|
<a href="{{ route('gejala.create') }}" class="btn btn-primary">
|
|
+ Tambah Gejala
|
|
</a>
|
|
|
|
<div class="d-flex gap-2">
|
|
|
|
<!-- SEARCH -->
|
|
<form method="GET" class="d-flex">
|
|
|
|
<input type="text"
|
|
name="search"
|
|
class="form-control form-control-sm"
|
|
placeholder="Cari gejala..."
|
|
value="{{ request('search') }}">
|
|
|
|
<button class="btn btn-primary btn-sm ms-2">
|
|
Cari
|
|
</button>
|
|
|
|
</form>
|
|
|
|
<!-- PER PAGE -->
|
|
<form method="GET">
|
|
|
|
<input type="hidden"
|
|
name="search"
|
|
value="{{ request('search') }}">
|
|
|
|
<select name="perPage"
|
|
onchange="this.form.submit()"
|
|
class="form-select form-select-sm">
|
|
|
|
<option value="5" {{ $perPage == 5 ? 'selected' : '' }}>5</option>
|
|
<option value="10" {{ $perPage == 10 ? 'selected' : '' }}>10</option>
|
|
<option value="25" {{ $perPage == 25 ? 'selected' : '' }}>25</option>
|
|
<option value="50" {{ $perPage == 50 ? 'selected' : '' }}>50</option>
|
|
|
|
</select>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ALERT -->
|
|
@if(session('success'))
|
|
|
|
<div class="alert alert-success">
|
|
|
|
{{ session('success') }}
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
<!-- TABLE -->
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-bordered table-hover align-middle">
|
|
|
|
<thead class="table-light">
|
|
|
|
<tr>
|
|
|
|
<th width="60">No</th>
|
|
|
|
<th width="100">Kode</th>
|
|
|
|
<th>Nama Gejala</th>
|
|
|
|
<th width="90">MB</th>
|
|
|
|
<th width="90">MD</th>
|
|
|
|
<th width="100">CF Pakar</th>
|
|
|
|
<th width="180">Aksi</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@forelse($gejalas as $g)
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{ $loop->iteration + ($gejalas->currentPage() - 1) * $gejalas->perPage() }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ $g->kode }}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ $g->nama }}
|
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
|
|
|
{{ number_format($g->mb, 2) }}
|
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
|
|
|
{{ number_format($g->md, 2) }}
|
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
|
|
|
<span class="badge bg-primary">
|
|
|
|
{{ number_format($g->mb - $g->md, 2) }}
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="{{ route('gejala.edit', $g->id) }}"
|
|
class="btn btn-warning btn-sm">
|
|
|
|
Edit
|
|
|
|
</a>
|
|
|
|
<form action="{{ route('gejala.destroy', $g->id) }}"
|
|
method="POST"
|
|
style="display:inline;">
|
|
|
|
@csrf
|
|
@method('DELETE')
|
|
|
|
<button class="btn btn-danger btn-sm"
|
|
onclick="return confirm('Yakin ingin menghapus data ini?')">
|
|
|
|
Hapus
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@empty
|
|
|
|
<tr>
|
|
|
|
<td colspan="7" class="text-center text-muted">
|
|
|
|
@if(request('search'))
|
|
|
|
Data gejala tidak ditemukan
|
|
|
|
@else
|
|
|
|
Belum ada data gejala
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforelse
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- PAGINATION -->
|
|
<div class="mt-3">
|
|
|
|
{{ $gejalas->links('pagination::bootstrap-5') }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
@endsection |