UserManage.jsp
上传用户:wenzhanhao
上传日期:2022-03-28
资源大小:9150k
文件大小:6k
源码类别:

百货/超市行业

开发平台:

Visual C++

  1. <%@ page contentType="text/html; charset=gbk" language="java" %>
  2. <%@ page import="mediastore.web.global.*"%>
  3. <%@ page import="mediastore.web.form.*"%>
  4. <%@ page import="java.util.*"%>
  5. <script language="JavaScript">
  6. function Trim(str){
  7.  if(str.charAt(0) == " "){
  8.   str = str.slice(1);
  9.   str = Trim(str); 
  10.  }
  11.  return str;
  12. }
  13. function addUserRec(){
  14. if (Trim(document.form1.username.value) == "" | document.form1.username.value == null) 
  15. alert("请输入用户名!"); 
  16. document.form1.username.value="";
  17. document.form1.username.focus(); 
  18. }
  19. else 
  20. {
  21. document.form1.action="userManageInsert.do";
  22. document.form1.submit();
  23. }
  24. }
  25. </script>
  26. <table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
  27.   <tr> 
  28.     <td width="5" rowspan="4" class="trtable"></td>
  29.     <td width="6" bgcolor="#214984" height="1"></td>
  30.     <td rowspan="4" bgcolor="#214984" width="1" height="1"></td>
  31.     <td bgcolor="#214984" class="10p" colspan="2" height="1"></td>
  32.     <td rowspan="4" width="1" bgcolor="#214984" height="1"></td>
  33.     <td bgcolor="#214984" width="5" height="1"></td>
  34.     <td width="5" rowspan="4" class="trtable"></td>
  35.   </tr>
  36.   <tr> 
  37.     <td width="6"></td>
  38.     <td width="379" height="20" class="mainhead">用户管理</td>
  39.     <td class="mainhead" width="379" height="20">&nbsp;</td>
  40.     <td width="5"></td>
  41.   </tr>
  42. <tr> 
  43.     <td width="6"></td>
  44.     <td valign="top" colspan="2"> 
  45.     <table width="100%" border="0" cellspacing="0" cellpadding="0">
  46.         
  47.         <tr> 
  48.           <td height="300" align="center" valign="top">   
  49.           
  50. <%
  51. UserManageFB umfb = (UserManageFB)request.getAttribute(Globals.REQUEST_USERMANAGE);
  52. List userList = umfb.getUserList();
  53. String orderStr = umfb.getOrderStr();
  54. %>
  55.      <form name="form1" method="post" action="" >
  56.      <font color=#215385><b>添加用户</b></font>
  57.      <IMG src="images/line1.gif" border=0>
  58.      <br>
  59.      <input type="hidden" name="orderStr"  value="<%=orderStr%>">
  60.      <TABLE width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF" class="mailtable"> 
  61. <!--测试<input name=submit type=submit onClick="addUserRec();">-->
  62.   <tr>
  63.             <td  align="right" width=20%> 
  64.                 <b>用户名:</b>
  65.             </td>
  66.             <td width=20%>
  67.              <INPUT class=none  name="username" type="text" size="30" >
  68.             </td>
  69.             <td width=30%>&nbsp;</td>
  70.           </tr>
  71.           
  72.           <tr>
  73.             <td  align="right"> 
  74.                 <b>密&nbsp;&nbsp;码:</b>
  75.             </td>
  76.             <td>
  77.              <INPUT class=none  name="userpassword" type="password" size="30">
  78.             </td>
  79.             <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  80.             <input name=addrec type=button value="添加" onClick="addUserRec()">
  81.             </td>
  82.           </tr>
  83.           <tr> 
  84.             <td  align="right"> 
  85.                 <b>类&nbsp;&nbsp;型:</b>
  86.             </td>
  87.             <td>
  88.              &nbsp;
  89.              <input type="radio" name="userrole" value="0" >系统管理员
  90.              &nbsp;
  91.              <input type="radio" name="userrole" value="1" checked>一般用户
  92.             </td>
  93.             <td>&nbsp;</td>
  94.           </tr>
  95. </TABLE>
  96. </form>
  97. <br>
  98.      <br>
  99. <font color=#215385><b>用户列表</b></font>
  100. <IMG src="images/line1.gif" border=0>
  101. <TABLE width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF" class="mailtable">  
  102. <tr bgcolor="#C2CEDC">
  103. <th>用户标识<a href="userManage.do">(升序)</a></th>
  104. <th>用户名</th>
  105. <th>身份</th>
  106. <th>状态</th>
  107. <th>创建时间</th>
  108. <th>最近一次登录时间<a href="userManageLastLoginTimeDesc.do">(降序)</a></th>
  109. <th>删除</th>
  110. </tr>
  111. <%
  112. int index = 0;
  113.        UserInfo tmpUserInfo = null;
  114.       
  115.        for (index=0; index<userList.size(); index++)
  116. {
  117.        tmpUserInfo = (UserInfo)userList.get(index);
  118.        %>
  119.         <tr <%if((index%2)==1){%>bgcolor="#CAE4F4"<%}%> >
  120.         <td align=center><%= tmpUserInfo.getUserId() %></td>
  121.         <td align=center><%= tmpUserInfo.getUserName() %></td>
  122.         <td align=center><%
  123.         if (tmpUserInfo.getRole().equals("0"))
  124.         { %>
  125.         系统管理员
  126.         <%}else{%>
  127.         一般用户
  128.         <%}%>
  129.         </td>
  130.         <td align=center><%
  131.         if (tmpUserInfo.getUserStatus().equals("1"))
  132.         { %>
  133.         在线
  134.         <%}else{%>
  135.         离线
  136.         <%}%>
  137.         </td>
  138.         <td align=center>
  139.         <%
  140.          String tmpTime = tmpUserInfo.getCreateTime();
  141.          if(tmpTime==null)tmpTime="";
  142.          if(tmpTime.length()>=19)
  143.          {
  144.         %>
  145.          <%= tmpTime.substring(0,19) %>
  146.         <%
  147.          }
  148.         %>
  149.         </td>
  150.         <td align=center>
  151.         <%
  152.          tmpTime = tmpUserInfo.getLastLoginTime();
  153.          if(tmpTime==null)tmpTime="";
  154.          if(tmpTime.length()>=19)
  155.          {
  156.         %>
  157.          <%= tmpTime.substring(0,19) %>
  158.         <%
  159.          }
  160.         %>
  161.         </td>
  162.         <td align=center>
  163.         <%
  164.          if(!tmpUserInfo.getUserId().equals("0"))
  165.          {
  166.         %>
  167.         <a href="userManageDelete.do?orderStr=<%=orderStr%>&userId=<%=tmpUserInfo.getUserId()%>"><IMG src="images/delto.gif" border=0></a></td>
  168. <%
  169. }
  170. %>
  171.         </tr>
  172.         <%
  173.        }
  174.         %>
  175. </TABLE>
  176. <p><center>
  177. 用户总数:<font color="red"><%=umfb.getTotalUserNum()%></font>&nbsp;&nbsp;&nbsp;
  178.         在线:<font color="red"><%=umfb.getOnlineUserNum()%></font>&nbsp;&nbsp;&nbsp;
  179.         离线:<font color="red"><%=umfb.getOfflineUserNum()%></font>&nbsp;&nbsp;&nbsp;
  180.      </center><p>
  181.     
  182. </td>
  183.         </tr>
  184.         <tr> 
  185.           <td valign="middle" align="center">&nbsp;</td>
  186.         </tr>
  187.       </table>
  188.       
  189.     </td>
  190.     <td width="5"></td>
  191.   </tr>
  192.   <tr> 
  193.     <td width="6"></td>
  194.     <td colspan="2" class="mainhead">&nbsp;</td>
  195.     <td width="5"></td>
  196.   </tr>
  197.   <tr> 
  198.     <td colspan="8" bgcolor="#214984" height="2"></td>
  199.   </tr>
  200. </table>