no message
This commit is contained in:
72
public/employee_list.php
Normal file
72
public/employee_list.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>社員一覧 - 社員メンテナンスシステム</title>
|
||||
<!-- Bootstrap 5 CDN -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- ナビバー -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="index.php">社員メンテナンスシステム</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container mt-4">
|
||||
<h1 class="mb-4">社員一覧</h1>
|
||||
<!-- エラーメッセージ表示 -->
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo htmlspecialchars($errorMessage); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($_GET['error'])): ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo htmlspecialchars($_GET['error']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!-- 部分検索用のフォーム -->
|
||||
<form method="get" action="controller.php" class="mb-3">
|
||||
<input type="hidden" name="action" value="list">
|
||||
<div class="input-group">
|
||||
<input type="text" name="keyword" class="form-control" placeholder="検索キーワード" value="<?php echo isset($_GET['keyword']) ? htmlspecialchars($_GET['keyword']) : ''; ?>">
|
||||
<button class="btn btn-primary" type="submit">検索</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- 社員一覧テーブル -->
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>名前</th>
|
||||
<th>Email</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($employees as $emp): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($emp['id']); ?></td>
|
||||
<td><?php echo htmlspecialchars($emp['name']); ?></td>
|
||||
<td><?php echo htmlspecialchars($emp['email']); ?></td>
|
||||
<td>
|
||||
<a href="controller.php?action=update&id=<?php echo $emp['id']; ?>" class="btn btn-sm btn-warning">更新</a>
|
||||
<a href="controller.php?action=delete&id=<?php echo $emp['id']; ?>" class="btn btn-sm btn-danger" onclick="return confirm('本当に削除しますか?');">削除</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="controller.php?action=register" class="btn btn-success">新規登録</a>
|
||||
<a href="index.php" class="btn btn-secondary">ホームに戻る</a>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user