Merge branch 'master' of http://awin-x.top:63000/awinx/java_web
This commit is contained in:
parent
4bed587136
commit
19d5f9fa5b
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
|
|
||||||
version="6.0">
|
|
||||||
</web-app>
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
<%@ page import="login.UserDB" %><%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/17
|
|
||||||
Time: 下午9:26
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>JDBC应用</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<% UserDB dbBean = new UserDB();
|
|
||||||
dbBean.ShowCommonUsers();
|
|
||||||
%>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,41 +0,0 @@
|
|||||||
#--------------------------------------------------------------------------------------------------
|
|
||||||
#DriverClassName=com.mysql.cj.jdbc.Driver
|
|
||||||
#url=jdbc:mysql://10.19.38.253:3306/chat?useUnicode=true&characterEncoding=utf-8&useSSL=true
|
|
||||||
#username=admin
|
|
||||||
#password=1227496003131313xY
|
|
||||||
#--------------------------------------------------------------------------------------------------
|
|
||||||
driverClassName=org.sqlite.JDBC
|
|
||||||
url=jdbc:sqlite:F:\\Work_Area\\desk\\database\\ѧϰ\\java²âÊÔÊý¾Ý¿â\\db_student.db
|
|
||||||
#--------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
defaultAutoCommit=true
|
|
||||||
|
|
||||||
defaultReadOnly=false
|
|
||||||
|
|
||||||
initialSize=10
|
|
||||||
|
|
||||||
maxActive=20
|
|
||||||
|
|
||||||
maxIdle=20
|
|
||||||
|
|
||||||
minIdle=5
|
|
||||||
|
|
||||||
maxWait=10000
|
|
||||||
|
|
||||||
testOnBorrow=true
|
|
||||||
|
|
||||||
testOnReturn=false
|
|
||||||
|
|
||||||
validationQuery=select 1
|
|
||||||
|
|
||||||
validationQueryTimeout=1
|
|
||||||
|
|
||||||
testWhileIdle=false
|
|
||||||
|
|
||||||
timeBetweenEvictionRunsMillis=1
|
|
||||||
|
|
||||||
numTestsPerEvictionRun=3
|
|
||||||
|
|
||||||
poolPreparedStatements=true
|
|
||||||
|
|
||||||
maxOpenPreparedStatements=3
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
|
|
||||||
version="6.0">
|
|
||||||
</web-app>
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/21
|
|
||||||
Time: 下午5:00
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-cn">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>课程信息列表</title>
|
|
||||||
<link rel="stylesheet" href="../css/course.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<table id="course-list">
|
|
||||||
</table>
|
|
||||||
<div class="course-editor"></div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
<script>
|
|
||||||
let path = "${pageContext.request.contextPath}";
|
|
||||||
</script>
|
|
||||||
<script src="${pageContext.request.contextPath}/js/jquery-3.7.1.min.js"></script>
|
|
||||||
<script src="${pageContext.request.contextPath}/js/course-edit.js"></script>
|
|
||||||
</html>
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<div class="container">
|
|
||||||
<form class="course-edit">
|
|
||||||
<input type="hidden" name="id" id="id-input" value="-1">
|
|
||||||
<table class="input-form">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td class="td_header" colspan="3">课程信息录入,<span class="star">*</span>代表必填</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tr>
|
|
||||||
<td><label for="name-input">名称</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="name" type="text" id="name-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>5~20位字符
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="type-input">性质</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="type" id="type-input">
|
|
||||||
<option value="1">公共基础必修课</option>
|
|
||||||
<option value="2">公共选修课</option>
|
|
||||||
<option value="3">学科基础课</option>
|
|
||||||
<option value="4">专业必修课</option>
|
|
||||||
<option value="5">专业选修课</option>
|
|
||||||
<option value="6">集中性实践教学环节</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="credit-input">学分</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="credit" type="number" id="credit-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>数值
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="grade-input">年份</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="grade" type="text" id="grade-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>4位数年份
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>开设专业</td>
|
|
||||||
<td>
|
|
||||||
<input name="major" value="1" type="radio" id="major-input-1">
|
|
||||||
<label for="major-input-1">软件工程</label>
|
|
||||||
<input name="major" value="2" type="radio" id="major-input-2">
|
|
||||||
<label for="major-input-2">空间信息</label>
|
|
||||||
<input name="major" value="3" type="radio" id="major-input-3">
|
|
||||||
<label for="major-input-3">大数据</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="detail-input">备注</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea rows="5" name="detail" id="detail-input"></textarea>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
200个字符以内
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="3">
|
|
||||||
<input type="submit">
|
|
||||||
<button onclick="closeEdit()">关闭编辑</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
<form action="" method="post" class="course-edit">
|
|
||||||
<table class="input-form ">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td class="td_header" colspan="3">课程信息录入,<span class="star">*</span></td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tr>
|
|
||||||
<td><label for="name-input">名称</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="name" type="text" id="name-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>5~20位字符
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="type-input">性质</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="type" id="type-input">
|
|
||||||
<option value="1">公共基础必修课</option>
|
|
||||||
<option value="2">公共选修课</option>
|
|
||||||
<option value="3">学科基础课</option>
|
|
||||||
<option value="4">专业必修课</option>
|
|
||||||
<option value="5">专业选修课</option>
|
|
||||||
<option value="6">集中性实践教学环节</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="score-input">学分</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="credit" type="number" id="score-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>数值
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="year-input">年份</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="grade" type="text" id="year-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>4位数年份
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>开设专业</td>
|
|
||||||
<td>
|
|
||||||
<input name="major" value="1" type="radio" id="major-input-1">
|
|
||||||
<label for="major-input-1">软件工程</label>
|
|
||||||
<input name="major" value="2" type="radio" id="major-input-2">
|
|
||||||
<label for="major-input-2">空间信息</label>
|
|
||||||
<input name="major" value="3" type="radio" id="major-input-3">
|
|
||||||
<label for="major-input-3">大数据</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="note-input">备注</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea rows="5" name="detail" id="note-input"></textarea>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
200个字符以内
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="3">
|
|
||||||
<input type="submit">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
|
|
||||||
tr:nth-child(odd){
|
|
||||||
background:#F4F4F4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tr-head{
|
|
||||||
background-color: #2bf;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
table{
|
|
||||||
width:100%;
|
|
||||||
border-spacing: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td1 {
|
|
||||||
BACKGROUND-COLOR: #e6e6e6
|
|
||||||
}
|
|
||||||
.td_header {
|
|
||||||
BACKGROUND-COLOR: #e6e6e6; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td_1 {
|
|
||||||
BACKGROUND-COLOR: #f8fbfb; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td_2 {
|
|
||||||
BACKGROUND-COLOR: #deecec; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td3 {
|
|
||||||
BACKGROUND-COLOR: #a3d1d2; COLOR: black
|
|
||||||
}
|
|
||||||
.underline {
|
|
||||||
BORDER-BOTTOM: #c4c4c4 1pt solid; BORDER-LEFT: #c4c4c4; BORDER-RIGHT: #c4c4c4; BORDER-TOP: #c4c4c4
|
|
||||||
}
|
|
||||||
.button {
|
|
||||||
border:1px solid black;
|
|
||||||
background-color:white;
|
|
||||||
cursor:hand;
|
|
||||||
}
|
|
||||||
.star {
|
|
||||||
COLOR: red
|
|
||||||
}
|
|
||||||
.tb_showall
|
|
||||||
{
|
|
||||||
background:#0078B7;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.container{
|
|
||||||
margin: auto;
|
|
||||||
width: 80%;
|
|
||||||
text-align: center;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.input-form{
|
|
||||||
border: black solid 1px;
|
|
||||||
margin: auto;
|
|
||||||
td{
|
|
||||||
border: black solid 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
.nav-list{
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
background-color: #2bf;
|
|
||||||
height: 95%;
|
|
||||||
width: 20%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
.content{
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
background-color: #eee;
|
|
||||||
height: 95%;
|
|
||||||
width: 80%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/12/3
|
|
||||||
Time: 上午12:17
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>主页</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<h1>学生信息管理系统</h1>
|
|
||||||
<%
|
|
||||||
if(session.getAttribute("user")==null){
|
|
||||||
out.println("<a href=\""+request.getContextPath()+"/login/login.jsp\">登录</a>");
|
|
||||||
}else{
|
|
||||||
out.println("<a href=\""+request.getContextPath()+"/UserLogoutAction\">注销</a>");
|
|
||||||
}
|
|
||||||
%>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/28
|
|
||||||
Time: 下午1:20
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>学生信息管理系统</title>
|
|
||||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/index.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="nav-list">
|
|
||||||
<ul>
|
|
||||||
<li><a href="${pageContext.request.contextPath}/course/course.jsp" target="content">课程列表</a></li>
|
|
||||||
<li><a href="${pageContext.request.contextPath}/home.jsp" target="content">欢迎页</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<iframe src="${pageContext.request.contextPath}/home.jsp" class="content" name="content" height="100%" width="100%"></iframe>
|
|
||||||
</body>
|
|
||||||
<script src="${pageContext.request.contextPath}/js/index.js"></script>
|
|
||||||
</html>
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
const types = ['', '公共基础必修课', '公共选修课', '学科基础课', '专业必修课', '专业选修课', '集中性实践教学环节']
|
|
||||||
const majors = ['', '软件工程', '空间信息', '大数据'];
|
|
||||||
let courses;
|
|
||||||
function getCourses(){
|
|
||||||
$.ajax({
|
|
||||||
url: path+"/CourseListAction",
|
|
||||||
method: "GET",
|
|
||||||
success: (data, status, xhr)=>{
|
|
||||||
const course_list = document.getElementById('course-list');
|
|
||||||
console.log(xhr.status);
|
|
||||||
course_list.innerHTML = "<tr class=\"tr-head\"><td class=\"tr-head\" colspan=\"6\">课程信息列表</td></tr> <tr> <td>名称</td> <td>性质</td> <td>学分</td> <td>开设年级</td> <td>开设专业</td> </tr>"
|
|
||||||
courses = data;
|
|
||||||
for (let i in data){
|
|
||||||
const course_tr = document.createElement('tr');
|
|
||||||
course_tr.innerHTML="<td>"+ data[i].name +"</td>" +
|
|
||||||
"<td>"+types[data[i].type]+"</td>" +
|
|
||||||
"<td>"+ data[i].credit +"</td>" +
|
|
||||||
"<td>"+ data[i].grade + "</td>" +
|
|
||||||
"<td>"+ majors[data[i].major]+"</td>" +
|
|
||||||
"<td><a href=\"#\" onclick=\"editCourse("+ i + ")\" " +
|
|
||||||
">编辑</a> <a href=\""+path+"/CourseDeleteAction?id=" +
|
|
||||||
data[i].id+"\">删除</a></td>";
|
|
||||||
course_list.appendChild(course_tr);
|
|
||||||
}
|
|
||||||
const end_tr = document.createElement('tr');
|
|
||||||
end_tr.innerHTML="<td><a href=\"#\" onclick=\"addCourse()\">添加</a></td><td></td><td></td><td></td><td>" +
|
|
||||||
"<a href=\"#\" onclick=\"getCourses()\">刷新数据列表</a></td><td></td>";
|
|
||||||
course_list.appendChild(end_tr);
|
|
||||||
},
|
|
||||||
error: ()=>{
|
|
||||||
window.location=path+"/login/login.jsp";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$(document).ready(getCourses);
|
|
||||||
|
|
||||||
function editCourse(i){
|
|
||||||
$(".course-editor").load(path+"/course/course_edit.jsp", (response,status,xhr)=>{
|
|
||||||
if (stauts === 403){
|
|
||||||
window.location = path+"/login/login.jsp";
|
|
||||||
}
|
|
||||||
const form = document.querySelector('.course-edit');
|
|
||||||
form.action = path+"/CourseEditAction";
|
|
||||||
form.method = "POST";
|
|
||||||
const idInput = document.getElementById('id-input');
|
|
||||||
idInput.value = courses[i].id;
|
|
||||||
const nameInput = document.getElementById('name-input');
|
|
||||||
nameInput.value = courses[i].name;
|
|
||||||
const typeInput = document.getElementById('type-input');
|
|
||||||
typeInput.value = courses[i].type;
|
|
||||||
const creditInput = document.getElementById('credit-input');
|
|
||||||
creditInput.value = courses[i].credit;
|
|
||||||
const yearInput = document.getElementById('grade-input');
|
|
||||||
yearInput.value = courses[i].grade;
|
|
||||||
const majorInputs = form.querySelectorAll('input[name="major"]');
|
|
||||||
majorInputs.forEach((input) => {
|
|
||||||
if (parseInt(input.value) === courses[i].major) {
|
|
||||||
input.checked = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const noteInput = form.querySelector('#detail-input');
|
|
||||||
noteInput.value = courses[i].detail;
|
|
||||||
|
|
||||||
form.addEventListener('submit', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const gradeInput = document.getElementById('grade-input');
|
|
||||||
if (!/^20\d{2}$/.test(gradeInput.value)) {
|
|
||||||
alert('请输入合法的四位年份');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nameInput = document.getElementById('name-input');
|
|
||||||
console.log(nameInput.value.length)
|
|
||||||
console.log(nameInput.value)
|
|
||||||
if (nameInput.value.length < 5 || nameInput.value.length > 20){
|
|
||||||
alert('请输入5~20位字符');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const detailInput = document.getElementById('detail-input');
|
|
||||||
if (detailInput.value.length > 200){
|
|
||||||
alert('备注超长');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$(".course-edit").submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function addCourse(){
|
|
||||||
$(".course-editor").load(path+"/course/course_edit.jsp", ()=>{
|
|
||||||
const form = document.querySelector('.course-edit');
|
|
||||||
form.action = path+"/CourseAddAction";
|
|
||||||
form.addEventListener('submit', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const gradeInput = document.getElementById('grade-input');
|
|
||||||
if (!/^20\d{2}$/.test(gradeInput.value)) {
|
|
||||||
alert('请输入合法的四位年份');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nameInput = document.getElementById('name-input');
|
|
||||||
console.log(nameInput.value.length)
|
|
||||||
console.log(nameInput.value)
|
|
||||||
if (nameInput.value.length < 5 || nameInput.value.length > 20){
|
|
||||||
alert('请输入5~20位字符');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const detailInput = document.getElementById('detail-input');
|
|
||||||
if (detailInput.value.length > 200){
|
|
||||||
alert('备注超长');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$(".course-edit").submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeEdit(){
|
|
||||||
const editor = document.querySelector('.course-editor');
|
|
||||||
editor.innerHTML = "";
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,39 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/12/1
|
|
||||||
Time: 下午11:58
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>登录</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="login-card">
|
|
||||||
<h1>登录</h1>
|
|
||||||
<form action="${pageContext.request.contextPath}/UserLoginAction" method="POST">
|
|
||||||
<label for="username-input">用户名</label>
|
|
||||||
<input type="text" name="username" id="username-input">
|
|
||||||
<label for="password-input">密码</label>
|
|
||||||
<input type="password" name="password" id="password-input">
|
|
||||||
<input type="submit" value="登录">
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
<script>
|
|
||||||
<%
|
|
||||||
String loginFlag=request.getParameter("loginflag");
|
|
||||||
String username=request.getParameter("username");
|
|
||||||
if(loginFlag==null){ //无登录失败标识,是正常访问登录页面
|
|
||||||
loginFlag="";
|
|
||||||
}
|
|
||||||
if(loginFlag.equals("1")){
|
|
||||||
out.println("alert('用户【"+username+"】不存在!')");
|
|
||||||
}else if(loginFlag.equals("2")){
|
|
||||||
out.println("alert('密码错误!')");
|
|
||||||
}
|
|
||||||
%>
|
|
||||||
</script>
|
|
||||||
</html>
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
|
|
||||||
version="6.0">
|
|
||||||
</web-app>
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zn-ch">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>课程信息录入</title>
|
|
||||||
<link rel="stylesheet" href="../css/course.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<form action="" method="post" class="course">
|
|
||||||
<table class="input-form ">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td class="td_header" colspan="3">课程信息录入,<span class="star">*</span></td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tr>
|
|
||||||
<td><label for="name-input">名称</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="cname" type="text" id="name-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>5~20位字符
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="type-input">性质</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="ctype" id="type-input">
|
|
||||||
<option value="专业必修课">专业必修课</option>
|
|
||||||
<option value="专业选修课">专业选修课</option>
|
|
||||||
<option value="通识必修课">通识必修课</option>
|
|
||||||
<option value="通识选修课">通识选修课</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="score-input">学分</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="cscore" type="number" id="score-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>数值
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="year-input">年份</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="cyear" type="text" id="year-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>4位数年份
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>开设专业</td>
|
|
||||||
<td>
|
|
||||||
<input name="cmajor" value="软件工程" type="radio" id="major-input-1">
|
|
||||||
<label for="major-input-1">软件工程</label>
|
|
||||||
<input name="cmajor" value="空间信息" type="radio" id="major-input-2">
|
|
||||||
<label for="major-input-2">空间信息</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="note-input">备注</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea rows="5" name="cnote" id="note-input"></textarea>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
200个字符以内
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="3">
|
|
||||||
<input type="submit">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
<script>
|
|
||||||
const form = document.querySelector('.course');
|
|
||||||
|
|
||||||
form.addEventListener('submit', function (e) {
|
|
||||||
const cyearInput = document.getElementById('year-input');
|
|
||||||
if (!/^20\d{2}$/.test(cyearInput.value)) {
|
|
||||||
e.preventDefault();
|
|
||||||
alert('请输入合法的四位年份');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cnameInput = document.getElementById('name-input');
|
|
||||||
console.log(cnameInput.value.length)
|
|
||||||
console.log(cnameInput.value)
|
|
||||||
if (cnameInput.value.length < 5 || cnameInput.value.length > 20){
|
|
||||||
e.preventDefault();
|
|
||||||
alert('请输入5~20位字符');
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const cnoteInput = document.getElementById('note-input');
|
|
||||||
if (cnameInput.value.length > 200){
|
|
||||||
e.preventDefault();
|
|
||||||
alert('备注超长');
|
|
||||||
}
|
|
||||||
alert('正常提交');
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</html>
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-cn">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>课程信息列表</title>
|
|
||||||
<link rel="stylesheet" href="../css/course.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<table>
|
|
||||||
<tr class="tr-head"><td class="tr-head" colspan="6">课程信息列表</td></tr>
|
|
||||||
<tr >
|
|
||||||
<td>名称</td>
|
|
||||||
<td>性质</td>
|
|
||||||
<td>学分</td>
|
|
||||||
<td>开设年级</td>
|
|
||||||
<td>开设专业</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>java</td>
|
|
||||||
<td>专业课必修</td>
|
|
||||||
<td>3</td>
|
|
||||||
<td>2015</td>
|
|
||||||
<td>软件工程</td>
|
|
||||||
<td><a href="./course_edit.html">编辑</a> <a href="#">删除</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>java</td>
|
|
||||||
<td>专业课必修</td>
|
|
||||||
<td>3</td>
|
|
||||||
<td>2015</td>
|
|
||||||
<td>软件工程</td>
|
|
||||||
<td><a href="./course_edit.html">编辑</a> <a href="#">删除</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>java</td>
|
|
||||||
<td>专业课必修</td>
|
|
||||||
<td>3</td>
|
|
||||||
<td>2015</td>
|
|
||||||
<td>软件工程</td>
|
|
||||||
<td><a href="./course_edit.html">编辑</a> <a href="#">删除</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><a href="#">添加</a></td>
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
<td><a href="#">刷新数据列表</a></td>
|
|
||||||
<td> </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,115 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zn-ch">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>课程信息录入</title>
|
|
||||||
<link rel="stylesheet" href="../css/course.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<form action="" method="post" class="course">
|
|
||||||
<table class="input-form ">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td class="td_header" colspan="3">课程信息录入,<span class="star">*</span></td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tr>
|
|
||||||
<td><label for="name-input">名称</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="cname" type="text" id="name-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>5~20位字符
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="type-input">名称</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="ctype" id="type-input">
|
|
||||||
<option value="专业必修课">专业必修课</option>
|
|
||||||
<option value="专业选修课">专业选修课</option>
|
|
||||||
<option value="通识必修课">通识必修课</option>
|
|
||||||
<option value="通识选修课">通识选修课</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="score-input">学分</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="cscore" type="number" id="score-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>数值
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="year-input">年份</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="cyear" type="text" id="year-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>4位数年份
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>开设专业</td>
|
|
||||||
<td>
|
|
||||||
<input name="cmajor" value="软件工程" type="radio" id="major-input-1">
|
|
||||||
<label for="major-input-1">软件工程</label>
|
|
||||||
<input name="cmajor" value="空间信息" type="radio" id="major-input-2">
|
|
||||||
<label for="major-input-2">空间信息</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="note-input">备注</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea rows="5" name="cnote" id="note-input"></textarea>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
200个字符以内
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="3">
|
|
||||||
<input type="submit">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
<script>
|
|
||||||
const form = document.querySelector('.course');
|
|
||||||
|
|
||||||
form.addEventListener('submit', function (e) {
|
|
||||||
const cyearInput = document.getElementById('year-input');
|
|
||||||
if (!/^\d{4}$/.test(cyearInput.value)) {
|
|
||||||
e.preventDefault();
|
|
||||||
alert('请输入合法的四位年份');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cnameInput = document.getElementById('type-input');
|
|
||||||
if (!(cnameInput.value.length > 5 && cnameInput.value < 20)){
|
|
||||||
e.preventDefault();
|
|
||||||
alert('请输入5~20位字符');
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const cnoteInput = document.getElementById('note-input');
|
|
||||||
if (cnameInput.value.length > 200){
|
|
||||||
e.preventDefault();
|
|
||||||
alert('请输入5~20位字符');
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</html>
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
.container{
|
|
||||||
width: 80%;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr:nth-child(odd){
|
|
||||||
background:#F4F4F4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tr-head{
|
|
||||||
background-color: #2bf;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
table{
|
|
||||||
width:100%;
|
|
||||||
border-spacing: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td1 {
|
|
||||||
BACKGROUND-COLOR: #e6e6e6
|
|
||||||
}
|
|
||||||
.td_header {
|
|
||||||
BACKGROUND-COLOR: #e6e6e6; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td_1 {
|
|
||||||
BACKGROUND-COLOR: #f8fbfb; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td_2 {
|
|
||||||
BACKGROUND-COLOR: #deecec; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td3 {
|
|
||||||
BACKGROUND-COLOR: #a3d1d2; COLOR: black
|
|
||||||
}
|
|
||||||
.underline {
|
|
||||||
BORDER-BOTTOM: #c4c4c4 1pt solid; BORDER-LEFT: #c4c4c4; BORDER-RIGHT: #c4c4c4; BORDER-TOP: #c4c4c4
|
|
||||||
}
|
|
||||||
.button {
|
|
||||||
border:1px solid black;
|
|
||||||
background-color:white;
|
|
||||||
cursor:hand;
|
|
||||||
}
|
|
||||||
.star {
|
|
||||||
COLOR: red
|
|
||||||
}
|
|
||||||
.tb_showall
|
|
||||||
{
|
|
||||||
background:#0078B7;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.container{
|
|
||||||
margin: auto;
|
|
||||||
width: 80%;
|
|
||||||
display: flex;
|
|
||||||
text-align: center;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.input-form{
|
|
||||||
border: black solid 1px;
|
|
||||||
margin: auto;
|
|
||||||
td{
|
|
||||||
border: black solid 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/12
|
|
||||||
Time: 下午9:16
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>实验2</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<a href="course/course_list.html">打开课程列表页面</a>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
|
|
||||||
version="6.0">
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>userAction</servlet-name>
|
|
||||||
<servlet-class>login.UserAction</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>userAction</servlet-name>
|
|
||||||
<url-pattern>/userAction</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
</web-app>
|
|
||||||
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
.login-table{
|
|
||||||
border: black 1px solid;
|
|
||||||
td{
|
|
||||||
border: black 1px solid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/12
|
|
||||||
Time: 下午11:41
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<%
|
|
||||||
String path = request.getContextPath();
|
|
||||||
response.sendRedirect(path+"/login.jsp");
|
|
||||||
%>
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/18
|
|
||||||
Time: 上午10:52
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>登录页面</title>
|
|
||||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/login.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<form action="${pageContext.request.contextPath}/userAction">
|
|
||||||
<table class="login-table">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2" style="background-color: #bbb">用户登录信息录入,<span style="color: red">*</span>为必填</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="username">用户名</label></td>
|
|
||||||
<td><input type="text" name="username" id="username"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="password">密码</label></td>
|
|
||||||
<td><input type="password" name="password" id="password"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><input type="submit" value="登录" style="margin: auto"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
<script>
|
|
||||||
<%
|
|
||||||
String loginFlag=request.getParameter("loginflag");
|
|
||||||
String username=request.getParameter("username");
|
|
||||||
if(loginFlag==null){ //无登录失败标识,是正常访问登录页面
|
|
||||||
loginFlag="";
|
|
||||||
}
|
|
||||||
if(loginFlag.equals("1")){
|
|
||||||
out.println("alert('用户【"+username+"】不存在!')");
|
|
||||||
}else if(loginFlag.equals("2")){
|
|
||||||
out.println("alert('密码错误!')");
|
|
||||||
}
|
|
||||||
%>
|
|
||||||
</script>
|
|
||||||
</html>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<%@ page import="login.UserInfo" %><%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/18
|
|
||||||
Time: 上午10:52
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>用户信息</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
登录成功
|
|
||||||
<h1>欢迎<
|
|
||||||
<%
|
|
||||||
UserInfo user = (UserInfo) session.getAttribute("user");
|
|
||||||
out.print(user.getName());
|
|
||||||
%>
|
|
||||||
>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
|
|
||||||
version="6.0">
|
|
||||||
</web-app>
|
|
||||||
@ -1,145 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/21
|
|
||||||
Time: 下午5:00
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-cn">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>课程信息列表</title>
|
|
||||||
<link rel="stylesheet" href="../css/course.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<table id="course-list">
|
|
||||||
</table>
|
|
||||||
<div class="course-editor"></div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
<script src="${pageContext.request.contextPath}/js/jquery-3.7.1.min.js"></script>
|
|
||||||
<script>
|
|
||||||
// 1公共基础必修课
|
|
||||||
// 2公共选修课
|
|
||||||
// 3学科基础课
|
|
||||||
// 4专业必修课
|
|
||||||
// 5专业选修课
|
|
||||||
// 6集中性实践教学环节
|
|
||||||
const types = ['', '公共基础必修课', '公共选修课', '学科基础课', '专业必修课', '专业选修课', '集中性实践教学环节']
|
|
||||||
// 1 软件工程
|
|
||||||
// 2 空间信息
|
|
||||||
// 3 大数据
|
|
||||||
const majors = ['', '软件工程', '空间信息', '大数据'];
|
|
||||||
let courses;
|
|
||||||
function getCourses(){
|
|
||||||
$.get("${pageContext.request.contextPath}/courseListAction", (data, status)=>{
|
|
||||||
const course_list = document.getElementById('course-list');
|
|
||||||
if (status!=="success"){
|
|
||||||
alert("信息获取失败!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
course_list.innerHTML = "<tr class=\"tr-head\"><td class=\"tr-head\" colspan=\"6\">课程信息列表</td></tr> <tr> <td>名称</td> <td>性质</td> <td>学分</td> <td>开设年级</td> <td>开设专业</td> </tr>"
|
|
||||||
courses = data;
|
|
||||||
for (let i in data){
|
|
||||||
const course_tr = document.createElement('tr');
|
|
||||||
course_tr.innerHTML="<td>"+ data[i].name +"</td>" +
|
|
||||||
"<td>"+types[data[i].type]+"</td>" +
|
|
||||||
"<td>"+ data[i].credit +"</td>" +
|
|
||||||
"<td>"+ data[i].grade + "</td>" +
|
|
||||||
"<td>"+ majors[data[i].major]+"</td>" +
|
|
||||||
"<td><a href=\"#\" onclick=\"editCourse("+ i + ")\" " +
|
|
||||||
">编辑</a> <a href=\"${pageContext.request.contextPath}/courseDeleteAction?id=" +
|
|
||||||
data[i].id+"\">删除</a></td>";
|
|
||||||
course_list.appendChild(course_tr);
|
|
||||||
}
|
|
||||||
const end_tr = document.createElement('tr');
|
|
||||||
end_tr.innerHTML="<td><a href=\"#\" onclick=\"addCourse()\">添加</a></td><td></td><td></td><td></td><td>" +
|
|
||||||
"<a href=\"#\" onclick=\"getCourses()\">刷新数据列表</a></td><td></td>";
|
|
||||||
course_list.appendChild(end_tr);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$(document).ready(getCourses);
|
|
||||||
|
|
||||||
function editCourse(i){
|
|
||||||
$(".course-editor").load("${pageContext.request.contextPath}/course/course_edit.jsp", ()=>{
|
|
||||||
const form = document.querySelector('.course-edit');
|
|
||||||
form.action = "${pageContext.request.contextPath}/courseEditAction";
|
|
||||||
form.method = "POST";
|
|
||||||
const idInput = document.getElementById('id-input');
|
|
||||||
idInput.value = courses[i].id;
|
|
||||||
const nameInput = document.getElementById('name-input');
|
|
||||||
nameInput.value = courses[i].name;
|
|
||||||
const typeInput = document.getElementById('type-input');
|
|
||||||
typeInput.value = courses[i].type;
|
|
||||||
const creditInput = document.getElementById('credit-input');
|
|
||||||
creditInput.value = courses[i].credit;
|
|
||||||
const yearInput = document.getElementById('grade-input');
|
|
||||||
yearInput.value = courses[i].grade;
|
|
||||||
const majorInputs = form.querySelectorAll('input[name="major"]');
|
|
||||||
majorInputs.forEach((input) => {
|
|
||||||
if (parseInt(input.value) === courses[i].major) {
|
|
||||||
input.checked = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const noteInput = form.querySelector('#detail-input');
|
|
||||||
noteInput.value = courses[i].detail;
|
|
||||||
|
|
||||||
form.addEventListener('submit', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const gradeInput = document.getElementById('grade-input');
|
|
||||||
if (!/^20\d{2}$/.test(gradeInput.value)) {
|
|
||||||
alert('请输入合法的四位年份');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nameInput = document.getElementById('name-input');
|
|
||||||
console.log(nameInput.value.length)
|
|
||||||
console.log(nameInput.value)
|
|
||||||
if (nameInput.value.length < 5 || nameInput.value.length > 20){
|
|
||||||
alert('请输入5~20位字符');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const detailInput = document.getElementById('detail-input');
|
|
||||||
if (detailInput.value.length > 200){
|
|
||||||
alert('备注超长');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$(".course-edit").submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function addCourse(){
|
|
||||||
$(".course-editor").load("${pageContext.request.contextPath}/course/course_edit.jsp", ()=>{
|
|
||||||
const form = document.querySelector('.course-edit');
|
|
||||||
form.action = "${pageContext.request.contextPath}/courseAddAction";
|
|
||||||
form.addEventListener('submit', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const gradeInput = document.getElementById('grade-input');
|
|
||||||
if (!/^20\d{2}$/.test(gradeInput.value)) {
|
|
||||||
alert('请输入合法的四位年份');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nameInput = document.getElementById('name-input');
|
|
||||||
console.log(nameInput.value.length)
|
|
||||||
console.log(nameInput.value)
|
|
||||||
if (nameInput.value.length < 5 || nameInput.value.length > 20){
|
|
||||||
alert('请输入5~20位字符');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const detailInput = document.getElementById('detail-input');
|
|
||||||
if (detailInput.value.length > 200){
|
|
||||||
alert('备注超长');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$(".course-edit").submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</html>
|
|
||||||
@ -1,93 +0,0 @@
|
|||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<div class="container">
|
|
||||||
<form class="course-edit">
|
|
||||||
<input type="hidden" name="id" id="id-input" value="-1">
|
|
||||||
<table class="input-form">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td class="td_header" colspan="3">课程信息录入,<span class="star">*</span>代表必填</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tr>
|
|
||||||
<td><label for="name-input">名称</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="name" type="text" id="name-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>5~20位字符
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="type-input">性质</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="type" id="type-input">
|
|
||||||
<option value="1">公共基础必修课</option>
|
|
||||||
<option value="2">公共选修课</option>
|
|
||||||
<option value="3">学科基础课</option>
|
|
||||||
<option value="4">专业必修课</option>
|
|
||||||
<option value="5">专业选修课</option>
|
|
||||||
<option value="6">集中性实践教学环节</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="credit-input">学分</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="credit" type="number" id="credit-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>数值
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="grade-input">年份</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="grade" type="text" id="grade-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>4位数年份
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>开设专业</td>
|
|
||||||
<td>
|
|
||||||
<input name="major" value="1" type="radio" id="major-input-1">
|
|
||||||
<label for="major-input-1">软件工程</label>
|
|
||||||
<input name="major" value="2" type="radio" id="major-input-2">
|
|
||||||
<label for="major-input-2">空间信息</label>
|
|
||||||
<input name="major" value="3" type="radio" id="major-input-3">
|
|
||||||
<label for="major-input-3">大数据</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="detail-input">备注</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea rows="5" name="detail" id="detail-input"></textarea>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
200个字符以内
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="3">
|
|
||||||
<input type="submit">
|
|
||||||
<button onclick="closeEdit()">关闭编辑</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
function closeEdit(){
|
|
||||||
const editor = document.querySelector('.course-editor');
|
|
||||||
editor.innerHTML = "";
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
<form action="" method="post" class="course-edit">
|
|
||||||
<table class="input-form ">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td class="td_header" colspan="3">课程信息录入,<span class="star">*</span></td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tr>
|
|
||||||
<td><label for="name-input">名称</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="name" type="text" id="name-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>5~20位字符
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="type-input">性质</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="type" id="type-input">
|
|
||||||
<option value="1">公共基础必修课</option>
|
|
||||||
<option value="2">公共选修课</option>
|
|
||||||
<option value="3">学科基础课</option>
|
|
||||||
<option value="4">专业必修课</option>
|
|
||||||
<option value="5">专业选修课</option>
|
|
||||||
<option value="6">集中性实践教学环节</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="score-input">学分</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="credit" type="number" id="score-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>数值
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="year-input">年份</label></td>
|
|
||||||
<td>
|
|
||||||
<input name="grade" type="text" id="year-input">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>4位数年份
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>开设专业</td>
|
|
||||||
<td>
|
|
||||||
<input name="major" value="1" type="radio" id="major-input-1">
|
|
||||||
<label for="major-input-1">软件工程</label>
|
|
||||||
<input name="major" value="2" type="radio" id="major-input-2">
|
|
||||||
<label for="major-input-2">空间信息</label>
|
|
||||||
<input name="major" value="3" type="radio" id="major-input-3">
|
|
||||||
<label for="major-input-3">大数据</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="star">*</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="note-input">备注</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea rows="5" name="detail" id="note-input"></textarea>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
200个字符以内
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="3">
|
|
||||||
<input type="submit">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
|
|
||||||
tr:nth-child(odd){
|
|
||||||
background:#F4F4F4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tr-head{
|
|
||||||
background-color: #2bf;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
table{
|
|
||||||
width:100%;
|
|
||||||
border-spacing: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td1 {
|
|
||||||
BACKGROUND-COLOR: #e6e6e6
|
|
||||||
}
|
|
||||||
.td_header {
|
|
||||||
BACKGROUND-COLOR: #e6e6e6; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td_1 {
|
|
||||||
BACKGROUND-COLOR: #f8fbfb; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td_2 {
|
|
||||||
BACKGROUND-COLOR: #deecec; COLOR: #000000
|
|
||||||
}
|
|
||||||
.td3 {
|
|
||||||
BACKGROUND-COLOR: #a3d1d2; COLOR: black
|
|
||||||
}
|
|
||||||
.underline {
|
|
||||||
BORDER-BOTTOM: #c4c4c4 1pt solid; BORDER-LEFT: #c4c4c4; BORDER-RIGHT: #c4c4c4; BORDER-TOP: #c4c4c4
|
|
||||||
}
|
|
||||||
.button {
|
|
||||||
border:1px solid black;
|
|
||||||
background-color:white;
|
|
||||||
cursor:hand;
|
|
||||||
}
|
|
||||||
.star {
|
|
||||||
COLOR: red
|
|
||||||
}
|
|
||||||
.tb_showall
|
|
||||||
{
|
|
||||||
background:#0078B7;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.container{
|
|
||||||
margin: auto;
|
|
||||||
width: 80%;
|
|
||||||
text-align: center;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.input-form{
|
|
||||||
border: black solid 1px;
|
|
||||||
margin: auto;
|
|
||||||
td{
|
|
||||||
border: black solid 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: 25589
|
|
||||||
Date: 2024/11/21
|
|
||||||
Time: 下午4:33
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<%
|
|
||||||
String path = request.getContextPath();
|
|
||||||
response.sendRedirect(path+"/course/course.jsp");
|
|
||||||
%>
|
|
||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,41 +0,0 @@
|
|||||||
#--------------------------------------------------------------------------------------------------
|
|
||||||
#DriverClassName=com.mysql.cj.jdbc.Driver
|
|
||||||
#url=jdbc:mysql://10.19.38.253:3306/chat?useUnicode=true&characterEncoding=utf-8&useSSL=true
|
|
||||||
#username=admin
|
|
||||||
#password=1227496003131313xY
|
|
||||||
#--------------------------------------------------------------------------------------------------
|
|
||||||
driverClassName=org.sqlite.JDBC
|
|
||||||
url=jdbc:sqlite:F:\\Work_Area\\desk\\database\\ѧϰ\\java²âÊÔÊý¾Ý¿â\\db_student.db
|
|
||||||
#--------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
defaultAutoCommit=true
|
|
||||||
|
|
||||||
defaultReadOnly=false
|
|
||||||
|
|
||||||
initialSize=10
|
|
||||||
|
|
||||||
maxActive=20
|
|
||||||
|
|
||||||
maxIdle=20
|
|
||||||
|
|
||||||
minIdle=5
|
|
||||||
|
|
||||||
maxWait=10000
|
|
||||||
|
|
||||||
testOnBorrow=true
|
|
||||||
|
|
||||||
testOnReturn=false
|
|
||||||
|
|
||||||
validationQuery=select 1
|
|
||||||
|
|
||||||
validationQueryTimeout=1
|
|
||||||
|
|
||||||
testWhileIdle=false
|
|
||||||
|
|
||||||
timeBetweenEvictionRunsMillis=1
|
|
||||||
|
|
||||||
numTestsPerEvictionRun=3
|
|
||||||
|
|
||||||
poolPreparedStatements=true
|
|
||||||
|
|
||||||
maxOpenPreparedStatements=3
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user