posts - 167,  comments - 30,  trackbacks - 0
  1<%@ page language="java" pageEncoding="GBK"%>
  2<%@page import="java.util.List"%>
  3<%@page import="com.cns.certservice.vo.PrivilegeInfoView"%>
  4<%@page import="com.cns.certservice.vo.UserPriInfoView"%>
  5<%@page import="java.util.HashMap"%>
  6<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
  7<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
  8<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
  9<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 10<html xmlns="http://www.w3.org/1999/xhtml">
 11    <head>
 12        <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
 13        <title>iPASS解锁</title>
 14        <link href="<%=request.getContextPath()%>/styles/styles.css"
 15            rel="stylesheet" type="text/css" />
 16        <script src="<%=request.getContextPath()%>/js/CCITCertCtrl.js"></script>
 17        <script src="<%=request.getContextPath()%>/js/ccitenrl.js"></script>
 18        <script src="<%=request.getContextPath()%>/js/jquery.js"></script>
 19        <script type="text/javascript"
 20            src="<%=request.getContextPath()%>/js/validator.js" charset="gb2312"></script>
 21        <style type="text/css">
 22<!--
 23.STYLE1 {
 24    color: #FF0000
 25}

 26
 27.STYLE2 {
 28    color: #000033
 29}

 30-->
 31</style>
 32        <script language="javaScript">
 33 function checkAll(str,flag)
 34 {
 35    var n = flag; //获取复选框的个数
 36    for (var i=0; i<n; i++){
 37    document.forms(1)(str)[i].checked = window.event.srcElement.checked;
 38     }
//通过单击的按钮判断是选中还是未选
 39  }

 40  function queryCheck(){
 41   var usercode = (document.forms(0).userCode.value).Trim();
 42           if(usercode.length == 0){
 43                 alert('请输入员工工号');
 44                 document.forms(0).userCode.focus();
 45                 return false;
 46            }
else{
 47                    if(!IsNum(usercode)){
 48                         alert('请输入正确的员工工号\r格式如:12345678');
 49                         document.forms(0).userCode.focus();
 50                         return false;
 51                    }

 52                    if(usercode.length != 8){
 53                          alert('员工工号长度必须为8位');
 54                          document.forms(0).userCode.focus();
 55                          return false;
 56                    }

 57            }

 58            return true;
 59  }

 60  
 61  
 62function submitForm1()
 63{
 64        var usercode = (document.forms(0).userCode.value).Trim();
 65        var agentcode = (document.forms(1).agentCode.value).Trim();
 66        var agenttype = (document.forms(1).agentType.value);
 67            if(usercode.length == 0){
 68                 alert('请输入员工工号!');
 69                 document.forms(0).userCode.focus();
 70                 return false;
 71            }
else{
 72                    if(!IsNum(usercode)){
 73                         alert('请输入正确的员工工号!\r格式如:12345678');
 74                         document.forms(0).userCode.focus();
 75                         return false;
 76                    }

 77                    if(usercode.length != 8){
 78                          alert('员工工号长度必须为8位!');
 79                          document.forms(0).userCode.focus();
 80                          return false;
 81                    }

 82            }

 83             if(agentcode.length == 0){
 84                 alert('请输入渠道编号!');
 85                 document.forms(1).agentcode.focus();
 86                 return false;
 87             }
else{
 88                if(!IsNum(agentcode)){
 89                 alert('请输入正确的渠道编号!');
 90                 document.forms(1).agentcode.focus();
 91                 return false;
 92                 }

 93             }

 94             if(agenttype == "0"){
 95                 alert('请选择渠道类型!');
 96                 document.forms(1).agentType.focus();
 97                 return false;
 98             }

 99      document.forms(1).action="<%=request.getContextPath()%>/PriInfoMgr.do?userCode="+usercode;
100      document.forms(1).submit();
101}

