<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ include file="../sessionInfo2.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    BdReadSelectXML3 readSelectXML3 = new BdReadSelectXML3();
    int i = 0;
    Map map = readSelectXML3.getTableFromXML();
    Collection coll = null;
    if (map != null) {
    	coll = map.values();
    }
    Iterator iter = null;
    if (coll != null) {
    	iter = coll.iterator();
    }
  
    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);    
%>
<!-----上面的工具栏------>
<% if (isFormEngine) { %>
<%@ include file="/xml/formEngine2/title.jsp"%>
<% } else { %>
<%@ include file="/xml/formEngine2/simpleTitle.jsp"%>
<% } %>
<table width="100%">
  <tr>
    <td>
<% if (isBarManager_SESSION) { %>    
      <input type="button" value="添加" onClick="AddWin('');";  class="btnClass">
<% } %>      
    </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>关联名称</td>
    <td>关联说明</td>
    <td width="40">操作</td>
  </tr>
<%
    String temp = "";
    BdSelectTableInfo3 bdSelectTableInfo3 = new BdSelectTableInfo3();
    while (iter != null && iter.hasNext()) {
    	bdSelectTableInfo3 = (BdSelectTableInfo3)iter.next();
    	if (isFormEngine) {
    		if (bdSelectTableInfo3.getModuleName().equals("simpleform")) {
    			continue;
    		}
    	} else {
    		if (!bdSelectTableInfo3.getModuleName().equals("simpleform")) {
    			continue;
    		}    		
    	}
    	temp = bdSelectTableInfo3.getGLSM();
    	
%>
  <tr onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <td><a href="#" OnClick="AddWin('<%=temp%>')"><%=temp%></a>&nbsp;</td>
    <td><%= bdSelectTableInfo3.getGLBZ()%>&nbsp;</td>
    <td>
    <% if (isBarManager_SESSION) { %>
    <a href="#" OnClick="DeleteWin('<%=temp%>')">删除</a>
    <% } %>&nbsp;</td>
  </tr>
<%
    }
    out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, 3));
%>
  </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">
  function AddWin(vRelate) {
    //弹出窗口
    var url = "formSelect3.jsp?OPERATOR=add&relate=" + 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");      
  }
  
  function DeleteWin(vRelate) {
    if (confirm("确定要删除？")) {
    	//弹出窗口
    	var url = "formSelectOk3.jsp?OPERATOR=delete2&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");
    }          
  }
</script>