<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchResult.aspx.cs" Inherits="Webdisk.SearchResult" %>

<% @ Import Namespace="Webdisk.DAL" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="style/gray/style.css" rel="stylesheet" type="text/css" />
    <link href="css/BaseStyle.css" rel="stylesheet" type="text/css" />
    <link href="css/common.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="themes/default/easyui.css"/>
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="js/Common.js" type="text/javascript"></script>
    <%--<script src="js/easyloader.js" type="text/javascript"></script>--%>
    <script src="js/jquery.easyui.min.js" type="text/javascript"></script>
</head>
<body>
    <div id="zydg" style="width:688px;" class="easyui-layout" ></div>
</body>
</html>
 <script type="text/javascript">
     $(function () {
         $(window).resize(function() {
             $("#zydg").css("height", $(window).height() - 30 + "px");
             $("#zydg").datagrid("resize", { width: $("body").width() });
//             $(".datagrid-view").css("height", $(window).height() - 30 + "px");
         });
         setTimeout(function () {
             $("#zydg").css("height", $(window).height());
             var tempUrl = 'FileSpaceHandler.ashx?cmd=SearchSource&fileType=<% if(Request["fileType"]!=null)Response.Write(Request["fileType"].ToString()); %>'
            + '&key=<% if(Request["key"]!=null)Response.Write(Request["key"].ToString()); %>'
            + '&txtType=<% if(Request["txtType"]!=null)Response.Write(Request["txtType"].ToString()); %>'
            + '&txtName=<% if(Request["txtName"]!=null)Response.Write(Request["txtName"].ToString()); %>'
            + '&txttime1=<% if(Request["txttime1"]!=null)Response.Write(Request["txttime1"].ToString()); %>'
            + '&txttime2=<% if(Request["txttime2"]!=null)Response.Write(Request["txttime2"].ToString()); %>'
            + '&txtsize1=<% if(Request["txtsize1"]!=null)Response.Write(Request["txtsize1"].ToString()); %>'
            + '&txtsize2=<% if(Request["txtsize2"]!=null)Response.Write(Request["txtsize2"].ToString()); %>'
            + '&txtnote=<% if(Request["txtnote"]!=null)Response.Write(Request["txtnote"].ToString()); %>'
            + '<% if(Request["username"]!=null)Response.Write("&username="+Request["username"].ToString()); %>';
//            <%if(Request["company"]!=null)Response.Write("&company="+Request["company"].ToString());if(Request["dept"]!=null)Response.Write("&dept="+Request["dept"].ToString()); %>';
             $('#zydg').datagrid({
                 title: '',
                 loadMsg: "数据加载中，请稍后……",
                 nowrap: false,
                 striped: true,
                 showFooter: true,
                 url: tempUrl,
                 pageList: [10, 15, 20, 25, 30, 40, 50],
                 pageSize: 20,
                 sortName: 'lasttime',
                 autoRowHeight: false,
                 sortOrder: 'desc',
                 remoteSort: true,
                 fitColumns: true,
                 idField: 'id',
                 columns: [[
                        { field: 'filename', title: '资源标题', width: 180, align: 'left', fixed: true, sortable: true },
                        { field: 'jcvar', title: '教材版本', width: 100, align: 'center', sortable: true },
                        { field: 'nj', title: '年级', width: 100, align: 'center', sortable: true },
                        { field: 'zytype', title: '资源类型', width: 100, align: 'center', sortable: true },
                        { field: 'km', title: '科目', width: 70, align: 'center', sortable: true },
                        { field: 'fileext', title: '文件格式', width: 70, align: 'center', sortable: true }
                    ]],
                 pagination: true,
                 rownumbers: true,
                 onLoadSuccess: function () {
                     $("#zydg").css("height", $(window).height() - 28);
                 }
             });
             $("#zydg").datagrid("getPager").pagination({
                 beforePageText: '第', //页数文本框前显示的汉字  
                 afterPageText: '页    共 {pages} 页',
                 displayMsg: '当前显示从第{from}条到{to}条 共{total}条记录',
                 onBeforeRefresh: function (pageNumber, pageSize) {
                     $(this).pagination('loading');
                     $(this).pagination('loaded');
                 }
             });
         },100);
     });
</script>