102</script>
103    </head>
104    <body>
105        <div class="c_content">
106            <div class="e_title">
107                权限管理
108            </div>
109            <div align="center">
110            <html:form action="/queryPriInfoList.do" method="post"
111                onsubmit="return queryCheck()">
112                <table align="center" width="100%">
113                    <tr>
114                        <td align="left">
115                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
116                            员工工号:
117                            <html:text property="userCode" maxlength="8" />
118                            <span class="STYLE1"> * </span>
119                            <input type="submit" name="button3" value="查询" />
120                            &nbsp;&nbsp;&nbsp;&nbsp;
121                            <span class="STYLE1"> (请输入要设置权限的员工工号,点击'查询'</span>
122                        </td>
123                    </tr>
124                </table>
125            </html:form>
126            <logic:present name="priInfo">
127                <form action="" method="post">
128                    <table align="center" width="100%">
129                        <%
130                            UserPriInfoView priView = (UserPriInfoView) request.getAttribute("priInfo");
131                            @SuppressWarnings("unchecked")
132                            List<PrivilegeInfoView> privilegeList = (List<PrivilegeInfoView>) request.getAttribute("privilegeList");
133                            HashMap<String,String> map = (HashMap<String,String>) priView.getHashMap();
134                            %>
135                        <tr>
136                            <td align="left">
137                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
138                                渠道编号:
139                                <input name="agentCode" size="15" type="text" maxlength="8"
140                                    value="<%=priView.getAgentCode()%>" />
141                                <span class="STYLE1"> * </span>
142                            </td>
143                        </tr>
144                        <tr>
145                            <td align="left">
146                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
147                                渠道类型:
148                                <select name="agentType" style="width: 75px">
149                                    <option value="0">
150                                        -请选择-
151                                    </option>
152                                    <option value="1">
153                                        自有渠道
154                                    </option>
155                                    <option value="2">
156                                        社会渠道
157                                    </option>
158                                </select>
159                                <span class="STYLE1"> * </span>
160                            </td>
161                        </tr>
162                        <tr>
163                            <td align="left">
164                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
165                                <%
166                                    if (map.size() == privilegeList.size()) {
167                                %>
168                                <input type="checkbox" id="selectAll" checked="checked"
169                                    onclick="checkAll('priItem',document.forms(1).prilength.value)" />
170                                <%
171                                    }
 else {
172                                %>
173                                <input type="checkbox" id="selectAll"
174                                    onclick="checkAll('priItem',document.forms(1).prilength.value)" />
175                                <%
176                                    }

177                                %>
178                                <label for="selectAll">
179                                    全选
180                                </label>
181                            </td>
182                        </tr>
183                        <tr>
184                            <td align="left">
185                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
186                                <%
187                                    int flag = 0//记录权限列表的个数
188                                        for (PrivilegeInfoView view : privilegeList) {
189                                            boolean check = false;//权限check标识
190                                            if (map.containsKey(view.getPid())) {
191                                                check = true;
192                                            }

193                                %>
194                                <input type="checkbox" value="<%=view.getPid()%>"
195                                    <%if(check)%> checked="checked" <%} %> name="priItem" />
196                                <%=view.getPname()%>
197                                <%
198                                    flag++;
199                                        }

200                                %>
201                                <input type="hidden" name="prilength" value="<%=flag%>" />
202                            </td>
203                        </tr>
204                        <tr>
205                            <td style="width: 600px">
206                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
207                                <input type="button" name="update" value="确定"
208                                    onclick="return submitForm1()" />
209                            </td>
210                        </tr>
211                    </table>
212                </form>
213            </logic:present>
214            </div>
215        </div>
216        <p>
217            &nbsp;
218        </p>
219    </body>
220</html>
221
posted on 2009-08-28 14:19 David1228 阅读(780) 评论(0)  编辑  收藏 所属分类: JSP、servlet

<2009年8月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

常用链接

留言簿(4)

随笔分类

随笔档案

文章档案

新闻分类

新闻档案

相册

收藏夹

Java

Linux知识相关

Spring相关

云计算/Linux/虚拟化技术/

友情博客

多线程并发编程

开源技术

持久层技术相关

搜索

  •  

积分与排名

  • 积分 - 356781
  • 排名 - 154

最新评论

阅读排行榜

评论排行榜