<%@ page language="C#" autoeventwireup="true" inherits="Transactions_TA_UI_Transaction_Discrepancy, App_Web_uztc2ijj" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="../UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="TA_uc_OrgLevel_Filter"
    TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml" id="htmlDiscrepancyPop" runat="server">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>Timecheck</title>
    <%--<link href="../css/stylesheet.css" rel="stylesheet" />--%>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
        name="viewport" />
    <link id="stylebootstrap" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylefontawesome" rel="stylesheet" runat="server" type="text/css" />
    <link id="styleAdminLTE" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylecustom" rel="stylesheet" runat="server" type="text/css" />
    <link id="stylefonts" rel="stylesheet" runat="server" type="text/css" />

    <script language="javascript" src="../js/Popup.js" type="text/javascript"></script>

    <script language="javascript" src="../js/chkbox_delete.js" type="text/javascript"></script>

    <script language="javascript" src="../js/Datekeylock.js" type="text/javascript"></script>

    <script language="javascript" src="../js/Discrepancy.js" type="text/javascript"></script>

    <script language="javascript" src="../js/DateTimeValidation.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">

        //values for check date
        var Monthfourdigit = 'Please enter valid date as month, day, and four digit year : Format MM/dd/yyyy.';
        //Adding this line var Datefourdigit='Please enter valid date with correct format dd/MM/yyyy'; as newly
        var Datefourdigit = 'Please enter valid date with correct format dd/MM/yyyy';
        var Invalidyearentry = 'Invalid year entry';
        var Invalidmonthentry = 'Invalid month entry';
        var Invaliddateentry = 'Invalid date entry';
        var DateformatDDMONYYYY = 'Incorrect date format. Enter as DD-MON-YYYY';
        var Entertime = 'Enter time';
        var Valueforhours = 'Invalid value for hours:';
        var Invalidvalueforminutes = 'Invalid value for minutes:';
        var Invalidtimeformat = 'Invalid time format:';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var ValiddatemonthMMDDYYHHMM = 'Please enter valid Date and Time MM/dd/yyyy HH:mm';
        var ValiddatemonthMMDDYYHHMMTT = 'Please enter valid Date and Time MM/dd/yyyy hh:mm tt';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var Invalidvalueforhours = 'Invalid value for hours:';
        var Invalidvalueforminites = 'Invalid value for minutes:';




        function SetAlertCheckDate(monthfourdigit, datefourdigit, invalidyearentry, invalidmonthentry, invaliddateentry, dateformatDDMONYYYY, entertime, valueforhours, invalidvalueforminutes, invalidtimeformat, entervalidDateandTime, validdatemonthMMDDYYHHMM, validdatemonthMMDDYYHHMMTT, entervalidDateandTime, invalidvalueforhours, invalidvalueforminites) {
            Monthfourdigit = monthfourdigit;
            Datefourdigit = datefourdigit;
            Invalidyearentry = invalidyearentry;
            Invalidmonthentry = invalidmonthentry;
            Invaliddateentry = invaliddateentry;
            DateformatDDMONYYYY = dateformatDDMONYYYY;
            Entertime = Entertime;
            Valueforhours = valueforhours;
            Invalidvalueforminutes = invalidvalueforminutes;
            Invalidtimeformat = invalidtimeformat;
            EntervalidDateandTime = entervalidDateandTime;
            ValiddatemonthMMDDYYHHMM = validdatemonthMMDDYYHHMM;
            ValiddatemonthMMDDYYHHMMTT = validdatemonthMMDDYYHHMMTT;
            EntervalidDateandTime = entervalidDateandTime;
            Invalidvalueforhours = invalidvalueforhours;
            Invalidvalueforminites = invalidvalueforminites;
        }
        var EnterValidTime = "Enter valid time";

        function SetAlertMessages(enterValidTime) {

            EnterValidTime = enterValidTime;

        }
        function AssignDateValue(ctrl, id, inDate, inTime, outDate, outTime) {
            var DateFormat = document.getElementById('Hidden1').value;
            if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)
) {
            }
            else {
                return false;
            }

            if (document.getElementById("hid" + (parseInt(id) + parseInt(1))) != null) {

                document.getElementById("hid" + (parseInt(id) + parseInt(1))).value = ctrl.value;
                valDate = document.getElementById("hid" + (parseInt(id) + parseInt(1))).value
                valTime = document.getElementById("hidTime" + (parseInt(id) + parseInt(1))).value;
                if (valDate != "" && valTime != "") {

                    strInDate = document.getElementById(inDate).value;
                    strInTime = document.getElementById(inTime).value;
                    strOutDate = document.getElementById(outDate).value;
                    strOutTime = document.getElementById(outTime).value;
                    if (strInDate != "" && strInTime != "" && strOutDate != "" && strOutTime != "") {
                        CheckDiscrepanceTime(strInDate, strInTime, strOutDate, strOutTime)
                    }
                }

            }

        }
        function AssignTimeValue(ctrl, id, inDate, inTime, outDate, outTime) {

            regExp = "^((([0]?[1-9]|1[0-2])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?))$";

            var TimeFormat = document.getElementById('Hidden2').value;
            var length = 0;
            if (TimeFormat != "%H:%M") {
                length = 11;
                regExp = "^(([0]?[1-9]|1[0-2])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?( )?(AM|am|aM|Am|PM|pm|pM|Pm))$";
            }
            else {
                length = 8;
                regExp = "^(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?)$";
            }

            if (ctrl.value != "") {
                if (parseInt(ctrl.value.length) != length) {
                    alert(EnterValidTime);
                    return false;
                }
                if (ctrl.value.search(regExp) == -1) {
                    //                    ctrl.focus();
                    alert(EnterValidTime);
                    return false;
                }
            }

            if (document.getElementById("hidTime" + (parseInt(id) + parseInt(1))) != null) {
                document.getElementById("hidTime" + (parseInt(id) + parseInt(1))).value = ctrl.value;

                valDate = document.getElementById("hid" + (parseInt(id) + parseInt(1))).value
                valTime = document.getElementById("hidTime" + (parseInt(id) + parseInt(1))).value;
                if (valDate != "" && valTime != "") {

                    strInDate = document.getElementById(inDate).value;
                    strInTime = document.getElementById(inTime).value;
                    strOutDate = document.getElementById(outDate).value;
                    strOutTime = document.getElementById(outTime).value;
                    if (strInDate != "" && strInTime != "" && strOutDate != "" && strOutTime != "") {
                        CheckDiscrepanceTime(strInDate, strInTime, strOutDate, strOutTime)
                    }
                }
            }
        }
    </script>

</head>
<body style="margin-top: 0; margin-left: 0;">
    <form id="aspnetForm" runat="server">
        <div>
            <div class="content">
                <div class="row" style="display: none">
                    <div class="col-md-12">
                        <table border="0" align="center" cellpadding="2" cellspacing="1" width="100%">
                            <tr>
                                <td valign="top" colspan="5" class="ModuleTitle" style="height: 24px" width="100%">
                                    <font color="#000080">
                                        <asp:Label ID="lblDiscrepancyReport" runat="server"></asp:Label></font></td>
                                <asp:Button ID="btnSave" CssClass="but" runat="server" Text="Close" CausesValidation="true"
                                    OnClick="btnSave_Click" Visible="false" />
                            </tr>
                            <tr>
                                <td colspan="5">
                                    <input id="Hidden1" type="hidden" value='<% Response.Write(Convert.ToString(Session["IDateFormat"])); %>' />
                                    <input id="Hidden2" type="hidden" value='<% Response.Write(Session["ITimeFormat"].ToString()); %>' />
                                    <input id="hiddenTime" type="hidden" runat="server" value='%I:%M:%S %p' />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="table-responsive">
                            <asp:GridView ID="grd" runat="server" AutoGenerateColumns="false" Width="100%" OnRowDataBound="grd_RowDataBound"
                                CssClass="table das-table1">
                                <Columns>
                                    <asp:TemplateField HeaderText="Employee Id" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label ID="lblEmpID" runat="server" Text='<%# Eval("cardNo")%>'></asp:Label>
                                            <asp:HiddenField ID="hidInReader" runat="server" Value='<%# Eval("InReaderID")%>' />
                                            <asp:HiddenField ID="hidOutReader" runat="server" Value='<%# Eval("OutReaderID")%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Employee Name" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <%# Eval("EmpName")%>
                                            <asp:HiddenField ID="hidEmployeeAutoId" runat="server" Value='<%# Eval("EmployeeAutoId")%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Shift Date" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label ID="lblClkDate" runat="server" Text='<%# Eval("ClockDate") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Shift Time" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label ID="lblStartTime" runat="server" Text='<%# Eval("Shift_StartTime") %> '></asp:Label>
                                            -
                                            <asp:Label ID="lblEndTime" runat="server" Text='<%# Eval("Shift_EndTime") %> '></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="In Date" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label onpaste="return true" ID="txtInDate" runat="server" Text='<%# Eval("InDate")%>'
                                                CssClass="txt" ReadOnly="true"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="In Time" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label onpaste="return true" ID="txtInTime" runat="server" Text='<%# Eval("InTime")%>'
                                                CssClass="txt" ReadOnly="true"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Out Date" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label onpaste="return true" ID="txtOutDate" runat="server" Text='<%# Eval("OutDate")%>'
                                                CssClass="txt" ReadOnly="true"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Out Time" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label onpaste="return true" ID="txtOutTime" runat="server" Text='<%# Eval("OutTime")%>'
                                                CssClass="txt" ReadOnly="true"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Reason" HeaderStyle-CssClass="empheader GridColumn50">
                                        <ItemTemplate>
                                            <asp:Label onpaste="return true" ID="txtReason" MaxLength="250" runat="server" CssClass="txt"
                                                ReadOnly="true"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                <PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />
                                <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                    PreviousPageText="<" />
                                <AlternatingRowStyle BackColor="white" />
                            </asp:GridView>
                        </div>
                        <br />
                        <asp:HiddenField ID="hid1" runat="server" />
                        <asp:HiddenField ID="hid2" runat="server" />
                        <asp:HiddenField ID="hid3" runat="server" />
                        <asp:HiddenField ID="hid4" runat="server" />
                        <asp:HiddenField ID="hid5" runat="server" />
                        <asp:HiddenField ID="hid6" runat="server" />
                        <asp:HiddenField ID="hid7" runat="server" />
                        <asp:HiddenField ID="hid8" runat="server" />
                        <asp:HiddenField ID="hid9" runat="server" />
                        <asp:HiddenField ID="hid10" runat="server" />
                        <asp:HiddenField ID="hidTime1" runat="server" />
                        <asp:HiddenField ID="hidTime2" runat="server" />
                        <asp:HiddenField ID="hidTime3" runat="server" />
                        <asp:HiddenField ID="hidTime4" runat="server" />
                        <asp:HiddenField ID="hidTime5" runat="server" />
                        <asp:HiddenField ID="hidTime6" runat="server" />
                        <asp:HiddenField ID="hidTime7" runat="server" />
                        <asp:HiddenField ID="hidTime8" runat="server" />
                        <asp:HiddenField ID="hidTime9" runat="server" />
                        <asp:HiddenField ID="hidTime10" runat="server" />
                    </div>
                </div>
            </div>
            <input type="hidden" id="hidFlag" />
        </div>
    </form>
</body>
</html>
