?? add_user.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<jsp:directive.page import="Beans.AdduserBean"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rev=stylesheet media=all href="style/login.css" type=text/css rel=stylesheet>
</head>
<body>
<%
try
{
String type1=(String)session.getValue("type");
if (!type1.equals("32")) response.sendRedirect("Login.jsp");
}
catch(Exception e)
{
response.sendRedirect("Login.jsp");
}
%>
<jsp:include page="inc/head.html"/>
<jsp:useBean id="adduser" class="Beans.AdduserBean">
<jsp:setProperty name="adduser" property="*"/></jsp:useBean>
<%
int type=0;
if (request.getParameter("C1")!=null) if (request.getParameter("C1").equals("ON")) type+=1;
if (request.getParameter("C2")!=null) if (request.getParameter("C2").equals("ON")) type+=2;
if (request.getParameter("C3")!=null) if (request.getParameter("C3").equals("ON")) type+=4;
if (request.getParameter("C4")!=null) if (request.getParameter("C4").equals("ON")) type+=8;
if (request.getParameter("C5")!=null) if (request.getParameter("C5").equals("ON")) type+=16;
if (request.getParameter("C6")!=null) if (request.getParameter("C6").equals("ON")) type+=32;
if (type>0){
adduser.setType(type);
if(adduser.adduser()) out.print("<script language='javascript'>alert('添加用戶成功!');location.href='admin.jsp'</script>");
else out.print("<script language='javascript'>alert('添加用戶失敗!');location.href='admin.jsp'</script>");
}
%><table cellpadding="0" cellspacing="0" width="1164" id="table1" height="468">
<form name="form1" method="post" action="add_user.jsp" id="form1">
<tr>
<td colspan="2">
<p align="center"> </td>
</tr>
<tr>
<td align="center" colspan="2"> <p> </p>
<p> </td>
</tr>
<tr>
<td align="right" width="527"> </td>
<td align="left" width="637"> </td>
</tr>
<tr>
<td align="right" width="527">
<p align="right">輸入姓名∶</td>
<td align="left" width="637">
<input size="24" maxlength="256" name="name" style="float: left"></td>
</tr>
<tr>
<td align="right" width="527"> </td>
<td align="left" width="637"> </td>
</tr>
<tr>
<td align="right" width="527">輸入學號∶</td>
<td align="left" width="637"><input type="text" size="24" maxlength="256" name="id"></td>
</tr>
<tr>
<td align="right" width="527"> </td>
<td align="left" width="637"> </td>
</tr>
<tr>
<td align="right" width="527">輸入密碼∶</td>
<td align="left" width="637">
<input type="text" size="24" maxlength="256" name="pwd"></td>
</tr>
<tr>
<td align="right" width="527"> </td>
<td align="left" width="637"> </td>
</tr>
<tr>
<td align="right" width="527">班级号码∶</td>
<td align="left" width="637"><input type="text" size="24" maxlength="256" name="cls"></td>
</tr>
<tr>
<td align="center" width="1164" height="20" colspan="2">
<p> </p>
<p> </td>
</tr>
<tr>
<td align="center" width="1164" colspan="2"> </td>
</tr>
<tr>
<td align="center" width="1164" colspan="2">設置權限
<p><input type="checkbox" name="C1" value="ON">學生
<input type="checkbox" name="C2" value="ON">教師
<input type="checkbox" name="C3" value="ON">輔導員<input type="checkbox" name="C4" value="ON">班主任<input type="checkbox" name="C5" value="ON">醫生<input type="checkbox" name="C6" value="ON">管理員</p>
<p> </p>
<p><input class=button type="submit" value="添加用戶" name="B1"></p>
</form>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -