<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserSignIn.aspx.cs" Inherits="SWTraining.Personnel.UserSignIn"
    Title="人事管理-员工出勤图" %>

<%@ Import Namespace="SWTraining" %>
<!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">
<head runat="server">
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
    <script type="text/javascript">

        var arrIndexs = new Array();
        var i = 0;

        function getElementsByClassName(n) {
            var classElements = [], allElements = document.getElementsByTagName('*');
            for (var i = 0; i < allElements.length; i++) {
                if (allElements[i].className == n) {
                    classElements[classElements.length] = allElements[i];
                }
            }
            return classElements;
        }

        function ClassName(className, state, color) {
            if (state == 1) {
                var redClassElements = getElementsByClassName(className);
                for (var i = 0; i < redClassElements.length; i++) {
                    redClassElements[i].style.backgroundColor = color;
                }
            } else {
                var redClassElements = getElementsByClassName(className);
                for (var i = 0; i < redClassElements.length; i++) {
                    redClassElements[i].style.backgroundColor = color;
                }
            }
        }

        function OnClick(index, color) {
            var redClassElements = getElementsByClassName('mt_bg_' + index);
            for (var i = 0; i < redClassElements.length; i++) {
                redClassElements[i].style.backgroundColor = color;
                redClassElements[i].onmouseout = "";
            }
        }

        function Selected(indexs) {
            if (indexs != "0") {
                var index = indexs.split('_')[0];
                var color = indexs.split('_')[1];
                OnClick(index, color);

                arrIndexs[i] = index;
                i++;
            }
            else {
                for (i = 0; i < arrIndexs.length; i++) {
                    var index = arrIndexs[i];
                    ClassName('mt_bg_' + index, 0, '#ffffff');
                }
            }
        }

        //        function ColorMode(type) {
        //            if (type == 1) {
        //                for (i = 0; i < arrColors.length; i++) {
        //                    var color = arrColors[i];
        //                    OnClick(i + 1, color);
        //                }
        //            }
        //            if (type == 0) {
        //                for (i = 0; i < arrColors.length; i++) {
        //                    var color = arrColors[i];
        //                    ClassName('mt_bg_' + (i + 1), 0, '#ffffff');
        //                }
        //            }
        //        }

        function Checks(checkbox) {
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var e = document.forms[0].elements[i];
                if (e.type == "checkbox" && e.id == "cbxName") {
                    e.checked = checkbox.checked;
                }
            }
        }

        function Hide() {
            var StudentID = "";
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var e = document.forms[0].elements[i];
                if (e.type == "checkbox" && e.id == "cbxName") {
                    if (e.checked) {
                        document.getElementById("GridView1").rows[e.value].style.display = "none";
                    }
                }
            }
        }
    </script>
    <style type="text/css">
        .gridview th
        {
            text-align: center;
        }
        .gridview td
        {
            border-right-width: 1px;
        }
        
        .colorCode
        {
            background-color: White;
        }
        
        .am
        {
            width: 28px;
            height: 28px;
            background-color: #94D46E;
            line-height: 100%;
            padding: 1px;
            color: #242424;
            font-size: 8.5pt;
            margin: 0px;
        }
        
        .pm
        {
            width: 28px;
            height: 28px;
            background-color: #E2D75E;
            line-height: 100%;
            padding: 1px;
            color: #242424;
            font-size: 8.5pt;
            margin: 0px;
        }
        
        .night
        {
            width: 28px;
            height: 28px;
            background-color: #cccccc;
            line-height: 100%;
            padding: 1px;
            color: #242424;
            font-size: 8.5pt;
            margin: 0px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="tool_ControlPanel">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <input onclick="Checks(this)" type="checkbox" />
                </td>
                <td>
                    全选
                </td>
                <td>
                    <label class="lab_buttom">
                        <input id="Button1" type="button" value="隐藏" onclick="Hide();" /></label>
                </td>
                <td>
                    日期：
                </td>
                <td>
                    <asp:TextBox ID="tbxDateAndTime" runat="server" Width="100px"></asp:TextBox>
                </td>
                <td>
                    <label class="lab_buttom">
                        <asp:Button ID="btnShow" runat="server" OnClick="btnShow_Click" Text="查看" />
                    </label>
                    <label class="lab_buttom">
                        <asp:Button ID="btnUp" runat="server" OnClick="btnUp_Click" Text="上月" />
                    </label>
                    <label class="lab_buttom">
                        <asp:Button ID="btnDown" runat="server" OnClick="btnDown_Click" Text="下月" />
                    </label>
                </td>
                <td>
                    <asp:HyperLink ID="hlkManage" NavigateUrl="UserSignInManage.aspx" runat="server"> &nbsp;管理 &nbsp;</asp:HyperLink>
                </td>
            </tr>
        </table>
    </div>
    <div class="both">
    </div>
    <div class="divpanel" style="overflow: auto; padding-bottom: 40px">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" CssClass="gridview"
            OnRowDataBound="GridView1_RowDataBound" EnableViewState="False">
        </asp:GridView>
    </div>
    <div class="divremark">
        <b>注意事项：</b><br />
        1、点击“管理”可对考勤信息进行修改、清除。<br />
        2、绿色表示上午、黄色表示下午、灰色表示晚上。<br />
    </div>
    </form>
</body>
</html>
