<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.*,java.sql.*" %>
<%@ page import="net.sz600.weboffice.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ include file="/sessionInfo.jsp"%>
<html>
<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">
<script language="javascript">
function ConfirmDel(FileUrl){
	if (confirm('是否确定删除该模板！')){
		location.href=FileUrl;
	}
}
</script>
</head>
<body bgcolor="#ffffff">
<%@ include file="/share/title.jsp"%>
<%
	String sBDID= SzConvert.toZeroStr(request.getParameter("BDID"));
%>
<table width="100%">
  <form name="formBar" method="post">
  <tr>
    <td>
    <% out.println(SzPageHelp.button("word模板","javascript:location.href='TemplateEdit.jsp?FileType=.doc';")); %>
    <% out.println(SzPageHelp.button("excel模板","javascript:location.href='TemplateEdit.jsp?FileType=.xls';")); %>
  <%	 
  BdFormControl formControl = new BdFormControl();
	ArrayList listForm = formControl.getFormArrayhasWord();
  out.println(SzPageHelp.selectArrayList(listForm,"BDID", sBDID, "所属表单", "txtClass1", "this.form.submit()"));
  %>        
    </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>模板类型</td>
    <td>模板说明</td>
    <td>所属表单</td>
    <td width="40">操作</td>
  </tr>
<%
	iTemplate template = new iTemplate();
	String mRecordID = "";
	String mFileName = "";
	String mFileType = "";
	String mDescript = "";
	int BDID = 0;
	ArrayList list = template.getList(szCOMPANY_SESSION, sBDID);
	//BdFormControl formControl = new BdFormControl();
  if (list != null) {
	  Iterator iter = list.iterator();
	  String s_info[] = null;
	  while (iter.hasNext()) {
		  s_info = (String[])iter.next();
		  if (s_info == null) {
			  continue;
		  }
		  mRecordID = s_info[0];
		  mFileName = s_info[1];
		  mFileType = s_info[2];
		  mDescript = s_info[3];
		  BDID = SzConvert.toInt(s_info[4]);

%>
	<tr>
		<td class="TDStyle"><%=mRecordID%>&nbsp;</td>
		<td class="TDStyle"><%=mFileName%>&nbsp;</td>
		<td class="TDStyle"><%=mFileType%>&nbsp;</td>
		<td class="TDStyle"><%=mDescript%>&nbsp;</td>
		<td class="TDStyle"><%=formControl.getFormDesc(BDID)%>&nbsp;</td>
		<td class="TDStyle" width=148 nowrap>
		  <%=SzPageHelp.button("修改","javascript:location.href='TemplateEdit.jsp?RecordID=" + mRecordID + "&FileType=" + mFileType + "';") %>
		  <%=SzPageHelp.button("删除","javascript:ConfirmDel('TemplateDel.jsp?RecordID=" + mRecordID + "');") %>		  		 
		</td>
	</tr>
<%

    }
  }
%>
</table>
</body>
</html>
