130 lines
3.6 KiB
PHP
130 lines
3.6 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="id">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Data Siswa</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
font-family: 'Poppins', sans-serif;
|
|
}
|
|
body {
|
|
background: linear-gradient(135deg, #74ebd5, #ACB6E5);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
color: #333;
|
|
}
|
|
.container {
|
|
width: 90%;
|
|
max-width: 900px;
|
|
background: #ffffff;
|
|
padding: 40px;
|
|
border-radius: 20px;
|
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
|
}
|
|
h1 {
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
color: #2c3e50;
|
|
}
|
|
.button, .button-edit {
|
|
display: inline-block;
|
|
padding: 12px 25px;
|
|
margin-top: 20px;
|
|
color: #ffffff;
|
|
background: #3498db;
|
|
text-decoration: none;
|
|
border-radius: 50px;
|
|
font-weight: 600;
|
|
transition: background 0.3s ease;
|
|
}
|
|
.button:hover, .button-edit:hover {
|
|
background: #2980b9;
|
|
}
|
|
.alert {
|
|
padding: 15px;
|
|
background-color: #d1f2eb;
|
|
color: #117864;
|
|
margin-bottom: 20px;
|
|
border-left: 6px solid #1abc9c;
|
|
border-radius: 8px;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 20px;
|
|
overflow: hidden;
|
|
border-radius: 15px;
|
|
}
|
|
thead {
|
|
background-color: #3498db;
|
|
color: white;
|
|
}
|
|
th, td {
|
|
padding: 15px;
|
|
text-align: center;
|
|
font-size: 16px;
|
|
border-bottom: 1px solid #e1e1e1;
|
|
}
|
|
tbody tr:nth-child(even) {
|
|
background-color: #f4f9fd;
|
|
}
|
|
tbody tr:hover {
|
|
background-color: #eaf6ff;
|
|
}
|
|
p {
|
|
text-align: center;
|
|
margin-top: 20px;
|
|
font-size: 18px;
|
|
color: #555;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Data Siswa</h1>
|
|
|
|
@if(session('success'))
|
|
<div class="alert">{{ session('success') }}</div>
|
|
@endif
|
|
|
|
@if(count($siswas) > 0)
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Nama</th>
|
|
<th>Kelas</th>
|
|
<th>Umur</th>
|
|
<th>Absen</th>
|
|
<th>Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($siswas as $index => $siswa)
|
|
<tr>
|
|
<td>{{ $index + 1 }}</td>
|
|
<td>{{ $siswa['nama'] }}</td>
|
|
<td>{{ $siswa['kelas'] }}</td>
|
|
<td>{{ $siswa['umur'] }}</td>
|
|
<td>{{ $siswa['absen'] }}</td>
|
|
<td>
|
|
<a href="{{ route('siswa.edit', $index) }}" class="button-edit">Edit</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@else
|
|
<p>Belum ada data siswa, silahkan tambahkan data.</p>
|
|
@endif
|
|
|
|
<a href="{{ route('siswa.create') }}" class="button">+ Tambah Data Siswa</a>
|
|
</div>
|
|
</body>
|
|
</html>
|