<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StudentStatus.aspx.cs"
    Inherits="RM.Web.Training.UserStudents.StudentStatus" %>

<%@ Register Src="../../UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc2" %>
<%@ Register Src="/UserControl/PageControl.ascx" TagName="PageControl" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="/Themes/Scripts/Validator/JValidator.js" type="text/javascript"></script>
<script src="/Themes/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
<head runat="server">
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <title>
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Student_situ")%></title>
    <style type="text/css">
        td a { color: Blue; }
        op_Result</style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Student_situ")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="float: left;">
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Credit_User_Date")%>：<input id="start"
                type="text" onclick="WdatePicker()" value="<%=start %>" />&nbsp;&nbsp; --&nbsp;&nbsp;<input
                    id="end" type="text" onclick="WdatePicker()" value="<%=end %>" />
            <input type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("GetButton")%>"
                onclick="chaxun(0)" />
            <input style="margin-left: 2px;" type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("This_monthly")%>"
                onclick="chaxun(1)" />
            <input style="margin-left: 2px;" type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("This_quarter")%>"
                onclick="chaxun(2)" />
            <input style="margin-left: 2px;" type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("This_year")%>"
                onclick="chaxun(3)" />
        </div>
        <div style="text-align: right;">
            <uc2:LoadButton ID="LoadButton1" runat="server" />
             <input type="button" name="name" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("InpoutThisPage")%>"  onclick="inport()"/>
            <input type="button" name="name" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DaoChu")%>"
                onclick="daochu()" />
        </div>
    </div>
    <div class="div-body">
        <table class="grid" id="table1">
            <thead>
                <tr>
                    <th>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Teacher_Info_username")%>
                    </th>
                    <th>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Student_learTime")%>
                    </th>
                    <th>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Student_Credit")%>
                    </th>
                    <th>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Student_lastlogindata")%>
                    </th>
                    <th>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Student_loginNum")%>
                    </th>
                    <th>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Js")%>
                    </th>
                    <th>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_Form_ssbm")%>
                    </th>
                </tr>
            </thead>
            <tbody>
                <%=str.ToString()%>
            </tbody>
        </table>
    </div>
    <uc1:PageControl ID="PageControl1" runat="server" />
    </form>
</body>
</html>
<script>
    $(function () {
        //把分页定位到屏幕下面
        divresize(90);
        FixedTableHeader("#table1", $(window).height() - 121);
    })
    function daochu() {
        var start = $("#start").val();
        var end = $("#end").val();
        location.href = "/Training/UserStudents/StudentStatus.aspx?status=1&&StudentStatus_Start=" + start + "&&StudentStatus_End=" + end;
    }
    function chaxun(obj) {
        var d = new Date();
        if (obj == 0) {
            var start = $("#start").val();
            var end = $("#end").val();
            location.href = "/Training/UserStudents/StudentStatus.aspx?StudentStatus_Start=" + start + "&&StudentStatus_End=" + end;
        } else if (obj == 1) {
            var month = d.getMonth() + 1;
            var NowDate = d.getFullYear() + "-" + month + "-" + 01;
            location.href = "/Training/UserStudents/StudentStatus.aspx?StudentStatus_Start=" + NowDate + "&&StudentStatus_End=" + d.toLocaleDateString();
        } else if (obj == 2) {
            var month = 1;
            if (d.getMonth() + 1 > 3) {
                month = d.getMonth() + 1 - 3;
            }
            var NowDate = d.getFullYear() + "-" + month + "-" + 01;
            location.href = "/Training/UserStudents/StudentStatus.aspx?StudentStatus_Start=" + NowDate + "&&StudentStatus_End=" + d.toLocaleDateString();
        } else {
            var month = d.getMonth() + 1;
            var NowDate = (d.getFullYear() - 1) + "-" + month + "-" + d.getDate();
            location.href = "/Training/UserStudents/StudentStatus.aspx?StudentStatus_Start=" + NowDate + "&&StudentStatus_End=" + d.toLocaleDateString();
        }
    }
    //查询
    function select() {
        var url = "/Training/UserStudents/User_select_Info.aspx?action=StudentStatus";
        top.openDialog(url, 'User_select_Info', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("UserInfo_Index")%>', 800, 350, 50, 50);
    }
    //导出
    function inport() {

        var html = "<table border=1>" + $("#table1").html() + "</table>";
        post('/RMBase/SysWindows/WindowsExport.ashx', { ExportType: "not", ExportHTML: html, TableName: "result" });
        GoTableExport("not", "table1");
    }

    //提交数据，下载导出文件
    function post(URL, PARAMS) {
        var temp = document.createElement("form");
        temp.action = URL;
        temp.method = "post";
        temp.style.display = "none";
        for (var x in PARAMS) {
            var opt = document.createElement("textarea");
            opt.name = x;
            opt.value = PARAMS[x];
            //alert(opt.name);      
            temp.appendChild(opt);
        }
        document.body.appendChild(temp);
        temp.submit();
        return temp;
    }
</script>
