336 lines
15 KiB
PHP
336 lines
15 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="id">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Data Asuransi | SIM-RS Anak dan Bunda Harapan Kita</title>
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
|
|
<style>
|
|
/* Gunakan style yang sama dengan halaman sebelumnya */
|
|
:root {
|
|
--primary-color: #0075c9;
|
|
--secondary-color: #64c4ed;
|
|
--accent-color: #ffaa00;
|
|
--light-color: #f8fcff;
|
|
--dark-color: #124467;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Nunito', sans-serif;
|
|
background: linear-gradient(135deg, rgba(18, 68, 103, 0.95), rgba(0, 117, 201, 0.85)),
|
|
url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
|
|
background-size: cover;
|
|
background-position: center;
|
|
background-attachment: fixed;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.data-container {
|
|
flex: 1;
|
|
padding: 40px 20px;
|
|
}
|
|
|
|
.data-card {
|
|
background-color: rgba(255, 255, 255, 0.95);
|
|
border-radius: 20px;
|
|
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
.data-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 8px;
|
|
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
|
|
}
|
|
|
|
.hospital-logo {
|
|
width: 80px;
|
|
height: 80px;
|
|
object-fit: contain;
|
|
padding: 10px;
|
|
background-color: white;
|
|
border-radius: 50%;
|
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.display-title {
|
|
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
font-weight: 800;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.btn-primary-gradient {
|
|
background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
|
|
border: none;
|
|
color: white;
|
|
font-weight: 600;
|
|
padding: 10px 20px;
|
|
border-radius: 30px;
|
|
box-shadow: 0 4px 10px rgba(0, 117, 201, 0.3);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.btn-primary-gradient:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 6px 15px rgba(0, 117, 201, 0.4);
|
|
color: white;
|
|
}
|
|
|
|
.table-custom {
|
|
background-color: white;
|
|
border-radius: 15px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.table-custom thead {
|
|
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
|
|
color: white;
|
|
}
|
|
|
|
.table-custom th {
|
|
border: none;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.table-custom td {
|
|
vertical-align: middle;
|
|
border-color: #f0f7ff;
|
|
}
|
|
|
|
.action-btn {
|
|
width: 35px;
|
|
height: 35px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: 50%;
|
|
margin: 0 3px;
|
|
}
|
|
|
|
.modal-content {
|
|
border-radius: 15px;
|
|
border: none;
|
|
}
|
|
|
|
.modal-header {
|
|
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
|
|
color: white;
|
|
border-radius: 15px 15px 0 0;
|
|
}
|
|
|
|
.bg-pink {
|
|
background-color: rgb(182, 83, 100) !important;
|
|
}
|
|
|
|
.back-link {
|
|
color: var(--primary-color);
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.back-link:hover {
|
|
color: var(--secondary-color);
|
|
transform: translateX(-3px);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="data-container container py-4">
|
|
<div class="row justify-content-center">
|
|
<div class="col-lg-10 col-xl-12">
|
|
<div class="text-start mb-3">
|
|
<a href="/" class="back-link">
|
|
<i class="fas fa-arrow-left me-2"></i> Kembali ke Beranda
|
|
</a>
|
|
</div>
|
|
|
|
<div class="data-card p-4 p-md-5 my-2">
|
|
<div class="text-center mb-4">
|
|
<img src="{{ asset('assets/images/logo.png') }}" alt="Logo RS" class="hospital-logo">
|
|
<h2 class="h3 display-title">DATA ASURANSI</h2>
|
|
<p class="subtitle">Sistem Informasi Manajemen RS Anak dan Bunda Harapan Kita</p>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-between mb-4">
|
|
<div class="search-box">
|
|
<div class="input-group">
|
|
<span class="input-group-text bg-white"><i class="fas fa-search"></i></span>
|
|
<input type="text" class="form-control" placeholder="Cari asuransi..." id="searchInput">
|
|
</div>
|
|
</div>
|
|
<button class="btn btn-primary-gradient" data-bs-toggle="modal" data-bs-target="#addAsuransiModal">
|
|
<i class="fas fa-plus-circle me-2"></i>Tambah Asuransi
|
|
</button>
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
<table class="table table-custom table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th width="5%">No</th>
|
|
<th>Nama Asuransi</th>
|
|
<th width="15%">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($asuransis as $item)
|
|
<tr>
|
|
<td>{{ $loop->iteration }}</td>
|
|
<td>{{ $item->nama_asuransi }}</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-warning action-btn" data-bs-toggle="modal" data-bs-target="#editAsuransiModal{{ $item->id_asuransi }}">
|
|
<i class="fas fa-edit text-white"></i>
|
|
</button>
|
|
<button class="btn btn-sm btn-danger action-btn" data-bs-toggle="modal" data-bs-target="#deleteAsuransiModal{{ $item->id_asuransi }}">
|
|
<i class="fas fa-trash-alt text-white"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Modal Edit -->
|
|
<div class="modal fade" id="editAsuransiModal{{ $item->id_asuransi }}" tabindex="-1" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Edit Data Asuransi</h5>
|
|
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<form action="{{ route('asuransi.update', $item->id_asuransi) }}" method="POST">
|
|
@csrf
|
|
@method('PUT')
|
|
<div class="modal-body">
|
|
<div class="mb-3">
|
|
<label class="form-label">Nama Asuransi</label>
|
|
<input type="text" class="form-control" name="nama_asuransi" value="{{ $item->nama_asuransi }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
|
<button type="submit" class="btn btn-primary-gradient">Simpan Perubahan</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal Delete -->
|
|
<div class="modal fade" id="deleteAsuransiModal{{ $item->id_asuransi }}" tabindex="-1" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header bg-danger">
|
|
<h5 class="modal-title text-white">Konfirmasi Hapus</h5>
|
|
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<form action="{{ route('asuransi.destroy', $item->id_asuransi) }}" method="POST">
|
|
@csrf
|
|
@method('DELETE')
|
|
<div class="modal-body">
|
|
<p>Apakah Anda yakin ingin menghapus asuransi <strong>{{ $item->nama_asuransi }}</strong>?</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
|
<button type="submit" class="btn btn-danger">Ya, Hapus</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-between align-items-center mt-3">
|
|
<div class="text-muted">
|
|
Menampilkan {{ $asuransis->firstItem() }} - {{ $asuransis->lastItem() }} dari {{ $asuransis->total() }} asuransi
|
|
</div>
|
|
<div>
|
|
{{ $asuransis->links() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal Add -->
|
|
<div class="modal fade" id="addAsuransiModal" tabindex="-1" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Tambah Asuransi Baru</h5>
|
|
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<form action="{{ route('asuransi.store') }}" method="POST">
|
|
@csrf
|
|
<div class="modal-body">
|
|
<div class="mb-3">
|
|
<label class="form-label">Nama Asuransi</label>
|
|
<input type="text" class="form-control" name="nama_asuransi" required>
|
|
<small class="text-muted">Contoh: BPJS Kesehatan, Allianz, Prudential, dll.</small>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
|
<button type="submit" class="btn btn-primary-gradient">Simpan Data</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="footer text-center py-3">
|
|
<div class="container">
|
|
<p class="mb-0">
|
|
© 2025 RS Anak dan Bunda Harapan Kita |
|
|
<a href="#">Kebijakan Privasi</a> |
|
|
<a href="#">Kontak Kami</a>
|
|
</p>
|
|
</div>
|
|
</footer>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
// Fungsi pencarian
|
|
document.getElementById('searchInput').addEventListener('keyup', function() {
|
|
const searchValue = this.value.toLowerCase();
|
|
const rows = document.querySelectorAll('.table-custom tbody tr');
|
|
|
|
rows.forEach(row => {
|
|
const namaAsuransi = row.querySelector('td:nth-child(2)').textContent.toLowerCase();
|
|
if (namaAsuransi.includes(searchValue)) {
|
|
row.style.display = '';
|
|
} else {
|
|
row.style.display = 'none';
|
|
}
|
|
});
|
|
});
|
|
|
|
// Validasi form tambah asuransi
|
|
document.getElementById('addAsuransiModal').addEventListener('shown.bs.modal', function() {
|
|
const form = this.querySelector('form');
|
|
form.addEventListener('submit', function(e) {
|
|
const nama = this.querySelector('[name="nama_asuransi"]').value.trim();
|
|
if(nama.length < 3) {
|
|
alert('Nama asuransi harus minimal 3 karakter');
|
|
e.preventDefault();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |