adminstudent4.jsp
上传用户:mkymky1985
上传日期:2014-06-23
资源大小:754k
文件大小:2k
- <%@ page language = "java" contentType = "text/html;charset=gb2312"%>
- <%@ page import = "java.sql.*,wsxk.*" %>
- <jsp:useBean id="subject" scope="page" class="wsxk.ConDB"/>
- <%! String trans(String chi)
- {
- String result = null;
- byte temp [];
- try
- {
- temp=chi.getBytes("iso-8859-1");
- result = new String(temp, "gb2312");
- }
- catch(Exception e)
- {
- System.out.println (e.toString());
- }
- return result;
- }
- %>
- <%
- String stuid = new String (request.getParameter("stuid"));
- String stuname = new String (request.getParameter("stuname"));
- String stuno = new String (request.getParameter("stuno"));
- String stugrade = new String (request.getParameter("stugrade"));
- String stupsw = new String (request.getParameter("stupsw"));
- stugrade=stugrade.trim();
- stugrade=trans(stugrade);
- System.out.print(stugrade);
- if (stugrade.equals("大一"))
- stugrade="1";
- if (stugrade.equals("大二"))
- stugrade="2";
- if (stugrade.equals("大三"))
- stugrade="3";
- if (stugrade.equals("大四"))
- stugrade="4";
- //System.out.println("EEEE333");
- String str = null;
- String str2 = "";
- %>
- <% if (stuname.trim().equals("")||stuno.trim().equals("")||stupsw.trim().equals(""))
- {response.sendRedirect("adminstudenterr.htm");}
- else{String sql2 = "update student set stupsw = '"+stupsw+"',stuname = '"+trans(stuname)+"',stuno = '"+stuno+"',stugrade = '"+stugrade+"' where stuid = '"+stuid+"'";//(stupsw, stuname, stuno, stugrade) values('" +stupsw+ "','" + trans(stuname) + "','" + stuno + "','" +stugrade+ "')";
- subject.executeUpdate(sql2);}
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <meta HTTP-EQUIV=REFRESH CONTENT="10; URL=adminstudent.jsp">
- <link href="_notes/aaa.css" rel="stylesheet" type="text/css">
- <style type="text/css">
- <!--
- @import url("_notes/ccc");
- body,td,th {
- font-size: 12px;
- color: #FFFFFF;
- font-weight: bold;
- }
- .style1 {color: #000000}
- -->
- </style>
- </HEAD>
- <BODY BGCOLOR=#0D85A6 BACKGROUND="images/bg.gif" >
- <div align="center">
- <p align="left"> <br>
- 学生信息修改成功,本页将于10秒内自动<a href="adminstudent.jsp" class="style1">返回学生管理页面</a></p>
- <p><br>
- <img src="images/qa.jpg" width="640" height="427"></p>
- </div>
- </BODY>
- </HTML>