<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.collectionengine.*" %>
<%@ page import = "zr.zrpower.collectionengine.service.ConfigService"%>
<%@ page import = "zr.zrpower.dbmanage.service.FieldService"%>

<%@ page import = "java.lang.Object"%>

<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
ConfigService BaseReply = new ConfigService();
FieldService TableField = new FieldService();
String type=request.getParameter("SelectedItems");
CollectionInfo configs = BaseReply.getInfoID(type);
String strID = "";
if (configs!=null)
{
    strID = configs.getID();
}

%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<LINK type="text/css" rel="stylesheet" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>">
<%if("6".equals(user.getUserWINDOWTYPE())){ %>
<LINK type="text/css" rel="stylesheet" href="../../../zrsysmanage/html5/css/style_tables.css">
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/layer/layer.js"></SCRIPT>
<%}%>
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/Public.js"></SCRIPT>
<script language="JavaScript" type="text/JavaScript">
<!--
function gridEditRow()
{
  window.location.href ="Edit.jsp?SelectedItems=<%=type%>";
}
function gridReload()
{
  window.location.href ="Reload.jsp?SelectedItems=<%=type%>";
}
function Delete(){
  <%if("6".equals(user.getUserWINDOWTYPE())){%>
     layer.confirm('是否真的要删除当前选中行吗？', {
      btn: ['确定','取消'] //按钮
      }, function(index){
         location.href="../../../actionsubconfigmsg.do?Act=del1&ID=<%=type%>";
         //parent.layer.closeAll()
      }, function(){
      });
  <%}else{%>
     if (confirm('是否真的要删除当前选中行吗？')){
        location.href="../../../actionsubconfigmsg.do?Act=del1&ID=<%=type%>";
     }
     <%}%>
 }
function bak()
{
  window.location.href='../MainConfig/List.jsp';
}

function setfield()
{

  <%if("6".equals(user.getUserWINDOWTYPE())){%>
  layer.open({
  type: 2,
  title:'设置字段属性',
  area: ['860px', '480px'],
  fix: false, //不固定
  maxmin: false,//是否可以最大化
  content: 'setfield.jsp?ID=<%=strID%>'
});
  <%}else{%>
  var name="PopWindow";
  var ShowPopWindow = null;
  var status="toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=800,height=460";
  ShowPopWindow = window.open("setfield.jsp?ID=<%=strID%>",name,status);
  ShowPopWindow.moveTo(200,100);
  ShowPopWindow.focus();
  <%}%>
}
//生成默认模板---
function STEMPLAET()
{
  var TEMPLAET = document.RegForm.TEMPLAET.value;
  //

  if (TEMPLAET.length>0)
  {
     <%if("6".equals(user.getUserWINDOWTYPE())){ %>
        layer.alert('此自定义表单已经有模板，不能生成默认模板。', {icon: 7});
    <%}else{%>
        alert("此自定义表单已经有模板，不能生成默认模板。");
    <%}%>

  }else
  {
    <%if("6".equals(user.getUserWINDOWTYPE())){%>
        var ID = document.RegForm.ID.value;
        layer.open({
        type: 2,
        area: ['900px', '550px'],
        fix: false, //不固定
        maxmin: false,//是否可以最大化
        content: 'getTemplaet.jsp?ID='+ID
      });

    <%}else{%>
      var ID = document.RegForm.ID.value;
      var name="TEMPLAET";
      var ShowPopWindow = null;
      var status="toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=900,height=620";
      ShowPopWindow = window.open("getTemplaet.jsp?ID="+ID,name,status);
      ShowPopWindow.moveTo(10,10);
      ShowPopWindow.focus();
      <%}%>
  }
}

//-->
</SCRIPT>
</HEAD>

<BODY class="BodyMain">
<form action="" method="post" name="RegForm">
<input type="hidden" name="TEMPLAET" value="<%=configs.getTEMPLAET()%>">
<input type="hidden" name="ID" value="<%=configs.getID()%>">
<DIV id="divMessage" style='padding-left:0px;padding-top:0;width:100%;height:100%;overflow:auto'>

      <br>&nbsp;
      <fieldset style="width: 98%;padding-left:10px;">
      <legend>文档详细配置情况</legend>

      <table width="766" border="0" cellpadding="3" style="border-collapse: collapse;">
          <tr>
            <td  width="20%" align="right">文档配置编号：</td>
            <td width="168"><%=configs.getID()%></td>
            <td width="20%" align="right">文档配置名称：</td>
            <td width="170"><%=configs.getDOCNAME()%></td>
          </tr>
         <tr>
            <td align="right">模板：</td>
            <td width="168"><%=configs.getTEMPLAET()%><a href="../../../serverfile.do?type=4&file=<%=configs.getTEMPLAET()%>" title="点击下载模板">[<font color="#000080">下载模板</font>]</a></td>
            <td align="right"></td>
            <td width="170"></td>
          </tr>
          <tr>
            <td align="right">绑定数据表：</td>
            <td width="168"><%=TableField.GetTableCHINESENAME(configs.getMAINTABLE())%></td>
            <td align="right">关联主键：</td>
            <td width="170"><%=TableField.GetFieldCHINESENAME(configs.getOTHERFIELD())%></td>
          </tr>

           <tr>
            <td colspan="4" align="center">
            <center><br>
          <table cellspacing="0" cellpadding="0" border='0'><tr>
            <%=userUI.ClickButton("修改配置","JavaScript:gridEditRow();","IcoEdit.gif",user.getUserImage())%>
            <%=userUI.ClickButton("上传模板","JavaScript:gridReload();","IcoRelease.gif",user.getUserImage())%>
            <%=userUI.ClickButton("生成默认模板","JavaScript:STEMPLAET();","buttonBrowse.gif",user.getUserImage())%>
            <%=userUI.ClickButton("设置字段属性","JavaScript:setfield();","buttonSure.gif",user.getUserImage())%>
            <%=userUI.ClickButton("删除配置","JavaScript:Delete();","buttonDelete.gif",user.getUserImage())%>
         </tr></table>
                 <br>
                 </center>

           </tr>
          </table>
      </fieldset>
<br>&nbsp;
      <fieldset style="width: 98%;padding-left:10px;" >
      <legend>打印模板配置</legend>

      <table width="766" border="0" cellpadding="0" style="border-collapse: collapse;">
          <tr>
          <td align="center" width="766" height="220">
          <%if("6".equals(user.getUserWINDOWTYPE())){ %>
           <iframe id=List name=List src="../PrintConfig/IndexPrint.jsp?ID=<%=type%>" border=0 frameborder=0 width=100% height=98%></iframe>

          <%}else{ %>
          <iframe id=List name=List src="../PrintConfig/IndexPrint.jsp?ID=<%=type%>" border=0 frameborder=1 width=100% height=98%></iframe>

          <%} %>
          </td>

         </tr>
          </table>
      </fieldset>
      <br>&nbsp;

      <center><br>
         <table cellspacing="0" cellpadding="0" border='0'><tr>
             <%=userUI.ClickButton("返回","JavaScript:bak();","buttonReturn.gif",user.getUserImage())%>
         </tr></table>
      </center>
      <br>
</div>

</form>
</body>
</html>
<%
//清空相关对象
user = null;
userUI = null;
configs = null;
BaseReply = null;
TableField = null;
%>
