提交 4dc35de1 编写于 作者: C CheungChingYin

init

上级
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_172">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/mysql-connector-java-8.0.11.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>StudentManagementSystemByWeb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
<filteredResources>
<filter>
<id>1527473765482</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher>
</filter>
<filter>
<id>1527473765511</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="WebContent"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="StudentManagementSystemByWeb">
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="context-root" value="StudentManagementSystemByWeb"/>
<property name="java-output-path" value="/StudentManagementSystemByWeb/build/classes"/>
</wb-module>
</project-modules>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v8.5"/>
<fixed facet="java"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="jst.web"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.1"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<title>Insert title here</title>
<style type="text/css">
.form-control {
width: 300px;
height: 30px;
float: right;
}
select {
width: 210px;
height: 30px;
}
.submit {
margin-left: 100px;
margin-right: 30px;
}
.contain {
width: 1000px;
border: 1px #bbb solid;
background-color: #eee;
padding-top: 20px;
border-radius: 10px;
}
label {
display: inline-block;
width: 100px;
margin-right: 10px;
}
form {
margin-left: 300px;
}
</style>
</head>
<body>
<div class="contain">
<form action="DaoAddStudent.jsp" method="post">
<div class="form-group form-inline">
<label for="id">学号:</label>
<input type="text" class="form-control" id="id" name="id" required="required">
</div>
<div class="form-group form-inline">
<label for="name">姓名:</label>
<input type="text" class="form-control" id="name" name="name" required="required">
</div>
<div class="form-group form-inline">
<label for="sex">性别:</label>
<select name="sex" id="sex">
<option value="男"></option>
<option value="女"></option>
</select>
</div>
<div class="form-group form-inline">
<label for="birthday">出生日期:</label>
<input type="date" class="form-control" id="birthday" name="birthday" required="required">
</div>
<div class="form-group form-inline">
<label for="schoolday">入学时间:</label>
<input type="date" class="form-control" id="schoolday" name="schoolday" required="required">
</div>
<div class="form-group form-inline">
<label for="college">院部:</label>
<select name="college" id="college" class="college">
<option selected="selected">---请选择---</option>
</select>
</div>
<div class="form-group form-inline">
<label for="major">专业:</label>
<select name="major" id="major" class="major">
<option selected="selected">---请选择---</option>
</select>
</div>
<div class="form-group form-inline">
<input type="submit" id="" name="" class="btn btn-primary submit" /><input type="reset" class="btn btn-warning" value="重置" />
</div>
</form>
</div>
</body>
<script type="text/javascript">
var librarians = ['机电工程学院', '电子信息学院', '工商管理学院', '财经管理学院', '汽车工程学院'];
var choice = ['---请选择---'];
var electromeChanical = ['数控技术', '模具设计与制造', '机械制造与自动化', '机电设备维修与管理', '工业机器人', '电气自动化', '机械设计与制造'];
var electronicInformation = ['工业设计', '艺术设计', '光伏工程技术', '光伏发电技术与应用', '物联网应用技术', '计算机应用技术', '通讯技术', '电子信息工程技术'];
var businessCircles = ['物流管理', '电子商务', '市场营销', '国际贸易实务', '工商企业管理', '商务管理'];
var financialManagement = ['会计', '金融管理与实务', '财务管理', '酒店管理', '旅游管理'];
var automobileEngineering = ['食品营养与检测', '汽车技术服务与营销', '汽车检测与维修技术'];
var professional = new Array;
professional[0] = choice;
professional[1] = electromeChanical;
professional[2] = financialManagement;
professional[3] = businessCircles;
professional[4] = electronicInformation;
professional[5] = automobileEngineering;
function add_option(select, option) {
var target = document.getElementById(select);
for(var i = option.length - 1; i >= 0; i--) {
var add_option = document.createElement("option");
add_option.text = option[i];
target.add(add_option, null);
target.lastChild.setAttribute("value", option[i]);
}
}
add_option("college", librarians);
document.getElementById("college").addEventListener("change", function() {
var selevted_college = document.getElementById("college");
var selected_major = document.getElementById("major");
for(var i = selected_major.length - 1; i >= 0; i--) {
selected_major.remove(i);
}
var selected = selevted_college.selectedIndex;
if(selected == 0) {
add_option("major", professional[0]);
} else {
add_option("major", professional[selected]);
}
})
</script>
</html>
\ No newline at end of file
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<title>Insert title here</title>
<style type="text/css">
.form-control {
width: 300px;
height: 30px;
float: right;
}
select {
width: 210px;
height: 30px;
}
.submit {
margin-left: 100px;
margin-right: 30px;
}
.contain {
width: 1000px;
border: 1px #bbb solid;
background-color: #eee;
padding-top: 20px;
border-radius: 10px;
}
label {
display: inline-block;
width: 100px;
margin-right: 10px;
}
form {
margin-left: 300px;
}
</style>
</head>
<body>
<%!
String id;
String sourceId;
String name;
String sex;
String birthday;
String schoolday;
String college;
String major;
%>
<%
request.setCharacterEncoding("UTF-8");
id = request.getParameter("id");
String sqlid = "SELECT * FROM stumanagementbyweb.studentinfo where id='"+id+"'";
sourceId = id;
try{
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/stumanagementbyweb","root","123456");
Statement sql = con.createStatement();
ResultSet rs = sql.executeQuery(sqlid);
if(rs.next()){
name = rs.getString(2);
sex = rs.getString(3);
birthday = rs.getString(4);
schoolday = rs.getString(5);
college = rs.getString(7);
major = rs.getString(6);
}
rs.close();
sql.close();
con.close();
}catch(Exception e){
e.printStackTrace();
}
%>
<div class="contain">
<form action="DaoAlertStudent.jsp?sourceId='<%=sourceId %>'" method="post">
<div class="form-group form-inline">
<label for="id">学号:</label>
<input type="text" class="form-control" id="id" name="id" value='<%=id %>' required="required">
</div>
<div class="form-group form-inline">
<label for="name">姓名:</label>
<input type="text" class="form-control" id="name" name="name" value='<%=name %>' required="required">
</div>
<div class="form-group form-inline">
<label for="sex">性别:</label>
<select name="sex" id="sex">
<%
if(sex.equals("男")){
out.print("<option value='男'selected='selected'></option>");
out.print("<option value='女'></option>");
}else{
out.print("<option value='女'selected='selected'></option>");
out.print("<option value='男'></option>");
}
%>
</select>
</div>
<div class="form-group form-inline">
<label for="birthday">出生日期:</label>
<input type="date" class="form-control" id="birthday" name="birthday" value='<%=birthday %>' required="required">
</div>
<div class="form-group form-inline">
<label for="schoolday">入学时间:</label>
<input type="date" class="form-control" id="schoolday" name="schoolday" value='<%=schoolday %>' required="required">
</div>
<div class="form-group form-inline">
<label for="college">院部:</label>
<select name="college" id="college" class="college">
<option selected="selected" value='<%=college %>'><%=college %></option>
</select>
</div>
<div class="form-group form-inline">
<label for="major">专业:</label>
<select name="major" id="major" class="major">
<option selected="selected" value='<%=major %>'><%=major %></option>
</select>
</div>
<div class="form-group form-inline">
<input type="submit" id="" name="" class="btn btn-primary submit" value='修改' /><input type="reset" class="btn btn-warning" value="重置" />
</div>
</form>
</div>
</body>
<script type="text/javascript">
var librarians = ['机电工程学院', '电子信息学院', '工商管理学院', '财经管理学院', '汽车工程学院'];
var choice = ['---请选择---'];
var electromeChanical = ['数控技术', '模具设计与制造', '机械制造与自动化', '机电设备维修与管理', '工业机器人', '电气自动化', '机械设计与制造'];
var electronicInformation = ['工业设计', '艺术设计', '光伏工程技术', '光伏发电技术与应用', '物联网应用技术', '计算机应用技术', '通讯技术', '电子信息工程技术'];
var businessCircles = ['物流管理', '电子商务', '市场营销', '国际贸易实务', '工商企业管理', '商务管理'];
var financialManagement = ['会计', '金融管理与实务', '财务管理', '酒店管理', '旅游管理'];
var automobileEngineering = ['食品营养与检测', '汽车技术服务与营销', '汽车检测与维修技术'];
var professional = new Array;
professional[0] = choice;
professional[1] = electromeChanical;
professional[2] = financialManagement;
professional[3] = businessCircles;
professional[4] = electronicInformation;
professional[5] = automobileEngineering;
function add_option(select, option) {
var target = document.getElementById(select);
for(var i = option.length - 1; i >= 0; i--) {
var add_option = document.createElement("option");
add_option.text = option[i];
target.add(add_option, null);
target.lastChild.setAttribute("value", option[i]);
}
}
add_option("college", librarians);
document.getElementById("college").addEventListener("change", function() {
var selevted_college = document.getElementById("college");
var selected_major = document.getElementById("major");
for(var i = selected_major.length - 1; i >= 0; i--) {
selected_major.remove(i);
}
var selected = selevted_college.selectedIndex;
if(selected == 0) {
add_option("major", professional[0]);
} else {
add_option("major", professional[selected]);
}
})
</script>
</html>
\ No newline at end of file
<%@page import="java.sql.SQLException"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript">
function del() {
if(!confirm("确认要删除?")) {
window.event.returnValue = false;
}
}
</script>
<title>学生资料管理系统</title>
<style type="text/css">
body {
/*background-color: #eee;*/
}
form h1 {
display: inline-block;
width: 820px;
}
.check {
padding: 30px 30px;
}
form {
display: inline;
}
.contain {
width: 1000px;
border-radius: 10px;
border: 1px #bbb solid;
background-color: #eee;
padding-top: 20px;
}
button {
margin-left: 10px;
}
.search {
display: inline-block;
margin-left: 500px;
}
.add {
float: right;
margin-right: 50px;
}
</style>
</head>
<body>
<div class="contain pull-left">
<form action="DaoSearch.jsp" class="form-inline ">
<h2>学生名单管理</h2>
<div class="form-group search">
<input type="text" name="check" class="form-control" placeholder="请输入查询姓名或学号" />
<input type="submit" name="submit" class="btn" value="搜索" />
</div>
</form>
<a href="AddStudent.jsp" target="_self"><button class="btn btn-primary add">添加学生资料</button></a>
<div class="pull-left">
<table class="table">
<thead>
<tr>
<th>学号</th>
<th>姓名</th>
<th>性别</th>
<th>出生日期</th>
<th>入学时间</th>
<th>专业</th>
<th>学院</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<%
request.setCharacterEncoding("UTF-8");
String sqlQuery = "SELECT * FROM stumanagementbyweb.studentinfo";
try{
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/stumanagementbyweb","root","123456");
Statement sql = con.createStatement();
ResultSet rs = sql.executeQuery(sqlQuery);
while(rs.next()){
out.print("<tr>");
out.print("<td>"+rs.getString(1)+"</td>");
out.print("<td>"+rs.getString(2)+"</td>");
out.print("<td>"+rs.getString(3)+"</td>");
out.print("<td>"+rs.getString(4)+"</td>");
out.print("<td>"+rs.getString(5)+"</td>");
out.print("<td>"+rs.getString(6)+"</td>");
out.print("<td>"+rs.getString(7)+"</td>");
out.print("<td><a href='AlertStudent.jsp?id="+rs.getString(1)+"'><button class='btn btn-primary'>修改</button></a><a href='DaoDelete.jsp?id="+rs.getString(1)+"' onclick='javascript:return del();'><button class='btn btn-danger'>删除</button></a></td>");
out.print("</tr>");
}
con.close();
}catch(SQLException e){
e.printStackTrace();
}
%>
</tbody>
</table>
</div>
</div>
</body>
</html>
\ No newline at end of file
<%@page import="java.sql.SQLException"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("UTF-8");
String user = request.getParameter("user");
String password = request.getParameter("password");
String sqlQuery = "SELECT * FROM stumanagementbyweb.login WHERE user='"+user+"'AND password='"+password+"'";
try{
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/stumanagementbyweb","root","123456");