<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.flow.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%
    //获取提交的参数
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String sPFORM = SzConvert.toZeroStr(request.getParameter("PFORM"));   
		String sType2  = SzConvert.toZeroStr(request.getParameter("type2"));	//关联的ID
		String sPKEY2  = SzConvert.toZeroStr(request.getParameter("PKEY2"));	//主表单信息ID
		String sPFORM2 = SzConvert.toZeroStr(request.getParameter("PFORM2"));	//主表单ID    
    int iFormID = SzConvert.toInt(request.getParameter("FormID"));
		String readonly = SzConvert.toSpaceStr(request.getParameter("readonly"));

    //取得表单的信息
    String moduleName = "";
    String formName = "";

%>
<%
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));	
    boolean flag = false;
    String sUrl = "relate_index.jsp";
    String sMessage = "";
    if (sOPERATOR.equals("relate")) {
    	BdRelateForm bdRelateForm = new BdRelateForm();
    	flag = bdRelateForm.relateOk(request);
    }
    sMessage = SzOut.getMessage();   
%>
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <input type="hidden" name="PFORM" value="<%=sPFORM%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="FormID" value="<%=iFormID%>">   
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="type2" value="<%=sType2%>">
  <input type="hidden" name="PKEY2" value="<%=sPKEY2%>">  
  <input type="hidden" name="PFORM2" value="<%=sPFORM2%>">   
  <input type="hidden" name="readonly" value="<%=readonly%>">   
</form>
<%    
    if (flag) {
    	if (sOPERATOR.equals("relate")) {     	        	    		
    		out.println(SzPageHelp.jsAlert("操作成功"));    		
    		out.println("<script language='javascript'>");
    		//刷新父窗口
    		out.println("var oWindow = window.dialogArguments;");
    		out.println("oWindow.document.location.reload();");
    		//关闭本窗口
    		out.println("window.close();");
    		out.println("</script>");
    		
        }
    } else {
        out.println(SzPageHelp.jsAlertBack(sMessage));
    }
%>
