161 lines
4.2 KiB
PHP
161 lines
4.2 KiB
PHP
@extends('layouts.admin')
|
|
|
|
@section('title', 'Data Siswa')
|
|
@section('content')
|
|
|
|
<style>
|
|
body {
|
|
background: #e5f1ff;
|
|
font-family: 'Poppins', sans-serif;
|
|
}
|
|
|
|
.card {
|
|
border-radius: 20px;
|
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
|
|
background-color: white;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.card-header.bg-primary {
|
|
background: linear-gradient(to right, #3b82f6, #60a5fa);
|
|
border-bottom: none;
|
|
padding: 1rem 1.5rem;
|
|
}
|
|
|
|
.card-title {
|
|
color: white;
|
|
font-size: 20px;
|
|
font-weight: 600;
|
|
margin: 0;
|
|
}
|
|
|
|
.table th,
|
|
.table td {
|
|
vertical-align: middle !important;
|
|
font-size: 15px;
|
|
font-family: 'Poppins', sans-serif;
|
|
border: 1px solid #d1d5db;
|
|
}
|
|
|
|
.table thead th {
|
|
background-color: #93c5fd;
|
|
color: #1e3a8a;
|
|
}
|
|
|
|
.btn {
|
|
border-radius: 10px;
|
|
padding: 6px 15px;
|
|
font-weight: 500;
|
|
font-family: 'Poppins', sans-serif;
|
|
transition: 0.3s ease;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: #3b82f6;
|
|
border-color: #3b82f6;
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #2563eb;
|
|
}
|
|
|
|
.btn-info {
|
|
background: #60a5fa;
|
|
border-color: #3b82f6;
|
|
color: white;
|
|
}
|
|
|
|
.btn-info:hover {
|
|
background: #3b82f6;
|
|
}
|
|
|
|
.btn-danger {
|
|
background: #ef4444;
|
|
border-color: #dc2626;
|
|
color: white;
|
|
}
|
|
|
|
.btn-danger:hover {
|
|
background: #dc2626;
|
|
}
|
|
|
|
.alert {
|
|
font-size: 15px;
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.text-muted {
|
|
color: #6b7280 !important;
|
|
}
|
|
|
|
.table-responsive {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.text-right {
|
|
margin-top: 20px;
|
|
}
|
|
</style>
|
|
|
|
<div class="card">
|
|
<div class="card-header bg-primary">
|
|
<h3 class="card-title">📋 Data Siswa</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
@if(session('success'))
|
|
<div class="alert alert-success">{{ session('success') }}</div>
|
|
@endif
|
|
@if(session('error'))
|
|
<div class="alert alert-danger">{{ session('error') }}</div>
|
|
@endif
|
|
|
|
@if(count($siswas) > 0)
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered text-center">
|
|
<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 $siswa)
|
|
<tr>
|
|
<td>{{ $loop->iteration }}</td>
|
|
<td>{{ $siswa->nama }}</td>
|
|
<td>{{ $siswa->kelas->nama ?? '-' }}</td>
|
|
<td>{{ $siswa->umur }}</td>
|
|
<td>{{ $siswa->absen }}</td>
|
|
<td>
|
|
<a href="{{ route('siswa.edit', $siswa->id) }}" class="btn btn-info btn-sm">Edit</a>
|
|
<form action="{{ route('siswa.destroy', $siswa->id) }}" method="POST" class="d-inline">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Yakin mau hapus?')">Hapus</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@else
|
|
<div class="text-center text-muted my-4">
|
|
<p>Belum ada data siswa, silahkan tambahkan data.</p>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="text-right">
|
|
<a href="{{ route('siswa.create') }}" class="btn btn-primary">+ Tambah Data Siswa</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
@endsection
|