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

📄 showuserrole.jsp

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JSP
字号:
<%@page contentType="text/html; charset=gb2312"%>
<%@ page language="java" import="java.util.*,
    com.tongtu.util.UserInfo,
     com.tongtu.util.City,
    com.tongtu.util.Page;" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Page pages=(Page)request.getAttribute("page");
int pagenum=0;
 String pagen=(String)request.getAttribute("pagenum");
 String rows=(String)request.getAttribute("rowCount");
 if (pagen!=null) pagenum=Integer.parseInt(pagen);
 int userInt = 0; //当前页记录数
 int posInt  = 1; //开始位置
 int rowCount = 0;
 if (rows!= null) rowCount = Integer.parseInt(rows);
   if (page != null){
       List userList=pages.getList();
       userInt = userList.size();
     }     

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script language="JavaScript" type="text/JavaScript">
function del(){
       var len=<%=userInt%>;
       var n=0;
    for(i=0;i<len;i++)
   {
    if (len==1) 
         if ( document.userForm.checkbox.checked==true)
             {
              n++;}
         
      if (len!=1)
      {
        if (document.userForm.checkbox[i].checked==true)
        {
          n++;    
        }}
  }   
   if (n<1)
      alert("请选择要删除的用户!");
   if (n>=1)
   {
    if(confirm('您确定要删除用户吗?'))
             {
             document.userForm.submit();
             return true;
               }
   }
  }
  
  function selectAllCheck(a)
 
   { 
     var len=<%=userInt%>;
   document.userForm.selectAll.checked=a.checked;
   for(i=0;i<len;i++)
   {
  if (len==1) document.userForm.checkbox.checked=a.checked; 
      else   document.userForm.checkbox[i].checked=a.checked;
  }        

 }
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="<%=path%>/css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="6" height="11"  background="pic/beijing.jpg"><img src="pic/tupian.jpg" width="6" height="11" /></td>
        <td background="pic/beijing.jpg"></td>
      </tr>
    </table></td>
  </tr>

  <tr>
    <td><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
      <form name="userForm" action="deluser.do">
	      <tr>
        <td height="5" ></td>
      </tr>
	      <tr>
	        <td height="18" ><table width="98%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="93"><a href="showuser.do"><img src="pic/10.jpg" width="93" height="26" border="0" /></a></td>
                <td width="2"><img src="pic/8.jpg" width="2" height="26" /></td>
                <td width="93"><img src="pic/9.jpg" width="96" height="26" border="0" /></td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      <tr>
        <td height="25" bgcolor="#73CCF7">&nbsp;
          <img src="pic/addMail.gif" width="16" height="16" align="absmiddle" /><a href="addUser.do">添加用户</a> 
               &nbsp;<img src="pic/back1.gif" width="18" height="18" align="absmiddle" /><a href="javascript:history.back();">返回</a> </td>
      </tr>
      <tr>
        <td height="1" bgcolor="#666666"></td>
      </tr>
      <tr>
        <td height="164" valign="top">
		<!--列表开始-->
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="5" colspan="19"></td>
          </tr>
          <tr class="z">
            <td width="40" height="20" align="center" bgcolor="#F2F4F6" class="bk">
              <input type="checkbox" name="selectAll" onClick="selectAllCheck(this);" />
            
            </td>
            <td width="6" align="center" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
            <td width="150" align="left" bgcolor="#F2F4F6" class="bk">用户名称</td>
            <td width="6" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
            <td width="120" align="left" bgcolor="#F2F4F6" class="bk">用户类型</td>
            <td width="6" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
            <td width="735" align="left" bgcolor="#F2F4F6" class="bk">用户权限</td>
            <td width="30" colspan="12" bgcolor="#F2F4F6" class="bk">&nbsp;</td>
            </tr>
             
            <%
             UserInfo  user = new UserInfo();
             if (page != null){
              String userType = ""; 
              List userList=pages.getList();
              userInt = userList.size();
                for (int i = 0; i < userList.size();i++){
                   user = (UserInfo)userList.get(i);
                   if (!user.getCounty().equals("0"))
                       userType = "县级用户";
                   else if(user.getCounty().equals("0") && !user.getCity().equals("0") && !user.getCity().equals("340000000000"))
                       userType = "市级用户";
                   else if (user.getCity().equals("340000000000"))
                        userType = "省级用户";
                   else  userType = user.getCityName();
                  String priStr = "";
                  if (user.getPrivilege()!= null && user.getPrivilege().length() > 0){
                 // System.out.println("privilege==="+user.getPrivilege() + "   userId====" + user.getUserId());
                   String [] priValue = user.getPrivilege().split(";");
                   for ( int j = 0; j< priValue.length;j++){
                    // int priInt = Integer.parseInt(priValue[j]);
                    // if (priInt == 1) priStr += " 开工时间 ;";
                     //if (priInt == 2) priStr += " 完工时间 ;";
                     //if (priInt == 3) priStr += " 路线信息 ;";
                    // if (priInt == 4) priStr += " 行政村类型 ;";
                      priStr += " " +City.getPrivilName(priValue[j])+" ;";
                  }
                  
                  priStr = priStr.substring(0,priStr.length()-2);
                 } 
             %>
          <tr class="z">
            <td height="25" align="center" class="bk"><input type="checkbox" name="checkbox" value="<%=user.getUserId() %>" /></td>
            <td height="25" class="bk">&nbsp;</td>
            <td height="25" class="bk"><%=user.getUserName() %>&nbsp;</td>
            <td height="25" class="bk">&nbsp;</td>
            <td height="25" class="bk"><%=userType %>&nbsp;</td>
            <td height="25" class="bk">&nbsp;</td>
            <td height="25" class="bk"><%=priStr %>&nbsp;</td>
            <td height="25" colspan="12" class="bk">&nbsp;</td>
            </tr>
          <%}}%>
		         
        </table>
		<!--列表结束-->
		</td>
      </tr>
      <tr>
        <td height="25" bgcolor="#73CCF7"><table width="100%" height="26"  border="0" cellpadding="0" cellspacing="0">
           <tr>
          
              <%
          int nextPageStart = 0;
          if (pages!=null) nextPageStart=pages.getStartOfNextPage();
          int previousPage=0;
          if (pages!=null) previousPage=pages.getStartOfPreviousPage();
          int start = 0;
           String startnum=(String)request.getAttribute("start");
           if (startnum!=null) start=Integer.parseInt(startnum);
           if (start != 0 )
             {
             posInt = start;
             userInt = start + userInt;
             }else {
                   userInt = posInt + userInt - 1;
             }
          int currentPage =  (start/rowCount)+1;
      
          int numPages = (int)Math.ceil((double)pagenum/(double)rowCount);
          if(numPages==0){
             currentPage=0;
           }
          %>
           <td height="25" align="left" bgcolor="#73CCF7">         
            <div align="left">&nbsp;共 <%=pagenum %> 条,列出第 <%=posInt %> 至 <%=userInt %> 条 &nbsp; </div></td>
        <td align="right" bgcolor="#73CCF7">
          第<font color="blue"><%=currentPage%></font>页/共<font color="blue"><%=numPages%></font>页&nbsp;&nbsp;|&nbsp;&nbsp;
          <%
             if(currentPage>1){
             
             %>
             <a href="showUserRole.do?start=0" title="第一页">首页</a>
              &nbsp;&nbsp;|&nbsp;&nbsp;
             <%}else{%>
            首页
              &nbsp;&nbsp;|&nbsp;&nbsp;
             <%}%>
             <%
              if(pages!=null&&pages.isPreviousPageAvailable()){
		      %>
		    <a href="showUserRole.do?start=<%=previousPage%>" title="上一页">上一页</a>
		     &nbsp;&nbsp;|&nbsp;&nbsp;
		     <%}
              if(nextPageStart<pagenum){
		     %>
		    <a href="showUserRole.do?start=<%=nextPageStart%>" title="下一页">下一页</a>
		    &nbsp;&nbsp;|&nbsp;&nbsp;
		    <%}
              int lastStart = rowCount*(numPages-1);
              if(currentPage<numPages&&lastStart>0){
            %>
		    <a href="showUserRole.do?start=<%=lastStart%>" title="最后一页">末页</a>
		    <%}else{%>
		     末页
		    <%}%>
		    转到 第
		    <select name="pageselect" onchange="javascrpt:pagesubmit();" >
		      <%for(int n=1;n<numPages+1;n++){%>
		         <% if(n==currentPage){%>
                  <option  value="<%=(n-1)*rowCount%>" selected><%=n%></option>
               <%}else{%>
                    <option value="<%=((n-1)*rowCount)%>"><%=n%></option>
              <%}}%>
             
            </select>
        
          页</td>
          </tr>
        </table></td>
      </tr>
</table>
  </tr>
</table>
<br>
<br>
<br>
<table width="100%" height="55"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="44"><div align="center">主办:安徽省交通厅 &copy;2005-2006版权所有 维护单位:安徽省通途信息技术有限公司
     <br><br>联系电话:<span class="font"><SPAN class=A1>0551--5397484 5397494 </SPAN></span> <br></div></td>
  </tr>
</table>
</body>
<script language="JavaScript">
function pagesubmit()
{ 
  var start=document.all.pageselect.value;
  //alert(start);
  window.location.href="showUserRole.do?start="+start;
}
</script>
</form>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -