?? tf_user_update.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*" errorPage="../../pub_include/ErrPage.jsp" %>
<%request.setCharacterEncoding("gb2312");%>
<jsp:include page="../../pub_include/pub_function_javascript.html" flush="true"/>
<%@ page import="jinLing.pub.*,jinLing.user.*,jinLing.department.*"%>
<html>
<head>
<style>
<!--
.style2 {color: #FFFFFF}
-->
</style>
<link rel="stylesheet" type="text/css" href="../../pub_include/hosc.css">
<link href="../../pub_include/body_css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312/">
</head>
<%
Collection col = null;
Hashtable list = new Hashtable();
// InitInputOption initInputOption;
// PubOp pubOp = new PubOp("USER");
User user=new User();
Department department=new Department();
//判斷增加修改
String optype = "1";
if(null != request.getParameter("optype") && !request.getParameter("optype").toString().equals(""))
optype=request.getParameter("optype").toString();
%>
<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' background='../../images/bg.gif' >
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%' >
<tr>
<TD width='100%'class='title'> 用戶管理</span></TD>
</tr>
</table>
<div align='center'>
<center>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width=100% >
<tr>
<td width='100%' height='10' align='center'></td>
</tr>
<tr>
<td width='100%' height='0' valign='top' align='center'>
<table width='100%' border='1' style='border-collapse: collapse; padding-left:5' bordercolor='#6595D6' cellpadding='0' cellspacing='0'>
<tr class='table_biaoti'>
<td >帳號</td>
<td >姓名</td>
<td >單位</td>
<td >電話</td>
<td width='5%' >刪除</td>
<td width='5%' >修改</td>
</tr>
<%
String pPageNo = "1";
if (null != request.getParameter("PAGENO") &&!request.getParameter("PAGENO").toString().trim().equals(""))
if (Integer.parseInt(request.getParameter("PAGENO"))<1)
pPageNo="1";
else
pPageNo=request.getParameter("PAGENO");
col = user.execSel(list,pPageNo,"10");
String pPageCount = String.valueOf(user.getRecordcount());
String allCount = pPageCount;
pPageCount = (Integer.parseInt(pPageCount)%10==0)?String.valueOf(Integer.parseInt(pPageCount)/10):String.valueOf(Integer.parseInt(pPageCount)/10+1);
if (Integer.parseInt(pPageCount)<Integer.parseInt(pPageNo))
pPageNo=pPageCount;
Iterator it = col.iterator();
while (it.hasNext())
{
Hashtable rs = (Hashtable) it.next();
%>
<tr class='table_list_lr'>
<td > <%=rs.get("USER_NO")%> </td>
<td > <%=rs.get("USER_NAME")%> </td>
<td > <%=rs.get("DEPARTMENT_NAME")%> </td>
<td > <%=rs.get("USER_TEL")%> </td>
<!--刪除和修改還要傳一些條件參數-->
<td align='center' height='20' valign='middle'>
<img src='../../images/del.gif' width='18' height='18' border='0' style='cursor:hand' onClick="Del_ID('<%=rs.get("USER_ID")%>')">
</td>
<td align='center' height='20' valign='middle'>
<a href='tf_user_update.jsp?optype=2&USER_ID=<%=rs.get("USER_ID")%>'>
<img src='../../images/edit.gif' width='18' height='18' border='0' style='cursor:hand'>
</a>
</td>
</tr>
<%
}
%>
</table>
<p></td>
</tr>
</table>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width=90% >
<%
String strpageno = "tf_user_update.jsp";
%>
<form action='<%=strpageno%>' method='POST' name='form_list'>
<tr>
<td height='17' valign='top' align='center'> </td>
<td height='17' valign='top' align='center'>
<%
String vFirstURL = strpageno;
String vPrevURL = strpageno+"?&PAGENO="+(Integer.parseInt(pPageNo)-1);
String vNextURL = strpageno+"?&PAGENO="+((Integer.parseInt(pPageCount)<(Integer.parseInt(pPageNo)+1))?(Integer.parseInt(pPageCount)):(Integer.parseInt(pPageNo)+1));
String vLastURL = strpageno+"?&PAGENO="+pPageCount;
%>
<A onClick="PrevURLFun();" style="cursor:hand "> 上一頁 </A>
<A onClick="NextURLFun();" style="cursor:hand "> 下一頁 </A>
<script language=javascript>
function PrevURLFun()
{
self.location = "<%=vPrevURL%>";
return true;
}
function NextURLFun()
{
self.location = "<%=vNextURL%>";
return true;
}
</script>
</td>
</tr>
</form>
</table>
</center>
</div>
<script language="javascript">
function onCommit() //回車鍵后觸發
{
var p = document.form_list.PAGENO.value;
//輸入頁數若大于總頁數,則跳到最后一頁
if(parseInt(p)><%=Integer.parseInt(pPageCount)%>)
document.form_list.PAGENO.value = <%=Integer.parseInt(pPageCount)%>
if (window.event.keyCode==13)
{
document.form_list.submit();
}
}
//接收上面傳來的唯一A_ID值付給pval
function Del_ID(pval)
{
if (window.confirm("您確認刪除嗎?"))
{
self.location = "tf_user_del.jsp?USER_ID="+pval;
return true;
}
return false;
}
</script>
</td>
</tr>
</table>
</center>
</div>
</center>
</div>
<%
String USER_ID= "" ; //
String USER_NO= "" ;
String DEPARTMENT_ID= "" ; //單位
String USER_NAME= "" ; //姓名
String USER_SN= "" ; //密碼
String USER_TEL= "" ; //電話
String USER_EMAIL= "" ; //電子郵件
int type=Integer.parseInt(optype);
if(type==2)
{
if(null != request.getParameter("USER_ID") && !request.getParameter("USER_ID").toString().equals(""))
{
USER_ID = request.getParameter("USER_ID").toString();
list.put("USER_ID",USER_ID);
col = user.execSel(list);
Iterator ir = col.iterator();
Hashtable tt = new Hashtable();
if (ir.hasNext())
{
tt=(Hashtable)ir.next();
USER_ID = Util.getNulltoStr(tt.get("USER_ID")); //
USER_NO = Util.getNulltoStr(tt.get("USER_NO"));
DEPARTMENT_ID = Util.getNulltoStr(tt.get("DEPARTMENT_ID")); // 單位
USER_NAME = Util.getNulltoStr(tt.get("USER_NAME")); // 姓名
USER_SN = Util.getNulltoStr(tt.get("USER_SN")); // 密碼
USER_TEL = Util.getNulltoStr(tt.get("USER_TEL")); // 電話
USER_EMAIL = Util.getNulltoStr(tt.get("USER_EMAIL")); // 電子郵件
}
}
}
%>
<br>
<form action="tf_user_java.jsp" name="form_query" method="post" onSubmit="return ActionStatus()">
<input name="optype" type="hidden" value="<%=optype%>" >
<input name="USER_ID" type="hidden" value="<%=USER_ID%>">
<div align="center">
<center>
<table width='90%' border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111'>
<tr>
<td height='25' colspan='4' class='tabletop' >用戶管理</td>
</tr>
<tr>
<td width='120' class='table_list'>帳號</td>
<td width='230'><input type='text' onKeyDown = 'nextInput()' name='USER_NO' size='25' maxlength='' value='<%=USER_NO%>' >
<font color='#FF0000'>*</font></td>
<td width='120' class='table_list'>姓名 </td>
<td width='230'><input type='text' onKeyDown = 'nextInput()' name='USER_NAME' size='25' maxlength='' value='<%=USER_NAME%>' >
<font color='#FF0000'>*</font> </td>
</tr>
<tr>
<td width='120' class='table_list'>密碼 </td>
<td width='230'><input type="password" onKeyDown = 'nextInput()' name='USER_SN' size='25' maxlength='' value='<%=USER_SN%>' >
<font color='#FF0000'>*</font> </td>
<td width='120' class='table_list'>單位</td>
<td width='230'><select size='1' onkeydown = 'nextInput()' name='DEPARTMENT_ID' >
<%=department.getInitData(DEPARTMENT_ID)%>
</select>
<font color='#FF0000'>*</font> </td>
</tr>
<tr>
<td width='120' class='table_list'> 電話 </td>
<td width='230'>
<input type='text' onKeyDown = 'nextInput()' name='USER_TEL' size='25' maxlength='' value='<%=USER_TEL%>' >
</td>
<td width='120' class='table_list'>電子郵件 </td>
<td width='230'><input type='text' onKeyDown = 'nextInput()' name='USER_EMAIL' size='25' maxlength='' value='<%=USER_EMAIL%>' >
</td>
<tr>
<td height='40' colspan='4' align='center' > <input type="submit" value="提交" border="0" >
<input type="reset" value="取消">
</td>
</tr>
</table>
</center>
</div>
<br>
</form>
<script language=javascript>
function ActionStatus()
{
return check_input();
}
function check_input(){
var type=true;
type=check_null(document.form_query.USER_NO,'請輸入帳號!!')
if (!type)
{
return false;
}
type=check_null(document.form_query.USER_NAME,'請輸入姓名!!')
if (!type)
{
return false;
}
type=check_null(document.form_query.USER_SN,'請輸入密碼!!')
if (!type)
{
return false;
}
type=check_selitem(document.form_query.DEPARTMENT_ID,'','請選擇單位!')
if (!type)
{
return false;
}
return true;
}
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -