?? auto_gen_users.jsp
字號:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.ResultSet,util.stringUtil,user.user_operation"%>
<!--------接收輸入參數---------->
<%//-------student_name參數------------
String student_name=request.getParameter("student_name");
if(student_name!=null&&student_name.equals("null"))
student_name=null;
stringUtil stringCode=new stringUtil();
student_name=stringCode.codeToString(student_name);
%>
<!------系統交互javascript----->
<script language="JavaScript">
<!--
function check_data() {
//按提交按鈕時,檢查數據是否為空
if(student_form.studentname.value.length==0){
alert("輸入的學生姓名為空,請重新輸入!");
return false;
}else return true;
}
function confirm_genAll() {
//按生成所有學生用戶按鈕時,彈出確認對話框
if(confirm("確認要生成所有學生用戶嗎?")){
window.navigate("auto_gen_users_save.jsp");
}else return false;
}
function confirm_genPart() {
//按生成選中的部分學生用戶按鈕時,彈出確認對話框
if(confirm("確認要生成選中的部分學生用戶嗎?")){
return true;
}else return false;
}
-->
</script>
<html>
<body bgcolor="#DCDADA">
<!---------導航菜單------------->
<table border="0" width="100%">
<tr>
<td width="100%">
<p align="left">您當前所在位置:自動生成系統用戶-->自動生成學生用戶</p>
</td>
</tr>
<jsp:include page="navigator.txt"/>
</table>
<!---------數據輸入------------->
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#808080" bordercolorlight="#808080" bordercolordark="#808080">
<tr>
<td width="100%">
<form name="student_form" method="post" onsubmit="return check_data()">
<table border="0" width="100%">
<tr>
<td width="100%" colspan="3">輸入要查詢的學生姓名:<br><hr></td>
</tr>
<tr>
<td width="25%" align="right">學生姓名:</td>
<td width="25%"><input type="text" name="student_name" maxlength="20"></td>
<td width="50%"><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</td>
</tr>
</table><br>
<!---------數據輸出------------->
<form name="gen_user_student" method="post" action="auto_gen_users_save.jsp">
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#808080" bordercolorlight="#808080" bordercolordark="#808080">
<tr>
<td colspan="5" align="right">
<input type="button" value="生成所有學生用戶" name="genAll" onclick="return confirm_genAll()">
<input type="submit" value="生成選中的學生用戶" name="genPart" onclick="return confirm_genPart()">
</td>
</tr>
<jsp:useBean id="student_select" class="studentman.student_operation" scope="page"/>
<%//-----用JavaBean查詢出數據,并得到總記錄條數------
ResultSet rs=student_select.student_select_part(0,student_name);
rs.last();
int rowCount=rs.getRow();
rs.beforeFirst();
%>
<jsp:useBean id="student_rsFenYe" class="util.rsFenYe" scope="page"/>
<jsp:setProperty name="student_rsFenYe" property="rs" value="<%=rs%>"/>
<!-------pageSize為每頁記錄條數--------->
<jsp:setProperty name="student_rsFenYe" property="pageSize" value="10"/>
<tr>
<td colspan="4" align="center">
<%//-----從請求參數中得到當前頁碼------
String currentPage=request.getParameter("currentPage");
try{
student_rsFenYe.setCurrentPage(Integer.parseInt(currentPage));
}catch(Exception e)
{//如果參數不正確,設置當前頁碼為1
student_rsFenYe.setCurrentPage(1);
}
%>
所有學生(共<%=rowCount%>位)
<%
String paraName[]={"student_name"};
String paraValue[]={student_name};%>
<%=student_rsFenYe.earn_fenyi_string("auto_gen_users.jsp",paraName,paraValue)%>
</td>
</tr>
<tr>
<td width="15%" align="center">選擇(<input type="checkbox" onclick="all_change()" name="allselect">全選)</td>
<td width="15%" align="center">學生序號</td>
<td width="30%" align="center">學生姓名</td>
<td width="20%" align="center">是否生成了用戶</td>
<td width="20%" align="center">修改用戶信息</td>
</tr>
<%int i=0;
for(;i<student_rsFenYe.getPageSize()&&rs.next();i++){%>
<tr>
<td align="center">
<input type="checkbox" name="check_user<%=i%>" value="<%=rs.getLong("student_id")%>">
</td>
<td align="center"><%=rs.getLong("student_id")%></td>
<td align="center"><%=rs.getString("student_name")%></td>
<td align="center">
<%user_operation userOp=new user_operation();
int haveGened=userOp.isAutoGenOK(rs.getLong("student_id"),4);
switch(haveGened){
case 1:
out.println("已生成");break;
case 0:
out.println("未生成");break;
default:
out.println("未知");break;
}
%>
</td>
<td align="center">
<%if(haveGened==1){
long user_id=userOp.getUserId(rs.getInt("student_id"),4);
out.print("<a href='update_users.jsp?sysuser_id="+
user_id+"'>修改</a> ");
out.print("<a href='delete_user.jsp?sysuser_id="+
user_id+"'>刪除</a>");
}%>
</td>
</tr>
<%
}
%>
<input type="hidden" name="all_count" value="<%=i%>">
</table>
</form>
<br>
<!----------操作提示信息--------------->
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#808080" bordercolorlight="#808080" bordercolordark="#808080">
<tr>
<td width="100%">
<table border="0" width="100%">
<tr>
<td width="100%">注意:1.已生成用戶的學生不能再次生成。<br>
2.生成的用戶用戶名為用戶的真實姓名,密碼為111111。</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!----復選框交互腳本---->
<!------系統交互javascript----->
<script language="JavaScript">
<!--
function all_change() {
//點全選復選框時的交互
if(gen_user_student.allselect.checked==true){
<%for(int j=0;j<i;j++){%>
gen_user_student.check_user<%=j%>.checked=true;
<%}%>
}else{
<%for(int j=0;j<i;j++){%>
gen_user_student.check_user<%=j%>.checked=false;
<%}%>
}
}
-->
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -