<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzLevelNumber" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.flow.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.weboffice.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
   int i = 0;
   OfficePrintTemp officePrintTemp = new OfficePrintTemp(0);
   Collection collTemp = officePrintTemp.getTemplateList(); 
   Iterator iterTemp = null;
   if (collTemp != null) {
	   iterTemp = collTemp.iterator();
   }
   OfficeTemplate officeTemplate = null;

		String cate_pro = SzConvert.strWriteData(request.getParameter("cate_pro") );
		String cate_fun = SzConvert.strWriteData(request.getParameter("cate_fun") );
	  String moduleName = SzConvert.toSpaceStr(request.getParameter("moduleName"));
		BdFormHelp formHelp = new BdFormHelp();
		BdModule bdModule = new BdModule();	  
		ArrayList moduleList = bdModule.getModuleList();   
%>
<!-----上面的工具栏------>
<%@ include file="/xml/formEngine2/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <tr>
    <td>    
    <%
    	out.println(SzPageHelp.addButton(isBarManager_SESSION));
    %>
    	<%
    	  if (moduleList.size() > 15) {
    	  	out.print("按行业分类：");
    		out.println(formHelp.professionSelectButton("cate_pro", cate_pro, "this.form.submit()"));
    		out.print("按功能分类：");	
    		out.println(formHelp.functionSelectButton("cate_fun", cate_fun, "this.form.submit()"));
    	  }
  	  	  out.print("请选择模块：");  		
  	      out.println(SzPageHelp.selectArrayFunc(moduleList, 0, 0,1,8,"moduleName", moduleName, "txtClass200","simpleform.xml", 5, cate_pro,6, cate_fun, "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 width="30">&nbsp;</td>  
    <td>名称</td>
    <td>说明</td>
    <td>模板文件</td>
    <td>所属模块</td>
    <td>操作</td>
  </tr>
<%
  String name = "";
  String path = "";
  String moduleName2 = "";
  while (iterTemp.hasNext()) {
	  officeTemplate = (OfficeTemplate)iterTemp.next();
	  name = officeTemplate.getAttrs().get("name");
	  path = officeTemplate.getAttrs().get("path");
	  moduleName2 = SzConvert.toSpaceStr(officeTemplate.getAttrs().get("moduleName"));
 		if (!moduleName.equals("") && !moduleName.equals(moduleName2)) {
 			continue;
 		}	  
	  i++;
%>
  <tr  onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
  	<td width="30" align="center"><%=i%></td>  
    <td><%=name%>&nbsp;</td>
    <td><%=officeTemplate.getAttrs().get("desc")%>&nbsp;</td>
    <td title="输出文件夹：<%=officeTemplate.getAttrs().get("saveDir")%>"><%=path%>&nbsp;</td>
    <td><%=moduleName2%>&nbsp;</td>
    <td>  
    <% if (isBarManager_SESSION) { %> 
      <a href="javascript:document.location.href='update.jsp?OPERATOR=update&name=<%=name%>'">修改</a>
      <a href="javascript:DeleteCheck('<%=name%>');">删除</a>
      <a href="javascript:document.location.href='updateBlock.jsp?OPERATOR=updateBlock&type=GW&name=<%=name%>';">正文</a>
      <a href="javascript:document.location.href='updateBlock.jsp?OPERATOR=updateBlock&type=FJ&name=<%=name%>';">附件</a>
      <a href="javascript:document.location.href='updateBlock.jsp?OPERATOR=updateBlock&type=QZ&name=<%=name%>';">签名</a>
      <a href="javascript:document.location.href='updateBlock.jsp?OPERATOR=updateBlock&type=MX&name=<%=name%>';">明细</a>
      <a href="javascript:document.location.href='updateBlock.jsp?OPERATOR=updateBlock&type=TJ&name=<%=name%>';">条件</a>
      <a href="../../../share/weboffice/template/TemplateEdit.jsp?module=<%=moduleName2%>&FileType=.doc&FilePath=<%=path%>">[编辑模板]</a>
    <% } %>
    </td>    
  </tr>
<%		
  }
  out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, 6));
%>
  </form>  
</table>  

<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">

  </form>
</table>
<script language="javascript" src="<%=strLevel_SESSION%>share/js/commonTool.js"></script>
<script language="javascript">
  function DeleteCheck(name) {
  	if (confirm("删除将不能恢复,是否继续?")) {
  		document.location.href="control.jsp?OPERATOR=delete&name=" + name; 
  	}
  }
  function EditCheck(path) {
  	var url = "control.jsp?OPERATOR=edit&path=" + path;
    window.open(url, '', 'left=20,top=20,scrollbars=yes,resizable=yes,status=yes,width=1000,height=720');    
  }
</script>
