<%--
Created by IntelliJ IDEA.
User: Lenovo
Date: 2021/12/6
Time: 16:32
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Title</title>
<style>
table trth, td {
text-align: center;
}
button {
border: none;
width: 80px;
height: 27px;
border-radius: 5px;
background-color: #888888;
box-sizing: content-box;
}
input {
width: 180px;
height: 25px;
opacity: 0.5;
border-radius: 5px;
margin-right: 5px;
}
</style>
</head>
<body>
<h3>员工信息</h3>
<hr>
<table border="1px" width="600px" cellpadding="8px" cellspacing="0" align="center" bgcolor="#c0c0c0">
<tr>
<th colspan="6" style="text-align: center"><input type="text" placeholder="请输入eid进行查找"></th>
<th><button>查找</button></th>
</tr>
<form action="add" method="post">
<tr>
<th><input type="text" placeholder="eid" name="eid"></th>
<th><input type="text" placeholder="name" name="name"></th>
<th><input type="date" placeholder="birthday" name="birthday"></th>
<th><input type="text" placeholder="phone" name="phone"></th>
<th><input type="text" placeholder="salary" name="salary"></th>
<th><input type="text" placeholder="did" name="did"></th>
<th>
<button>添加</button>
</th>
</tr>
</form>
<tr>
<th>eid</th>
<th>name</th>
<th>birthday</th>
<th>phone</th>
<th>salary</th>
<th>did</th>
<th>修改</th>
</tr>
<c:forEach items="${emps}" var="emp">
<tr>
<td>${emp.eid}</td>
<td>${emp.name}</td>
<td>${emp.birthday}</td>
<td>${emp.phone}</td>
<td>${emp.salary}</td>
<td>${emp.did}</td>
<td style="text-align: center">
<button onclick="remove(${emp.eid})">删除</button>
|
<button onclick="eidemp(${emp.eid})">修改</button>
</td>
</tr>
<c:choose>
<c:when test="${emp.eid==index}">
<tr>
<form action="eidemp">
<th><input type="text" placeholder="${emp.eid}" name="eid" value="${index}" readonly></th>
<th><input type="text" placeholder="name" name="name" value="${emp.name}"></th>
<th><input type="date" placeholder="birthday" name="birthday
JSP+servlet对数据库数据增删改查
最新推荐文章于 2024-05-27 12:05:55 发布