メニューと貸出申請
This commit is contained in:
@@ -1,15 +1,24 @@
|
|||||||
//package com.example.demo.controller;
|
package com.example.demo.controller;
|
||||||
//
|
|
||||||
//import org.springframework.stereotype.Controller;
|
import jakarta.servlet.http.HttpSession;
|
||||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
//import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.stereotype.Controller;
|
||||||
//
|
import org.springframework.ui.Model;
|
||||||
//
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
//@Controller
|
|
||||||
//public class MenuController {
|
|
||||||
//
|
@Controller
|
||||||
|
public class MenuController {
|
||||||
|
|
||||||
// @RequestMapping(value = "/menu", method = RequestMethod.GET)
|
// @RequestMapping(value = "/menu", method = RequestMethod.GET)
|
||||||
// public String showmenu() {
|
// public String showmenu() {
|
||||||
// return "menu";
|
// return "menu";
|
||||||
// }
|
// }
|
||||||
//}
|
|
||||||
|
@GetMapping("/menu")
|
||||||
|
public String menu(HttpSession session, Model model) {
|
||||||
|
Character FlgAdmin = (Character) session.getAttribute("FlgAdmin");
|
||||||
|
model.addAttribute("FlgAdmin", FlgAdmin);
|
||||||
|
return "menu";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,161 +2,68 @@
|
|||||||
<html xmlns:th="http://www.thymeleaf.org">
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||||
<!-- 外部のスクリプトファイルを読み込む -->
|
<!-- 外部のスクリプトファイルを読み込む -->
|
||||||
<script th:src="@{/js/common.js}"></script>
|
<script th:src="@{/js/common.js}"></script>
|
||||||
<!-- CSSの読み込み -->
|
<!-- CSSの読み込み -->
|
||||||
<link rel="stylesheet" th:href="@{/css/all.css}">
|
<link rel="stylesheet" th:href="@{/css/all.css}">
|
||||||
<link rel=stylesheet th:href="@{/css/style.css}" type="text/css">
|
<link rel=stylesheet th:href="@{/css/style.css}" type="text/css">
|
||||||
<title>検索</title>
|
<title>検索</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>
|
<div class="rightSection">
|
||||||
<div class="rightSection">
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
</div>
|
||||||
</div>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<form action="selectEmployeeInfo"
|
<div class="header-spacing"></div>
|
||||||
method="post"
|
<a href="showMenu">メニューに戻る</a>
|
||||||
th:object="${searchConditionEmployeeForm}">
|
|
||||||
|
|
||||||
<div class="msgBox error" th:if="${messageError} != null">
|
<div class="header-spacing"></div>
|
||||||
<span class="error" th:text="${messageError.message}"></span>
|
<h1><span>検索結果</span></h1>
|
||||||
</div>
|
|
||||||
<trtable>
|
|
||||||
<tr>
|
|
||||||
<th class="header">申請ID</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="申請ID"
|
|
||||||
th:field="*{idRequest}"
|
|
||||||
type="number"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="header">申請者名</th>
|
|
||||||
<td>
|
|
||||||
<select th:field="*{nmApplication}">
|
|
||||||
<option value=""></option>
|
|
||||||
<option th:each="department : ${departmentFormList}"
|
|
||||||
th:selected="${searchConditionEmployeeForm.idDepartment != null && department.idDepartment == searchConditionEmployeeForm.idDepartment}"
|
|
||||||
th:text="${department.nmDepartment}"
|
|
||||||
th:value="${department.idDepartment}">
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<input placeholder="申請者名"
|
|
||||||
th:field="*{nmApplicant}"
|
|
||||||
type="text"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="header">書籍名</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="書籍名"
|
|
||||||
th:field="*{nmBook}"
|
|
||||||
type="text"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="header">申請日</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="申請日"
|
|
||||||
th:field="*{dateRequest}"
|
|
||||||
type="date"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<th class="header">貸出日</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="貸出日"
|
|
||||||
th:field="*{dateBorrow}"
|
|
||||||
type="date"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th class="header">返却予定日</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="返却予定日"
|
|
||||||
th:field="*{dateScheduledReturn}"
|
|
||||||
type="date"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<div class="header-spacing"></div>
|
||||||
<th class="header">操作</th>
|
<th:block th:if="${employeeInfoFormList != null and employeeInfoFormList.size() > 0}">
|
||||||
<td>
|
<!-- 検索結果が1件以上ある場合 -->
|
||||||
<button class="approvalButton" onclick="approvalSubmit()">承認</button>
|
<table class="table-grid table-striped table-hover">
|
||||||
</td>
|
<thead>
|
||||||
</tr>
|
<tr>
|
||||||
</table>
|
<th style="width: 100px;">申請ID</th>
|
||||||
</form>
|
<th style="width: 100px;">申請者名</th>
|
||||||
|
<th style="width: 100px;">書籍名</th>
|
||||||
|
<th style="width: 100px;">申請日</th>
|
||||||
|
<th style="width: 100px;">貸出日</th>
|
||||||
|
<th style="width: 100px;">返却予定日</th>
|
||||||
|
<th style="width: 100px;">操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="employeeInfoForm : ${employeeInfoFormList}">
|
||||||
|
<td th:text="${employeeInfoForm.idRequest}"></td>
|
||||||
|
<td th:text="${employeeInfoForm.nmApplicant}"></td>
|
||||||
|
<td th:text="${employeeInfoForm.nmBook}"></td>
|
||||||
|
<td th:text="${employeeInfoForm.dateRequest}"></td>
|
||||||
|
<td th:text="${employeeInfoForm.dateBorrow}"></td>
|
||||||
|
<td th:text="${employeeInfoForm.dateReturn}"></td>
|
||||||
|
<td th:text="${employeeInfoForm.dateRequest}"></td>
|
||||||
|
|
||||||
<div class="header-spacing"></div>
|
|
||||||
<a href="showMenu">メニューに戻る</a>
|
|
||||||
|
|
||||||
<div class="header-spacing"></div>
|
<td>
|
||||||
<h1><span>検索結果</span></h1>
|
<form action="/approve" method="get">
|
||||||
|
<input name="idRequest" th:value="${employeeInfoForm.idRequest}" type="hidden">
|
||||||
|
<input type="submit" value="承認">
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</th:block>
|
||||||
|
|
||||||
<div class="header-spacing"></div>
|
<th:block th:if="${employeeInfoFormList == null or employeeInfoFormList.size() == 0}">
|
||||||
<th:block th:if="${messageInfo != null}">
|
<!-- 検索結果が0件の場合 -->
|
||||||
<script th:inline="javascript">
|
現在書籍貸出の申請はありません。
|
||||||
alert([[${messageInfo.message}]]);
|
</th:block>
|
||||||
</script>
|
|
||||||
</th:block>
|
|
||||||
|
|
||||||
<div class="header-spacing"></div>
|
|
||||||
<th:block th:if="${employeeInfoFormList != null and employeeInfoFormList.size() > 0}">
|
|
||||||
<!-- 検索結果が1件以上ある場合 -->
|
|
||||||
<table class="table-grid table-striped table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th style="width: 60px;">申請ID</th>
|
|
||||||
<th style="width: 100px;">申請者名</th>
|
|
||||||
<th style="width: 150px;">書籍名</th>
|
|
||||||
<th style="width: 150px;">申請日</th>
|
|
||||||
<th style="width: 100px;">貸出日</th>
|
|
||||||
<th style="width: 70px;">返却予定日</th>
|
|
||||||
<th style="width: 150px;">操作</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr th:each="employeeInfoForm : ${employeeInfoFormList}">
|
|
||||||
<td th:text="${employeeInfoForm.idEmployee}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.nmEmployee}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.knEmployee}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.mailAddress}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.password}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.adminAuth}"></td>
|
|
||||||
<td th:text="${employeeInfoForm.nmDepartment}"></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</th:block>
|
|
||||||
|
|
||||||
<th:block th:if="${employeeInfoFormList == null or employeeInfoFormList.size() == 0}">
|
|
||||||
<!-- 検索結果が0件の場合 -->
|
|
||||||
現在書籍貸出の申請はありません。
|
|
||||||
</th:block>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
function clearInput() {
|
|
||||||
document.getElementById('idRequest').value = '';
|
|
||||||
document.getElementById('idApplicant').value = '';
|
|
||||||
document.getElementById('nmBook').value = '';
|
|
||||||
document.getElementById('dateRequest').value = '';
|
|
||||||
document.getElementById('dateBorrow').value = '';
|
|
||||||
document.getElementById('dateReturn').value = '';
|
|
||||||
document.getElementById('dateRequest').selectedIndex = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</html>
|
</html>
|
||||||
@@ -9,37 +9,38 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>
|
<h1>
|
||||||
<div class="rightSection">
|
<div class="rightSection">
|
||||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
<button class="logoutButton" th:onclick="logoutSubmit()">ログアウト</button>
|
||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<!-- 管理者フラグのチェック処理-->
|
|
||||||
|
|
||||||
|
<!-- 管理者フラグのチェック処理-->
|
||||||
<!-- 一般ユーザー向けのメニュー-->
|
|
||||||
|
|
||||||
|
<!-- 一般ユーザー向けのメニュー-->
|
||||||
<table class="menuClass">
|
<table class="menuClass">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a class="menuClass" href="javascript:bookListSubmit()"><i class="fas fa-search"></i>書籍検索</a>
|
<a class="menuClass" th:href="@{/bookList}"><i class="fas fa-search"></i>書籍検索</a>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a class="menuClass" href="javascript:appricationListSubmit()"><i class="fas fa-search"></i>書籍貸出申請一覧</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- 管理者向けのメニュー-->
|
|
||||||
<table class="menuClass">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a class="menuClass" href="javascript:leandingListSubmit()"><i class="fas fa-search"></i>貸出中書籍一覧</a>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<!-- 管理者向けのメニュー-->
|
||||||
|
<div th:if="${FlgAdmin == '1'}">
|
||||||
|
<table class="menuClass">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a class="menuClass" href="@{/application}"><i
|
||||||
|
class="fas fa-search"></i>書籍貸出申請一覧</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a class="menuClass" href="@{/lendingList}"><i class="fas fa-search"></i>貸出中書籍一覧</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user