152 lines
4.4 KiB
PHP
152 lines
4.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="id">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Data Karyawan</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
font-family: 'Poppins', sans-serif;
|
|
}
|
|
body {
|
|
background: linear-gradient(135deg, #b64fdb, #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 {
|
|
display: inline-block;
|
|
padding: 14px 30px;
|
|
margin-top: 20px;
|
|
color: #ffffff;
|
|
background: #bd7dd4;
|
|
text-decoration: none;
|
|
border-radius: 50px;
|
|
font-weight: 600;
|
|
transition: background 0.3s ease;
|
|
}
|
|
.button:hover {
|
|
background: #ACB6E5;
|
|
}
|
|
.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: #bd7dd4;
|
|
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: #e1e6fc;
|
|
}
|
|
p {
|
|
text-align: center;
|
|
margin-top: 20px;
|
|
font-size: 18px;
|
|
color: #555;
|
|
}
|
|
|
|
.button-opsi {
|
|
display: inline-block;
|
|
padding: 10px 15px;
|
|
margin-top: 2px;
|
|
color: #ffffff;
|
|
background: #b64fdb;
|
|
text-decoration: none;
|
|
border: none;
|
|
border-radius: 15px;
|
|
font-size: 14px;
|
|
font family: 'Poppins', sans-serif;
|
|
font-weight: 300;
|
|
transition: background 0.3s ease;
|
|
margin-right: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Data Karyawan</h1>
|
|
|
|
@if(session('success'))
|
|
<div class="alert">{{ session('success') }}</div>
|
|
@endif
|
|
|
|
@if(count($karyawan) > 0)
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Nama</th>
|
|
<th>Umur</th>
|
|
<th>Jabatan</th>
|
|
<th>Detail</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($karyawan as $row)
|
|
<tr>
|
|
<td>{{ $row->id }}</td>
|
|
<td>{{ $row->nama }}</td>
|
|
<td>{{ $row->umur }}</td>
|
|
<td>{{ $row->jabatan }}</td>
|
|
<td>
|
|
<a href="{{ route('karyawan.edit', $row->id) }}" class="button-opsi">Edit</a>
|
|
<!-- <a href="{{ route('karyawan.show', $row->id) }}" class="button-opsi">Lihat</a> -->
|
|
<form action="{{ route('karyawan.destroy', $row->id) }}" method="POST">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button class="button-opsi" display: inline;>Hapus</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@else
|
|
<p>Belum ada data karyawan yang terdaftar.</p>
|
|
@endif
|
|
|
|
<a href="{{ route('karyawan.create') }}" class="button">+ Tambah Data Karyawan</a>
|
|
</div>
|
|
</body>
|
|
</html>
|