<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.formCreate.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.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>
<%
    BdListSelect bdListSelect = new BdListSelect();
    int i = 0;
    int iLen = 0;
    ArrayList list = bdListSelect.getList();
  
    String sModule = SzConvert.toSpaceStr(request.getParameter("module")); 
    if (!sModule.equals("") && !sModule.endsWith(".xml")) {
    	sModule = sModule + ".xml";
    }
    BdFormControl formControl = new BdFormControl();
		boolean isFormEngine = formControl.isFormEngine(sModule);    

		String cate_pro = SzConvert.strWriteData(request.getParameter("cate_pro") );
		String cate_fun = SzConvert.strWriteData(request.getParameter("cate_fun") );
	  String moduleName = SzConvert.toSpaceStr(request.getParameter("moduleName"));
		BdFormHelp formHelp = new BdFormHelp();
		BdModule bdModule = new BdModule();	  
		ArrayList moduleList = bdModule.getModuleList(); 		
%>
<!-----上面的工具栏------>
<% if (isFormEngine) { %>
<%@ include file="/xml/formEngine2/title.jsp"%>
<% } else { %>
<%@ include file="/xml/formEngine2/simpleTitle.jsp"%>
<% } %>
<table width="100%">
  <form name="formBar" method="post">
  <tr>
    <td>
		<% if (isBarManager_SESSION) { %>    
      <input type="button" name="btnAdd" class="btnClass" value="添加" OnClick="javascript:FormSubmit(formBar, 'update.jsp?OPERATOR=add&name=');">
		<% } %>    
    	<%
    	  if (moduleList.size() > 15) {
    	  	out.print("按行业分类：");
    		out.println(formHelp.professionSelectButton("cate_pro", cate_pro, "this.form.submit()"));
    		out.print("按功能分类：");	
    		out.println(formHelp.functionSelectButton("cate_fun", cate_fun, "this.form.submit()"));
    	  }
  	  	  out.print("请选择模块：");  		
  	      out.println(SzPageHelp.selectArrayFunc(moduleList, 0, 0,1,8,"moduleName", moduleName, "txtClass200","simpleform.xml", 5, cate_pro,6, cate_fun, "this.form.submit()"));
    	%>  		  
    </td>
  </tr>
  </form>
</table>

<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">

  <tr class="trClassTitle">
    <td width="30">&nbsp;</td>  
    <td>关联名称</td>
    <td>关联说明</td>
    <td>显示的名称</td>
    <td>所属模块</td>    
    <td width="65">操作</td>
  </tr>
<%
		String temp = "";
		String str[]=null;
		BdListSelectInfo info = null;
		iLen = list.size();
		int j = 0;
    for (i=0; i<iLen; i++ ) {
    	info = (BdListSelectInfo)list.get(i);
   		if (!moduleName.equals("") && !moduleName.equals(info.getModuleName())) {
   			continue;
   		}
    	if (isFormEngine) {
    		if (info.getModuleName().equals("simpleform")) {
    			continue;
    		}
    	} else {
    		if (!info.getModuleName().equals("simpleform")) {
    			continue;
    		}    		
    	}
    	temp = info.getGLSM();
    	j++;
%>
  <tr onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
  	<td width="30" align="center"><%=j%></td>  
    <td><%=temp%>&nbsp;</td>
    <td><%=info.getGLBZ()%>&nbsp;</td>
    <td><%=info.getDisplay()%>&nbsp;</td>
    <td><%=info.getModuleName()%>&nbsp;</td>
    <td width="75">
    <% if (isBarManager_SESSION) { %>
    <a href="update.jsp?OPERATOR=update&relate=<%=temp%>">修改</a>
    <a href="#" OnClick="DeleteWin('<%=temp%>')">删除</a>
    <% } %>&nbsp;</td>
  </tr>
<%
    }
    out.println(SzPageHelp.outIndexTableTr(j, SzProperties.I_PageSize, 6));
%>
  </form>
</table>

<!-----下面的工具栏------>
<table width="100%" cellpadding="1" cellspacing="0">
  <form name="formPage" method="post">
  <tr>
    <td align="right">
      &nbsp;
    </td>
  </tr>
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
</form>
<script language="javascript" src="<%=strLevel_SESSION%>share/js/commonTool.js"></script>
<script language="javascript">
  function DeleteWin(vRelate) {
    if (confirm("确定要删除？")) {
    	//弹出窗口
    	var url = "control.jsp?OPERATOR=delete&relateName=" + vRelate;
    	//window.showModalDialog(url,window,"status=no;dialogWidth=560px;dialogHeight=670px"); 
    	//window.open(url, '',"left=200,top=20,scrollbars=yes,resizable=yes,status=no,width=570px,height=670px");
  		formBar.action = url;
    	formBar.submit();    
    	
    }          
  }
</script>
