<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.util.*,java.sql.*,DBstep.iDBManager2000.*" %>
<%@ include file="/sessionInfo.jsp"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<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/weboffice/title.jsp"%>
<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';")); %>    
    </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 width="40">操作</td>
  </tr>
<%
  DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000();
  if (DbaObj.OpenConnection())
  {
    try
    {
      ResultSet result=DbaObj.ExecuteQuery("Select RecordID,FileName,FileType,Descript From Template_File WHERE GSID=" + szCOMPANY_SESSION + " order by TemplateID desc") ;
      while ( result.next() )
      {
        String mRecordID=result.getString("RecordID");
        String mFileName=result.getString("FileName");
        String mFileType=result.getString("FileType");
        String mDescript=result.getString("Descript");
%>
	<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" width=148 nowrap>
		  <%=SzPageHelp.button("修改","javascript:location.href='TemplateEdit.jsp?RecordID=" + mRecordID + "&FileType=" + mFileType + "';") %>
		  <%=SzPageHelp.button("删除","javascript:ConfirmDel('TemplateDel.jsp?RecordID=" + mRecordID + "');") %>		  		 
		</td>
	</tr>
<%
      }
      result.close() ;
    }
    catch(Exception e)
    {
      System.out.println(e.toString());
    }
    DbaObj.CloseConnection() ;
  }
  else
  {
    out.println("OpenDatabase Error") ;
  }
%>
</table>
</body>
</html>
