diff --git a/WebRoot/JSPhandle/docFile_insert.jsp b/WebRoot/JSPhandle/docFile_insert.jsp index a5c6017..3a7a704 100644 --- a/WebRoot/JSPhandle/docFile_insert.jsp +++ b/WebRoot/JSPhandle/docFile_insert.jsp @@ -28,9 +28,8 @@ <% boolean flag = false; request.setCharacterEncoding("utf-8"); - String viewport = request.getParameter("viewport"); - String add_admin = request.getParameter("add_admin"); String empid = request.getParameter("empid"); + String edi_name = request.getParameter("edi_name"); String empjob = request.getParameter("empjob"); String empname = request.getParameter("empname"); String empsex = request.getParameter("empsex"); @@ -46,6 +45,7 @@ String empadress = request.getParameter("empadress"); String empResume = request.getParameter("empResume"); String empremark = request.getParameter("empremark"); + int i = 1; %> <% String driver = "com.mysql.jdbc.Driver"; @@ -56,11 +56,24 @@ try { Connection conn = DriverManager.getConnection(url, use, password); PreparedStatement sql = conn.prepareStatement( - "insert into adminstrator_record(AdminNo,AdminName,Adminsex,Adminjob)values(?,?,?,?)"); - sql.setString(1, adminNo); - sql.setString(2, name); - sql.setString(3, adminsex); - sql.setString(4, adminjob); + "INSERT INTO tb_docfile (empid,empjob,empname,empsex,empnation,empnative,empschool,empdept,empmajor,empbirthday,empQQ,empemail,empPhoneNum,empadress,empResume,empremark,edi_name) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); + sql.setString(i++, empid); + sql.setString(i++, empjob); + sql.setString(i++, empname); + sql.setString(i++, empsex); + sql.setString(i++, empnation); + sql.setString(i++, empnative); + sql.setString(i++, empschool); + sql.setString(i++, empdept); + sql.setString(i++, empmajor); + sql.setString(i++, empbirthday); + sql.setString(i++, empQQ); + sql.setString(i++, empemail); + sql.setString(i++, empPhoneNum); + sql.setString(i++, empadress); + sql.setString(i++, empResume); + sql.setString(i++, empremark); + sql.setString(i++, edi_name); int rtn = sql.executeUpdate(); if (rtn != 0) { flag = true; @@ -74,12 +87,34 @@ <% if (flag == true) { + i = 0; %> + <% } else if (flag == false) { + out.println("插入失败,请将以下信息交给开发者处理"); %> - + <%-- --%> + <%=i%> +
+ <%=empid%>
+ <%=empjob%> + <%=empname%> + <%=empsex%> + <%=empnation%> + <%=empnative%> + <%=empschool%> + <%=empdept%> + <%=empmajor%> + <%=empbirthday%> + <%=empQQ%> + <%=empemail%> + <%=empPhoneNum%> + <%=empadress%> + <%=empResume%> + <%=empremark%> + <%=edi_name%> <% } %> diff --git a/WebRoot/JSPhandle/docFile_update.jsp b/WebRoot/JSPhandle/docFile_update.jsp new file mode 100644 index 0000000..32ec06e --- /dev/null +++ b/WebRoot/JSPhandle/docFile_update.jsp @@ -0,0 +1,121 @@ +<%@ page language="java" import="java.sql.*" + contentType="text/html;charset=utf-8"%> +<% + String path = request.getContextPath(); + String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + + path + "/"; +%> + + + + + + +检验插入页面 + + + + + + + + + + +
+ <% + boolean flag = false; + request.setCharacterEncoding("utf-8"); + String empid = request.getParameter("empid"); + String empjob = request.getParameter("empjob"); + String empname = request.getParameter("empname"); + String empsex = request.getParameter("empsex"); + String empnation = request.getParameter("empnation"); + String empnative = request.getParameter("empnative"); + String empschool = request.getParameter("empschool"); + String empdept = request.getParameter("empdept"); + String empmajor = request.getParameter("empmajor"); + String empbirthday = request.getParameter("empbirthday"); + String empQQ = request.getParameter("empQQ"); + String empemail = request.getParameter("empemail"); + String empPhoneNum = request.getParameter("empPhoneNum"); + String empadress = request.getParameter("empadress"); + String empResume = request.getParameter("empResume"); + String empremark = request.getParameter("empremark"); + int i = 1; + %> + <% + String driver = "com.mysql.jdbc.Driver"; + String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8"; + String use = "root"; + String password = ""; + Class.forName(driver); + try { + Connection conn = DriverManager.getConnection(url, use, password); + PreparedStatement sql = conn.prepareStatement( + "UPDATE tb_docfile SET empjob=?,empname=?,empsex=?,empnation=?,empnative=?,empschool=?,empdept=?,empmajor=?,empbirthday=?,empQQ=?,empemail=?,empPhoneNum=?,empadress=?,empResume=?,empremark=? WHERE empid=?;"); + sql.setString(i++, empjob); + sql.setString(i++, empname); + sql.setString(i++, empsex); + sql.setString(i++, empnation); + sql.setString(i++, empnative); + sql.setString(i++, empschool); + sql.setString(i++, empdept); + sql.setString(i++, empmajor); + sql.setString(i++, empbirthday); + sql.setString(i++, empQQ); + sql.setString(i++, empemail); + sql.setString(i++, empPhoneNum); + sql.setString(i++, empadress); + sql.setString(i++, empResume); + sql.setString(i++, empremark); + sql.setString(i++, empid); + int rtn = sql.executeUpdate(); + if (rtn != 0) { + flag = true; + } + sql.close(); + conn.close(); + } catch (Exception ex) { + ex.printStackTrace(); + } + %> + + <% + if (flag == true) { + i = 0; + %> + + + <% + } else if (flag == false) { + out.println("插入失败,请将以下信息交给开发者处理"); + + %> + <%-- --%> +
+ <%=i%> +
+ <%=empid%>
+ <%=empjob%> + <%=empname%> + <%=empsex%> + <%=empnation%> + <%=empnative%> + <%=empschool%> + <%=empdept%> + <%=empmajor%> + <%=empbirthday%> + <%=empQQ%> + <%=empemail%> + <%=empPhoneNum%> + <%=empadress%> + <%=empResume%> + <%=empremark%> + <% + } + %> + + diff --git a/WebRoot/add_docFile.jsp b/WebRoot/add_docFile.jsp index ed0e569..1fb0f16 100644 --- a/WebRoot/add_docFile.jsp +++ b/WebRoot/add_docFile.jsp @@ -36,25 +36,51 @@ align="center">

添加档案

- + name="add_docFile" action="JSPhandle/docFile_insert.jsp" + method="post"> +
+ <% + String driverClass = "com.mysql.jdbc.Driver"; + String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8"; + String user = "root"; + String password = ""; + + try { + Class.forName(driverClass); + ResultSet rs = null; + Connection conn = null; + PreparedStatement sql = null; + conn = DriverManager.getConnection(url, user, password); + Statement stmt = conn.createStatement(); + sql = conn.prepareStatement("SELECT count(empid) Num FROM tb_docfile;"); + rs = sql.executeQuery(); + while (rs.next()) { + %> + - + + + <% + } + sql.close(); + rs.close(); + conn.close(); + stmt.close(); + } catch (Exception ex) { + ex.printStackTrace(); + } + %> @@ -104,7 +128,8 @@ - + @@ -112,22 +137,27 @@ - + - + - + - + - + @@ -143,6 +173,7 @@ +
个人档案
工号">职务
学校 学院
专业 出生年月
社交信息
QQ 邮箱
电话 住址
简历
diff --git a/WebRoot/manage_docFile.jsp b/WebRoot/manage_docFile.jsp new file mode 100644 index 0000000..ef7ce75 --- /dev/null +++ b/WebRoot/manage_docFile.jsp @@ -0,0 +1,224 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@page import="java.sql.Connection"%> +<%@page import="java.sql.*"%> +<%@page import="java.sql.DriverManager"%> + + + + + + +学生管理 + + + + + + + <%@ include file="/module/top.jsp"%> + + <%@ include file="/module/limits_check.jsp"%> + +
+ <% + if (session.getAttribute("actualuser") == null) { + out.println(""); + return; + } + Object actualuser = session.getAttribute("actualuser"); + %> +
+ <%@ include file="module/sidebar.jsp"%> + + +
+

添加档案

+
+ + + + + + <% + try { + Class.forName("com.mysql.jdbc.Driver"); + } catch (ClassNotFoundException e) { + out.print("暂时无法访问"); + } + try { + Connection con; + Statement sql; + ResultSet rs; + con = DriverManager.getConnection( + "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8", "root", ""); + sql = con.createStatement(); + String condition = null; + condition = "SELECT empid FROM tb_docfile"; + rs = sql.executeQuery(condition); + while (rs.next()) //输出查询结果 + { + %> + + + <% + } + con.close(); + sql.close(); + rs.close(); + } catch ( + + SQLException e1) { + out.print("无法查询记录"); + } + %> + + + + + + + <% + Class.forName(driverClass); + try { + ResultSet rs = null; + Connection conn = null; + PreparedStatement sql = null; + + conn = DriverManager.getConnection(url, user, password); + Statement stmt = conn.createStatement(); + sql = conn.prepareStatement("SELECT * FROM tb_docfile where edi_name=?;"); + sql.setString(1, (String) user1); + rs = sql.executeQuery(); + while (rs.next()) { + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + } + sql.close(); + rs.close(); + conn.close(); + stmt.close(); + } catch ( + + SQLException e1) { + out.print("无法查询记录"); + } + %> +
个人档案 +
工号" readonly>职务
姓名">性别
民族">籍贯">
学校">学院">
专业">出生年月">
社交信息
QQ">邮箱">
电话">住址">
简历
备注
+
+
+
+ + <%@ include file="module/footer.jsp"%> + +
+ + + + \ No newline at end of file diff --git a/WebRoot/module/sidebar.jsp b/WebRoot/module/sidebar.jsp index 26f72bb..e19600f 100644 --- a/WebRoot/module/sidebar.jsp +++ b/WebRoot/module/sidebar.jsp @@ -67,10 +67,10 @@
  • 信2资源站(维护中)
  • diff --git a/WebRoot/show_docFile.jsp b/WebRoot/show_docFile.jsp new file mode 100644 index 0000000..a0378b0 --- /dev/null +++ b/WebRoot/show_docFile.jsp @@ -0,0 +1,244 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@page import="java.sql.Connection"%> +<%@page import="java.sql.*"%> +<%@page import="java.sql.DriverManager"%> +<%-- <%@ page import="login.*" %> --%> + + + + + + +学生管理 + + + + + + + +<%-- <% +java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + +java.util.Date currentTime = new java.util.Date();//得到当前系统时间 + +String str_date1 = formatter.format(currentTime); //将日期时间格式化 +String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式 +%> --%> + + <% + if (session.getAttribute("actualuser") == null) { + out.println( + ""); + return; + } + Object user0 = session.getAttribute("actualuser"); + /* out.println("欢迎"+user0);//输出当前session用户 */ + %> + <%@ include file="module/top.jsp"%> +
    +

    团队成员档案

    +
    + <%@ include file="module/sidebar.jsp"%> + + +
    +
    +
    所有个人档案记录
    +
    + <% + try { + Class.forName("com.mysql.jdbc.Driver"); + } catch (ClassNotFoundException e) { + out.print("驱动异常"); + } + try { + Connection con; + Statement sql; + ResultSet rs; + con = DriverManager.getConnection( + "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8", "root", ""); + sql = con.createStatement(); + String condition = null; + condition = "SELECT empid,empname,empjob FROM tb_docfile"; + rs = sql.executeQuery(condition); + //String k1=rs.getString(1); + out.print(""); + out.print(""); + out.print(""); + out.print(""); + out.print(""); + while (rs.next()) //输出查询结果 + { + + out.print(""); + out.println(""); + out.print(""); + out.print( + ""); + out.print(""); + + } + out.print("
    姓名岗位"); + out.print("
    " + rs.getString(2) + "
    " + rs.getString(3) + "
    "); + con.close(); + sql.close(); + rs.close(); + } catch (SQLException e1) { + out.print("无法查询记录"); + } + %> + <% + try { + Class.forName("com.mysql.jdbc.Driver"); + } catch (ClassNotFoundException e) { + out.print("暂时无法访问"); + } + try { + Connection con; + Statement sql; + ResultSet rs; + con = DriverManager.getConnection( + "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8", "root", ""); + sql = con.createStatement(); + String condition = null; + condition = "SELECT * FROM tb_docfile"; + rs = sql.executeQuery(condition); + + while (rs.next()) //输出查询结果 + { + %> + + <% + } + con.close(); + sql.close(); + rs.close(); + } catch ( + + SQLException e1) { + out.print("无法查询记录"); + } + %> +
    +
    +
    +
    + <%@ include file="module/footer.jsp"%> +
    + + + + +