⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tf_user_update.jsp

📁 这是我上次报java培训时
💻 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'> &nbsp;用户管理</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'>&nbsp; </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'>&nbsp; 电话 </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 + -