<%@ page contentType="text/html;charset=UTF-8" %>
<%@ 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.*" %>
<%@ page import="net.sz600.dbforeign.*" %>
<%@ 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.*" %>
<%@ include file="/sessionInfo.jsp"%>
<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 type="text/javascript" src="<%=strLevel_SESSION%>/share/js/operatorWin.js"></script>
<style type="text/css">
.div{
	position: absolute;
	z-index: 1;
	display:none;
	background-color: #cccccc;
	border: 0px;
	border-color: black;
	border-style: solid;
}
td{
	word-break : break-all; 
}
</style>
</head>

<%
    //获取提交的参数
	String RelateName = SzConvert.toSpaceStr(request.getParameter("relateName"));
	String chaxun = SzConvert.toSpaceStr(request.getParameter("chaxun"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));//页面中的快速查询

    int iCurrentPage = 1;
    try {
        iCurrentPage =  Integer.parseInt(sPage);
    }catch(Exception e) {
    }	

    GetArrayList getList=new GetArrayList(RelateName,chaxun);
    ArrayList list=getList.getMessage(iCurrentPage,sSearch);
    SzPageInfo pageInfo = getList.getPageInfo();
    int iPageCount = pageInfo.getPageCount();//总页数
	int iRecordCount = pageInfo.getRecordCount();   
	iCurrentPage = pageInfo.getCurrentPage();//当前第几页

        
    ArrayList strlist=null;
    String[] str=null;
    int leng = 0;
		
%>
<!-----上面的工具栏------>
<%@ include file="/share/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <tr>
    <td>
      <input type="button" class="btnClass" value=" 返回 " OnClick="javascript:FormSubmit(formBar, '../../xml/foreign/foreign_sql_index.jsp?module=simpleform.xml');">
 
      <% if (getList.getSdc().equals("0")) { %>
      <input type="button" class="btnClass" value="导到excel" OnClick="javascript:ExcelImportWin();">
      <% } %>  
       <% if (getList.getSdy().equals("0")) { %>
      <input type="button" class="btnClass" value=" 打 印 " OnClick="javascript:PrintWinWord('<%=iCurrentPage %>','<%=sSearch%>','<%=RelateName %>','<%=chaxun %>');">
      <% } %>  
                      
    </td>
  </tr>
  </form>
</table>
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
	<tr class="trClassTitle">
		<%
		  str = getList.getMC();
		  for(int c =0 ; c < str.length ; c ++){		
		%>
		<td><%=str[c] %></td>
		<%
		  }
		%>
	</tr>
	<%
		
		if(list != null){
			leng=list.size();
		}
		for(int j =0 ; j < leng ; j ++){
			strlist=(ArrayList)list.get(j);
	%>
	<tr onMouseOver="javascript:this.className='trMouseOver'" 
       onMouseOut="javascript:this.className='trMouseOut'">
		<%
		for(int k =0 ; k < strlist.size() ; k ++){		
		%>
			<td><%=strlist.get(k) %></td>
		<%
		  }
		%>
	</tr>
	<%
	}
	%>
</table>
<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="relateName" value="<%=RelateName%>">
  <input type="hidden" name="chaxun" value="<%=chaxun%>">
  <tr>
    <td align="right">
    	<%
    	if(getList.getSfy().equals("0")){
    		if(!getList.getFz().equals("")){
    	
    		}else{
    			%>
    			 <%@ include file="/share/page/page_include.jsp"%>
    			<%
    		}
    	}
        %>
    </td>
  </tr>
  </form>
</table>

<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  function ExcelImportWin() {
  		<%
		SzFile file=new SzFile();
		file.writeExcel("1", "", "数据表.xls", list);
  		%>
		window.open("../../数据表.xls","","left=102,top=102,width=851,height=600,status=yes,resize=yes");
  }
</script>  
<script language="javascript">
     
  function PrintWinWord(iCurrentPage,sSearch,RelateName,chaxun) {
  	var vUrl = "print.jsp?iCurrentPage="+iCurrentPage+"&sSearch="+sSearch+"&RelateName="+RelateName+"&chaxun="+chaxun;
  	//window.open(vUrl,"","left=20,top=20,width=600,height=600");
  	window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;dialogHeight=550px");
  
   // window.print();
  }
</script>
