<%@ 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.dbforeign.*" %>
<%@ page import="net.sz600.formEngine2.*" %>

<%@ 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>
<%  
	
	SQLReadSelectXML readSelectXML = new SQLReadSelectXML();
    int i = 0;
    Map map = readSelectXML.getTableFromXML();
   	//out.print(map.size());
    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();
		
%>
<!-----上面的工具栏------>
<%@ include file="../../share/title.jsp"%>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<table width="100%">
  <tr>
    <td>
      <input type="button" value="添加" onClick="javascript:FormSubmit(formList, 'foreign_sql_update.jsp?OPERATOR=add');";  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>
<%
boolean isFormEngine = formControl.isFormEngine(sModule);    
	String temp = "";
	String chaxun= "";
	SQLSelectDBinfo bdSelectTableInfo = new SQLSelectDBinfo();
   while (iter != null && iter.hasNext()) {
   	bdSelectTableInfo = (SQLSelectDBinfo)iter.next();
   
   	temp = bdSelectTableInfo.getRelateName();
   	chaxun = bdSelectTableInfo.getCX();
%>
  <tr onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <td><a href="#" OnClick="javascript:FormSubmit(formList, 'foreign_sql_update.jsp?OPERATOR=add&relate=<%=chaxun %>');"><%=chaxun%></a>&nbsp;</td>
    <td><%=bdSelectTableInfo.getRelateDesc()%>&nbsp;</td>
    <td>
    
    <a href="#" OnClick="DeleteWin('<%=chaxun%>')">删除</a> | 
    <a href="../../share/foreign/index.jsp?moduleName=simpleform.xml&relateName=<%=temp %>&chaxun=<%=chaxun %>">测试</a>

   
    </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>

<script language="javascript">
  function DeleteWin(vRelate) {
    if (confirm("确定要删除？")){
    	//弹出窗口
    	var url = "foreign_sql_control.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>
