48 lines
1.8 KiB
PHP
48 lines
1.8 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Data Pasien')
|
|
@section('content')
|
|
<div class="container">
|
|
<h1>Data Pasien</h1>
|
|
<a href="{{ route('ms_pasien.create') }}" class="btn btn-primary mb-3">Tambah Pasien</a>
|
|
|
|
<form method="GET" action="{{ route('ms_pasien.index') }}" class="mb-3">
|
|
<input type="text" name="search" class="form-control" placeholder="Cari berdasarkan nama atau ID..." value="{{ request('search') }}">
|
|
</form>
|
|
|
|
<table class="table table-bordered">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Nama Pasien</th>
|
|
<th>Tanggal Lahir</th>
|
|
<th>Jenis Kelamin</th>
|
|
<th>Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($pasiens as $pasien)
|
|
<tr>
|
|
<td>{{ $pasien->MRPasien }}</td> <!-- Menggunakan IdPasien -->
|
|
<td>{{ $pasien->NamaPasien }}</td>
|
|
<td>{{ $pasien->TanggalLahir }}</td>
|
|
<td>{{ $pasien->JenisKelamin }}</td>
|
|
<td>
|
|
<!-- Menggunakan IdPasien untuk mengarahkan ke halaman edit -->
|
|
<a href="{{ route('ms_pasien.edit', $pasien->MRPasien) }}" class="btn btn-warning btn-sm">Edit</a>
|
|
|
|
<!-- Menggunakan IdPasien untuk menghapus data -->
|
|
<form action="{{ route('ms_pasien.destroy', $pasien->MRPasien) }}" method="POST" style="display:inline;">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button class="btn btn-danger btn-sm" onclick="return confirm('Yakin hapus?')">Hapus</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
{{ $pasiens->links() }}
|
|
</div>
|
|
@endsection
|