<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.organize.*" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="java.util.*" %>
<%@ 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>
<%
		//查询时间段
		String sType     = SzConvert.toSpaceStr(request.getParameter("LogType"));
		String sModuleID = SzConvert.toZeroStr(request.getParameter("ModuleID"));
		String sInfoID   = SzConvert.toZeroStr(request.getParameter("InfoID"));
		String sTypeName = "";
    if (sType.equals("FORM")) {
    	sTypeName = "表单";
    }
    String operType = SzConvert.arrayToWriteStr(request.getParameterValues("operType"),";");
    String moduleType = SzConvert.arrayToWriteStr(request.getParameterValues("moduleType"),";");
    String begin = SzConvert.toSpaceStr(request.getParameter("begin"));
    String end   = SzConvert.toSpaceStr(request.getParameter("end"));
   
    if (operType.equals("")) {
    	operType = "添加;删除;修改;变更";
    }
    if (moduleType.equals("")) {
    	moduleType = "0";
    }
	BdRelateForm bdRelateForm = new BdRelateForm();
	ArrayList list = bdRelateForm.ralateIDList(SzConvert.toInt(sModuleID), SzConvert.toInt(sInfoID), moduleType);
  Collection collLog = SzLog.getInstance().getFormLogList(list, operType, begin, end);
    //Collection collLog = null;
	
%>
<table width="100%">
  <form name="formBar" method="post" action="logList.jsp">
  <input type="hidden" name="LogType" value="<%=sType%>">
  <input type="hidden" name="ModuleID" value="<%=sModuleID%>">
  <input type="hidden" name="InfoID" value="<%=sInfoID%>">
  <tr>
    <td>
   <%
    String s_id[] = {"0","1","2"};
    String s_name[] = {"本表单","下级","下下级"};
    %>   
    <b>涉及范围:</b><%=SzPageHelp.checkbox("moduleType", s_id, s_name, moduleType)%>&nbsp;&nbsp; 
    <%
    String s_id2[] = {"添加","删除","修改","变更"};
    String s_name2[] = {"添加","删除","修改","变更"};
    %>
    <b>操作类型:</b><%=SzPageHelp.checkbox("operType", s_id2, s_name2, operType)%>&nbsp;&nbsp;<br>
    <b>操作时间:</b><input type="text" class="txtClass1" name="begin" value="<%=begin %>">-<input type="text" class="txtClass1" name="end" value="<%=end %>">
   <%=SzPageHelp.button("确定","this.form.submit();") %>
   <%=SzPageHelp.closeButton()%>
    </td>
  </tr>
  </form>
</table>
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle">
    <td width="120">操作时间/人员</td>
    <td width="120">操作ＩＰ／类型</td>
    <td>操作内容</td>
    <td>信息ID</td>    
  </tr>
<%
	Iterator iter = null;
    if (collLog != null) {
    	iter = collLog.iterator();
    }
	String str_log[] = null;
	while (iter != null && iter.hasNext()) {
		str_log = (String[])iter.next();
		if (str_log == null || str_log.length <4) {
			continue;
		}
%>
  <tr>
    <td align="left" valign="top"><%=str_log[0]%><br><%=str_log[1]%>&nbsp;</td>
    <td align="left" valign="top"><%=str_log[4]%><br><%=str_log[2]%>&nbsp;</td>
    <td><%=str_log[3]%>&nbsp;</td>
    <td><%=str_log[5]%>&nbsp;</td>
  </tr>
<%		
    }
%>	
</table>