?? adduser.jsp
字號:
<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>增加員工</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script Language="JavaScript">
function check()
{
var flag=1;
var s="";
if(document.info.userName.value=="")
{
s="請輸入員工姓名";
flag=0;
}
if(document.info.userPassword.value=="")
{
if(flag==0) s+=",員工密碼"
else s="請輸入員工密碼";
flag=0;
}
if(document.info.depName.value=="")
{
if(flag==0) s+=",選擇部門";
else s="請選擇部門";
flag=0;
}
if(document.info.power.value=="")
{
if(flag==0) s+=",分配職位";
else s="請分配職位";
flag=0;
}
if(flag==0)
{
alert(s+"!"); return false;
}
else return true;
}
function mycheck()
{
window.opener.location.reload();
}
</script>
</head>
<jsp:useBean id="student" scope="page" class="oabean.database"/>
<jsp:useBean id="department" scope="page" class="oabean.departmentBean"/>
<body bgcolor="#4692B3"text="#FFFFFF"link="#33FF00">
<%
String uname=(String)session.getAttribute("user");
if(uname==null) {response.sendRedirect("../index.jsp");}
%>
<form name="info" action="user/addUser.user" onsubmit="return check();" method="post">
姓名:<input name="uname" type="text" ><br><br>
密碼:<input type="text" name="upassword" value="000"><br><br>
屬于部門:<select name="depname">
<option value="">==請選擇部門==</option>
<%
ResultSet rs=department.getDeparment();
String name="";
int depId=0;
while(rs.next())
{
name=rs.getString("depName");
depId=rs.getInt("depId");
%>
<option value="<%=depId%>"><%=name%></option>
<%
}
%>
</select><br><br>
職位:<select name="power">
<option value="">==請選擇職位==</option>
<option value="1">一般員工</option>
<option value="2">部門管理員</option>
</select><br><br>
<table width="20%">
<tr>
<td> <input type="submit" name="Submit" value="確定" onclick="mycheck();"></td>
<td><input type="reset" name="res" value="重置"></td>
</form>
<td><input type="submit" name="guanbi" value="取消" onclick="tb_remove();"></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -