<%@ page contentType="text/html; charset=GBK"  errorPage="../../../error.jsp" %>
<%@ page import = "zr.zrpower.collectionengine.service.ConfigService"%>

<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.common.web.SelectBox" %>
<%@ page import = "zr.zrpower.collectionengine.CollectionInfo" %>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "java.util.*" %>
<%@ page import = "java.text.*" %>
<%
ConfigService configManage = new ConfigService();
UIService userUI =new UIService();
SessionUser user = (SessionUser)session.getAttribute("userinfo");
String ID=request.getParameter("SelectedItems");
CollectionInfo[] bg=configManage.allListConfig(ID.trim());
SelectBox sb = new SelectBox(configManage.getTableList());
String[][] fields = configManage.getFieldList1(bg[0].getMAINTABLE());
SelectBox sb1 = new SelectBox(fields);
%>
<HTML>
<HEAD>
<TITLE>文档配置编辑</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK type="text/css" rel="stylesheet" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/Public.js"></SCRIPT>
<script type='text/javascript' src='../../../dwr/engine.js'></script>
<script type='text/javascript' src='../../../dwr/util.js'></script>
<script type='text/javascript' src='../../../dwr/interface/CollConfigBean.js'></script>
<script language="JavaScript" type="text/javascript">
<!--
 // 加载字段下拉列表。

function bak()
{
  window.location.href='MainInfo.jsp?SelectedItems=<%=bg[0].getID()%>';
}
//有效性检察
function Check(theForm){
if (theForm.TEMPLAET.value == "")
      {
       
       <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('请选择要上传的模板文件!', {icon: 7});
    <%}else{%>
    alert("请选择要上传的模板文件！");
    theForm.TEMPLAET.focus();
       return false;
    <%}%>
       
       }
 if(!(((theForm.TEMPLAET.value.toLowerCase()).indexOf(".") > 0)&&(theForm.TEMPLAET.value.toLowerCase()).indexOf(":") > 0))
		{
		  
		  <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('模板文件格式不正确，请点击浏览上传正确的文件!', {icon: 7});
    <%}else{%>
    alert("模板文件格式不正确，请点击浏览上传正确的文件");
    theForm.TEMPLAET.focus();
		  return false;
    <%}%>
		  
		}
     document.form1.submit();  
}
//-->
</script>
</HEAD>
<BODY class="BodyMain">
<form action="../../../actionconfigmsg.do" method="post" name="form1" enctype="multipart/form-data" onsubmit="return Check(this);">
<%
if(bg!=null)
{
  %>
<input type="hidden" name="ID" value='<%=ID%>' />
<input type="hidden" name="DOCTYPE_VALUE" value=""/>
<!--HTML Head表单头显示[显示内容，用户肤色的图片文件夹]-->
<%=userUI.ShowHeadHtml("文档配置管理",user.getUserImage())%>
<!--HTML Body Start显示表单开始部分-->
<%=userUI.ShowBodyStartHtml()%>
<DIV id="divMessage" style='padding-left:0;padding-top:0;width:99%;height:100%;overflow:auto'>
           <br>&nbsp;
           <fieldset style="width: 98%">
           <legend>文档配置上传模板</legend>
           <TABLE  width="100%" align="center" border="0">
            <TR>
             <TD colspan=2 height=5>
             <input class="input" type="hidden" name="Act" value="reload" />
             </TD>
              <TR>
               <TD class="PutdSet" width="14%">模板：</td>
               <TD><input name="TEMPLAET" type="file" class="text" id="TEMPLAET" size="79"  maxlength="200" ></td>
             </TR>
            </TABLE>
          <br>
          </fieldset>
               <center><br>
                 <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("保存","JavaScript:Check(document.form1)","buttonSave.gif",user.getUserImage())%>
                 <%=userUI.ClickButton("返回","JavaScript:bak();","buttonReturn.gif",user.getUserImage())%>
                 </tr></table>
                 <br>
                 </center>
  </DIV>

<!--HTML Foot显示表单尾-->
<%=userUI.ShowFootHtml()%>
  <%
}
%>
</FORM>
</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
configManage = null;
bg = null;
sb = null;
fields = null;
sb1 = null;
%>
