<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="java.util.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.jsp"%>
<%
    //strLevel_SESSION = "../../../";
    //strSkin_SESSION = "../../../images/skin2_blue2";
%>
<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">
</head>

<%
    BdModule bdModule = new BdModule();
    int i = 0;
    int iLen = 0;
    ArrayList list = bdModule.getModuleList();
    
		String cate_pro = SzConvert.strWriteData(request.getParameter("cate_pro") );
		String cate_fun = SzConvert.strWriteData(request.getParameter("cate_fun") );
		
		BdFormHelp formHelp = new BdFormHelp();
%>
<!-----上面的工具栏------>
<%@ include file="/xml/formEngine2/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <input type="hidden" name="name" value="">
  <input type="hidden" name="module" value="">
  <tr>
    <td>
    <%
    	out.println(SzPageHelp.addButton(isBarManager_SESSION));
    %>
      按行业分类：
    	<%
    		out.println(formHelp.professionSelectButton("cate_pro", cate_pro, "this.form.submit()"));
    	%>      
      按功能分类：
    	<%    		
    		out.println(formHelp.functionSelectButton("cate_fun", cate_fun, "this.form.submit()"));
    	%>    
     <% if (isBarManager_SESSION && isSystemManager_SESSION) { %>        
     <!-- 
      <input type="button" class="btnClass120" value="初始化表单数据" title="重新创建所有表,数据将全部丢失" 
       OnClick="javascript:GoUrlConfirm('../formControl.jsp?OPERATOR=Initial','重新创建所有表,所有表单数据将清空，是否继续？','divLine');" >
      -->
	  <input type="button" class="btnClass120" value="检测异常并修复" title="检查丢失的字段和表,自动修复;检查ID的冲突,自动修复,可能要修改系统菜单的路径" 
	   OnClick="javascript:GoUrlConfirm('../formControl.jsp?OPERATOR=InitialCheck','检查丢失的字段和表,自动修复;检查表单ID的冲突,自动修复,可能要修改系统菜单的路，是否继续？','divLine');" >
	   	  <input type="button" class="btnClass" value="表单导入" OnClick="javascript:ZipImportWin('');">
     <% } %>     	     
    </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>
    
    <td>版本号</td>
    <td>表单数量</td>
    <td width="40">操作</td>
  </tr>
<%
		String temp = "";
		String str[]=null;
		iLen = list.size();
		int j = 0;
		BdFormControl bdFormControl = new BdFormControl();
		int iCount = 0;
		int iTotal = 0;
    for (i=0; i<iLen; i++ ) {
    	str = (String[])list.get(i);
    	if (!cate_pro.equals("") && !cate_pro.equals(str[5])) {
    		continue;
    	}
    	if (!cate_fun.equals("") && !cate_fun.equals(str[6])) {
    		continue;
    	}
    	j ++;
    	iCount = bdFormControl.getFormCount(str[0]);
    	iTotal = iTotal + iCount;
%>
  <tr onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
  	<td width="30" align="center"><%=j%></td>  
    <td><%=str[0]%>&nbsp;</td>
    <td title="<%=str[2]%>"><%=str[1]%>&nbsp;</td>
    <!-- <td>功能介绍</td>   -->
    <td><%=str[3]%>&nbsp;</td>
    <!--     <td>创建时间</td> -->
    <td><%=str[5]%>&nbsp;</td>
    <!-- <td>最后修改时间</td> -->
    <td><%=str[6]%>&nbsp;</td>
    <td><%=str[8]%>&nbsp;</td>
    <td align="center"><b><%=iCount%></b></td>
    <td width="160">
    	<a href="javascript:DesignForm(formBar,'<%=str[0]%>','<%=str[5]%>','<%=str[6]%>');">设计表单</a>    
    <% if (isBarManager_SESSION) { %>	
    	<a href="javascript:Update(formBar,'<%=str[0]%>');">修改</a>
    	<a href="javascript:Delete(formBar,'<%=str[0]%>');">删除</a>
    	<a href="javascript:Export(formBar,'<%=str[0]%>');">导出</a>
    	
    <% } %>
    </td>
  </tr>
<%
    }
    out.println(SzPageHelp.outIndexTableTr(j, SzProperties.I_PageSize, 9));
	  out.println("<tr class='trClassTitle2'><td colspan='7'>表单数量合计</td><td align='center'>" + iTotal + "</td><td></td></tr>");    
%>
  </form>
</table>

<!-----下面的工具栏------>
<script language="javascript" src="<%=strLevel_SESSION%>share/js/commonTool.js"></script>
<script language="javascript">
  function ZipImportWin() {
		var url ="../../../share/page/excel_import_win.jsp?module=FormZipImport";
		//window.showModalDialog(url,window,"status=no;dialogWidth=580px;dialogHeight=350px");
		window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=580,height=350");			
  }
  
  function Delete(formName, sName) {
  	if (confirm("删除模块，将删除模块下的所有表单和数据，是否继续？")) { 
  		if (confirm("删除后表单的数据将不能恢复，确定要删除？")) {
  			formName.name.value = sName; 	
				var url = "control.jsp?OPERATOR=delete";
  	    formName.action = url;
    		formName.submit();
    	}
  	}    
  }
  
  function Update(formName, sName) {
  	formName.name.value = sName; 	
		var url = "update.jsp?OPERATOR=update";
  	formName.action = url;
    formName.submit();  
  }  
  
  function DesignForm(formName, sName, cate_pro, cate_fun) {
  	formName.module.value = sName;
  	formName.cate_pro.value = cate_pro;
  	formName.cate_fun.value = cate_fun; 	
		var url = "../formIndex.jsp";
  	formName.action = url;
    formName.submit();  
  }   
  
  function Export(formName, sName) {
  	if (confirm("将模块下的所有表单导出成formEngine文件")) {
  		formName.name.value = sName; 	
			var url = "control.jsp?OPERATOR=export";
  		formName.action = url;
    	formName.submit();
    }  
  }    

</script>
<div id="divLine" class="divLine" align="center" style="position:absolute;width:450;height:150px;left:150px;top:150px;padding:60px 0 0 0; margin:0px;overflow:auto;overflow:hidden;display:none; background-color:#dbdbdb;">
	<img src="<%=strSkin_SESSION%>/bar.gif">
</div><!---------------------------------------------------------------20120112 ting----------------------------------------->
