<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.system.SzLevelNumber" %>
<%@ page import="net.sz600.organize.SzModule" %>
<%@ page import="net.sz600.organize.SzModuleInfo" %>
<%@ page import="net.sz600.organize.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //获取提交的参数
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));

    //读取数据
    SzModule szModule = new SzModule();
    SzModuleInfo szModuleInfo = null;
    String sCond = "1=1";
    String sSortField = "MKBH";
    int iSortOrder = SzProperties.I_SortOrder_ASC;
    int iCurrentPage = 1;
    try {
        iCurrentPage =  Integer.parseInt(sPage);
    }catch(Exception e) {
    }
    Iterator iter = szModule.getArrayList(sCond, sSortField, iSortOrder, iCurrentPage, sSearch).iterator();
    SzPageInfo pageInfo = szModule.getPageInfo();
    int iPageCount = pageInfo.getPageCount();
    int iRecordCount = pageInfo.getRecordCount();
    iCurrentPage = pageInfo.getCurrentPage();
    int i = 0;
%>
<!-----上面的工具栏------>
<%@ include file="/share/title.jsp" %>
<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">
  <input type="hidden" name="page" value="<%=iCurrentPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <tr class="trClassTitle">
    <td width="5"><input type="checkbox" name="chkCheckAll" OnClick="javascript:CheckAll(formList, chkCheckAll, 'chkId');"></td>
    <td>模块名称</td>
    <td>已分配权限</td>
    <td width="40">操作</td>
  </tr>
<%
    SzPopedom szPopedom = new SzPopedom();
    SzPopedomInfo szPopedomInfo = null;
    Iterator iterPopedom = null;
%>
  <tr>
    <td width="5"><input type="checkbox" name="chkId" id="chkId" value="">&nbsp;</td>
    <td valign="top">[整个系统]&nbsp;</td>
    <td><%=szPopedom.getPopedomInfoByModule(0)%>&nbsp;</td>
    <td>
      <a href="javascript:FormSubmit(formPage,'control.jsp?OPERATOR=deleteByModule&KEY=0');">删除权限</a>
    </td>
  </tr>
<%
    while (iter != null && iter.hasNext()) {
        szModuleInfo = (SzModuleInfo)iter.next();
        i++;
%>
  <tr  onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <td width="5"><input type="checkbox" name="chkId" id="chkId" value="<%=szModuleInfo.getMKBH()%>">&nbsp;</td>
    <td valign="top"><%=SzLevelNumber.getLevelSpace(szModuleInfo.getMKBH())%><%=szModuleInfo.getMKMC()%>&nbsp;</td>
    <td><%=szPopedom.getPopedomInfoByModule(szModuleInfo.getMKID())%>&nbsp;</td>
    <td>
      <% if (isSystemManager_SESSION) { %>
      <a href="javascript:FormSubmit(formPage,'control.jsp?OPERATOR=deleteByModule&KEY=<%=szModuleInfo.getMKID()%>');">删除权限</a>
      <% } %>
    </td>
  </tr>
<%
    }
    out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, 4));
%>

  </form>
</table>

<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
  <tr>
    <td align="right">
      <!----翻页---->
      <% if (iCurrentPage>1) { %>
      <a href="javascript:FormSubmit(formPage,'index_module.jsp?page=1');">首页</a>
      <a href="javascript:FormSubmit(formPage,'index_module.jsp?page=<%=iCurrentPage-1%>');">上页</a>
      <% }%>
      <% if (iCurrentPage<iPageCount) { %>
      <a href="javascript:FormSubmit(formPage,'index_module.jsp?page=<%=iCurrentPage+1%>');">下页</a>
      <a href="javascript:FormSubmit(formPage,'index_module.jsp?page=<%=iPageCount%>');">尾页</a>
      <% } %>
      第<input type="text" name="page" class="txtClassPage" value="<%=iCurrentPage%>" size="2">页
      <input type="button" name="btnGoPage" class="btnClass" value="确定" OnClick="javascript:FormSubmit(formPage,'index_module.jsp');">
      共&nbsp;<%=iPageCount%>&nbsp;页/共&nbsp;<%=iRecordCount%>&nbsp;记录&nbsp;
      <!----快速查找---->
      <input type="text" name="txtSearch" class="txtClassSearch" value="<%=sSearch%>" size="10">
      <input type="button" name="btnSearch"  class="btnClass" value="快速查找" OnClick="javascript:FormSubmit(formPage,'index_module.jsp');">&nbsp;
    </td>
  </tr>
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
