<%@ page language="C#" autoeventwireup="true" inherits="InstrumentStatus, App_Web_instrumentstatus.aspx.dbcc866c" enableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/UserControls/iERPSaveBar.ascx" TagName="iERPSaveBar" TagPrefix="dsip" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head id="Head1" runat="server">
    <title>..:: ICDAS 2.1 ::..</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
   
    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/js_functions.js"> </script>
    
    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/ScreenSaverStar.js"> </script>

    <script type="text/javascript" language="javascript">
        function resizeObject() {
            var w = getBrowserWindowSize().width;
            var h = getBrowserWindowSize().height - 5;
            //window.resizeTo(w, h);
            var cObj = document.getElementById("divChildBody");
            if (cObj != null) {
                //cObj.style.height = parseInt((h*79)/100) +"px";
                cObj.style.height = (parseInt(h) - 10) + "px";
                //cObj.style.width = parseInt(w) +"px";
            }

            var cObj = document.getElementById("PanelSearchEntry");
            if (cObj != null) {
                cObj.style.height = (parseInt(h) - 210) + "px";
            }
              hideWait();
        }


        function validateRecord() {

            var doc = document.forms[0];

            return true;
            
        }
        function validateSave() {
            var doc = document.forms[0];

            if (Trim(doc.txtFollowUpDate.value) == "") {
                alert("Please Enter Followup Date...");
                document.forms[0].txtFollowUpDate.focus()
                return false;
            }
            if (doc.cmbFollowUpModeId.selectedIndex == 0) {
                alert("Please Enter Followup Mode...");
                document.forms[0].cmbFollowUpModeId.focus()
                return false;
            }
            if (Trim(doc.txtFollowUpWith.value) == "") {
                alert("Please Enter Followup With...");
                document.forms[0].txtFollowUpWith.focus()
                return false;
            }
            if (Trim(doc.txtFollowUpResponse.value) == "") {
                alert("Please Enter Followup Response...");
                document.forms[0].txtFollowUpResponse.focus()
                return false;
            }
            if (parseFloat(Trim(doc.txtFollowUpResponse.value)) > 1000) {
                alert("Maximum 1000 Characters are allowed...");
                document.forms[0].txtFollowUpResponse.focus()
                return false;
            }
            if (Trim(doc.txtFollowUpAction.value) != "") {
                if (parseFloat(Trim(doc.txtFollowUpAction.value)) > 1000) {
                    alert("Maximum 1000 Characters are allowed...");
                    document.forms[0].txtFollowUpAction.focus()
                    return false;
                }
            }
            if (doc.cmbEmployeeId.selectedIndex == 0) {
                alert("Please Select Followup By...");
                document.forms[0].cmbEmployeeId.focus()
                return false;
            }



            else {
                return true;
            }
        }

        function accountdata() {
            return true;
        }

        function checkFAperiod(obj) {
            var lflg = true;
            var FAyearlock = '<%#Session["FAYEARLOCK"]%>';
            var FAyearfrom = '<%#Session["FAYEARFROM"]%>';
            var FAyearto = '<%#Session["FAYEARTO"]%>';
            var InPutDate = obj.value;  //document.forms[0].txtDocumentDate.value;
            var b, e, c;

            b = new Date(FAyearfrom.substr(7, 4) + '  ' + FAyearfrom.substr(3, 3) + '  ' + FAyearfrom.substr(0, 2));
            e = new Date(FAyearto.substr(7, 4) + '  ' + FAyearto.substr(3, 3) + '  ' + FAyearto.substr(0, 2));
            c = new Date(InPutDate.substr(7, 4) + '  ' + InPutDate.substr(3, 3) + '  ' + InPutDate.substr(0, 2));
            if ((c <= e && c >= b)) {
                if (FAyearlock == 1) {
                    alert("Year Locked...");
                    return false;
                }
            }
            else {
                alert("Invalid Date, Date Should Be Between Financial Year...");
                return false;
            }

            return lflg;
        }

        function GetSelectedSearch() {
            var grid = document.getElementById("<%#GVSearch.ClientID %>");
            //variable to contain the cell of the grid
            var cell;
            var hdnRecordKeys = document.getElementById("<%#hdnRecordKeys.ClientID %>");
            var hdnRecordRows = document.getElementById("<%#hdnRecordRows.ClientID %>");
            hdnRecordKeys.value = "";
            hdnRecordRows.value = "";
            if (grid.rows.length > 0) {
                //loop starts from 1. rows[0] points to the header.
                for (i = 1; i < grid.rows.length; i++) {
                    //get the reference of first column
                    cell = grid.rows[i].cells[0];

                    //loop according to the number of childNodes in the cell
                    for (j = 0; j < cell.childNodes.length; j++) {
                        //if childNode type is CheckBox                 
                        if (cell.childNodes[j].type == "checkbox") {
                            //assign the status of the Select All checkbox to the cell checkbox within the grid
                            //cell.childNodes[j].checked = document.getElementById(id).checked;

                            if (cell.childNodes[j].checked == true) {
                                if (hdnRecordKeys.value != "")
                                    hdnRecordKeys.value += ",";

                                hdnRecordKeys.value += (grid.rows[i].cells[1].textContent || grid.rows[i].cells[1].innerText || grid.rows[i].cells[1].text);

                                if (hdnRecordRows.value != "")
                                    hdnRecordRows.value += ",";
                                hdnRecordRows.value += (parseInt(i) - 1).toString();
                            }
                        }
                    }
                }
            }
        }
        function ShowPnlEdit() {
            var cObj = document.getElementById("divEdit");
            if (cObj != null) {
                cObj.style.visibility = "visible";
                cObj.style.display = "block";
            }
        }
        function HidePnlEdit() {
            var cObj = document.getElementById("divEdit");
            if (cObj != null) {
                cObj.style.visibility = "hidden";
                cObj.style.display = "none";
            }
        }


        function validateLogin() {
            var txtLoginName = document.getElementById("<%# txtLoginName.ClientID %>");
            var txtPassword = document.getElementById("<%# txtPassword.ClientID %>");
            var txtComments = document.getElementById("<%# txtComments.ClientID %>");


            if (Trim(txtLoginName.value) == "") {
                alert("Please Enter Login Name...");
                txtLoginName.focus()
                return false;
            }



            if (Trim(txtPassword.value) == "") {
                alert("Please Enter Password...");
                txtPassword.focus()
                return false;
            }
            if (Trim(txtComments.value) == "") {
                alert("Please Enter Comments...");
                txtComments.focus()
                return false;
            }
            else {
                return true;
            }
        }


        function ShowdivLogin() {

            var cObj = document.getElementById("<%# divLogin.ClientID %>");
            if (cObj != null) {
                cObj.style.visibility = "visible";
                cObj.style.display = "block";
            }
            return false;
        }

        function HidedivLogin() {
            var cObj = document.getElementById("<%# divLogin.ClientID %>");
            if (cObj != null) {
                cObj.style.visibility = "hidden";
                cObj.style.display = "none";
            }
            return false;
        }

    </script>

</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0" onload="resizeObject(); resizeHolder(); init(); initScreenSaver('1',<%=Session["AutoLogOutTime"]%>);">
    <form id="Form1" runat="server" class="formbg">
    <asp:ToolkitScriptManager runat="Server" EnablePartialRendering="true" AsyncPostBackTimeout="0"
        ID="ToolkitScriptManager1" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" class="formbg">
        <tr>
            <td valign="top" align="left">
                <div id="divMainBody" align="center" runat="server" width="100%" height="100%">
                    <div id="divHeader" runat="server" style="border-style: none; height: 26px; width: 100%;
                        position: absolute; left: 1px; top: 8px;" align="center">
                        <dsip:iERPSaveBar ID="iERPSaveBar1" runat="server" Caption="Transaction Maintainence"
                            PageAccess="11111" ValidateLogin="true"/>
                    </div>
                    <asp:UpdatePanel ID="uplChildBody" runat="server" UpdateMode="Always">
                        <ContentTemplate>
                            <asp:HiddenField ID="hdnRecordKeyId" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnRecordIds" runat="server" Value="" />
                            <asp:HiddenField ID="hdnUserId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBusinessUnitId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBranchId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchName" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchQuery" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchDelete" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchKey" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchPara" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchValue" runat="server" Value="" />
                            <asp:HiddenField ID="hdnRecordKeys" runat="server" Value="" />
                            <asp:HiddenField ID="hdnRecordRows" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchGridPageNo" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnSearchComboValue" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnSearchTextValue" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchcmbSearchValue" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchcmbValue" runat="server" Value="" />
                            <asp:HiddenField ID="hdnSearchdllValue" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBookMode" runat="server" Value="" />
                            <asp:HiddenField ID="hdnLoginComments" runat="server" Value="" />
                            <asp:HiddenField ID="hdnUserName" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnActionName" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnActionStatus" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnCurrentStatus" runat="server" Value="0" />
                            <div id="divChildBody" runat="server" style="overflow: auto; width: 99%;">
                                <table width="100%" align="left" cellpadding="1" cellspacing="0" class="tablefont"
                                    border="0">
                                  <%--  <tr>
                                        <td class="headerbg" align="left" style="border-style: none; height: 26px; width: 100%;
                                            position: absolute; left: 1px; top: 8px;">
                                            <asp:Label ID="lblCaption" runat="server" Text="Equipment Status" Width="100%" Font-Bold="true"
                                                Font-Names="Tahoma" ForeColor="AntiqueWhite" Font-Size="Medium"></asp:Label>
                                        </td>
                                    </tr>--%>
                                    <tr height="62px">
                                        <td colspan="3">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="left">
                                            Filter
                                        </td>
                                        <td width="25%" align="left" valign="top">
                                            <asp:DropDownList ID="cmbSearch" runat="server" Width="100%">
                                                <asp:ListItem Value="0">Search Option</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td width="65%">
                                            <asp:TextBox ID="txtSearch" runat="server" Width="70%" AutoPostBack="false"></asp:TextBox>
                                            &nbsp;&nbsp;Page Size&nbsp;
                                            <asp:TextBox ID="txtGridPageSize" runat="server" CssClass="numInput" Width="10%"
                                                MaxLength="5">25</asp:TextBox>
                                            <asp:Button ID="btnDblclickRow" runat="server" BorderWidth="0px" Height="0px" Style="visibility: hidden;"
                                                Width="0px" Text="" OnClick="btnDblclickRow_Click" />
                                        </td>
                                    </tr>
                                    <asp:Panel ID="pnlStatus" runat="server" Width="100%" BorderStyle="None">
                                        <tr>
                                            <td width="10%" align="left" valign="top">
                                                Current Status
                                            </td>
                                            <td width="25%" align="left" valign="top" colspan="2">
                                                <asp:RadioButtonList ID="rblStatus" AutoPostBack="true" runat="server" RepeatDirection="Horizontal"
                                                    CellPadding="0" CellSpacing="0" OnSelectedIndexChanged="rblStatus_SelectedIndexChanged">
                                                    <asp:ListItem Text="Active" Value="0" Selected="True"></asp:ListItem>
                                                    <%--<asp:ListItem Text="Offline" Value="1"></asp:ListItem>--%>
                                                    <asp:ListItem Text="Not Active" Value="2"></asp:ListItem>
                                                </asp:RadioButtonList>
                                                
                                            </td>
                                            <%--<td width="65%">
                                            <asp:ImageButton ID="ImgbtnSerach" runat="server" ImageUrl="../Icon/find.png" onclick="ImgbtnSerach_Click" />
                                            </td>--%>
                                        </tr>
                                        <tr>
                                            <td width="10%" valign="top">
                                                Action
                                            </td>
                                            <td width="25%" valign="top">
                                                <asp:RadioButtonList ID="rblAction" runat="server" RepeatDirection="Horizontal" CellPadding="0"
                                                    CellSpacing="0">
                                                    <%--<asp:ListItem Text="Offline" Value="1"></asp:ListItem>--%>
                                                    <asp:ListItem Text="Not Active" Value="2"></asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                            <td width="65%">
                                                
                                            </td>
                                        </tr>
                                    </asp:Panel>
                                    <tr>
                                        <td class="frametitle" align="center" style="height: 20px" width="99%" colspan="3">
                                            <font size="2"><b>
                                                <%=hdnSearchName.Value%></b>&nbsp;<strong>[Records Found :
                                                    <asp:Label ID="lblRecCount" runat="server"></asp:Label>]</strong> </font>
                                        </td>
                                    </tr>
                                    <tr align="left">
                                        <td colspan="3" align="left">
                                            <asp:Panel ID="PanelSearchEntry" runat="server" ScrollBars="Auto" Width="99%" CssClass="panelgrid">
                                                <asp:GridView ID="GVSearch" Width="100%" runat="server" CellPadding="0" CellSpacing="0"
                                                    AllowPaging="true" AllowSorting="True" AutoGenerateColumns="False" AlternatingRowStyle-CssClass="DGR_ALTERNATE"
                                                    RowStyle-CssClass="DGR_ITEM" HeaderStyle-CssClass="DGR_FIXEDHEADER" HeaderStyle-Height="25px"
                                                    OnRowDataBound="SearchRowDataBound" OnPageIndexChanging="SearchChangePage" OnSorting="SearchSortRecords"
                                                    BorderColor="#E0E4EA">
                                                    <Columns>
                                                        <asp:TemplateField HeaderStyle-CssClass="DGR_HEADER">
                                                            <HeaderTemplate>
                                                                <asp:CheckBox ID="chkAll" onclick="javascript:SelectAllCheckboxes(this);GetSelectedSearch();"
                                                                    runat="server" AutoPostBack="false" ToolTip="Select/Deselect All"></asp:CheckBox>
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:CheckBox ID="chkRecordId" runat="server" onclick="GetSelectedSearch();"></asp:CheckBox>
                                                            </ItemTemplate>
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <HeaderStyle HorizontalAlign="Center" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <RowStyle CssClass="DGR_ITEM" />
                                                    <HeaderStyle CssClass="DGR_FIXEDHEADER" />
                                                    <AlternatingRowStyle CssClass="DGR_ALTERNATE" />
                                                    <PagerSettings Position="TopAndBottom" />
                                                </asp:GridView>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" valign="top">
                                            &nbsp;
                                        </td>
                                        <td width="25%" valign="top">
                                            &nbsp;
                                        </td>
                                        <td width="65%">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" valign="top">
                                        </td>
                                        <td width="25%" valign="top">
                                        </td>
                                        <td width="65%">
                                            <%--<asp:Button ID="BtnSave" runat="server" Text="Save" Width="75px" OnClick="BtnSave_Click" />
                                            <asp:Button ID="BtnExit" runat="server" Text="Exit" Width="75px" OnClick="BtnExit_Click" />--%>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div id="divEdit" runat="server" align="center" style="width: 100%; height: 1500px;
                                top: 0px; left: 0px; position: absolute; visibility: visible; display: block;
                                z-index: 1; background-color: #333333; padding-left: 10%; text-align: center;
                                vertical-align: middle; filter: alpha(opacity=90); opacity: 0.90;">
                                <br />
                                <br />
                                <br />
                            </div>
                        </ContentTemplate>
                        <Triggers>
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
                <asp:UpdatePanel ID="uplLogin" runat="server" UpdateMode="Always">
                    <ContentTemplate>
                        <div id="divLogin" runat="server" align="center" style="width: 100%; height: 1500px;
                            top: 0px; position: absolute; visibility: hidden; display: none; background-color: #eeeeee;
                            padding-left: 30%; text-align: center; vertical-align: middle; filter: alpha(opacity=92);
                            opacity: 0.92;">
                            <br />
                            <br />
                            <asp:Panel ID="pnlLogin" runat="server" BorderColor="Black" BorderStyle="Ridge" BackColor="White"
                                BorderWidth="1" Width="40%" Height="200px" HorizontalAlign="Center">
                                <table id="Table5" cellspacing="0" cellpadding="0" width="99%" align="center">
                                    <tr>
                                        <td valign="top" align="center">
                                            <table class="subtitle" id="Table6" cellspacing="1" cellpadding="1" width="100%"
                                                align="center" border="0">
                                                <tr>
                                                    <td align="left" colspan="2">
                                                        <b>&nbsp;Login Panel</b>
                                                    </td>
                                                    <td align="right">
                                                        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/ToolBarIcon/Cancel.png" BackColor="Transparent"
                                                            OnClientClick="return HidedivLogin();" ToolTip="Close" 
                                                             />
                                                    </td>
                                                </tr>
                                            </table>
                                            <table id="Table7" cellspacing="1" cellpadding="1" width="99%" align="left" border="0">
                                                <tr align="left">
                                                    <td width="20%">
                                                        &nbsp;User Name
                                                    </td>
                                                    <td width="80%">
                                                        <asp:TextBox ID="txtLoginName" runat="server" Width="200px" MaxLength="20" ReadOnly="true"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr align="left">
                                                    <td width="20%">
                                                        &nbsp;Password
                                                    </td>
                                                    <td width="80%">
                                                        <asp:TextBox ID="txtPassword" runat="server" Width="200px" TextMode="Password" MaxLength="10"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr align="left">
                                                    <td width="20%" valign="top">
                                                        &nbsp;Comments
                                                    </td>
                                                    <td width="80%">
                                                        <asp:TextBox ID="txtComments" runat="server" Width="80%" MaxLength="250" onKeyUp="javascript:CheckTextBoxMaxLength(this, 250);" onChange="javascript:CheckTextBoxMaxLength(this, 250);" TextMode="MultiLine"
                                                            Rows="3"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center" colspan="2">
                                                        <asp:Button ID="btnLogin" runat="server" CssClass="buttonbg" Width="80px" Height="25px"
                                                            BorderWidth="0px" Text="Login" OnClick="btnLogin_Click"></asp:Button>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center" colspan="2">
                                                        <asp:Panel ID="ErrorMsg" runat="server" Visible="false">
                                                            &nbsp;
                                                            <img src="../Images/error.gif" width="24" height="17" align="absmiddle">
                                                            <asp:Label ID="lblError" runat="server"></asp:Label>
                                                        </asp:Panel>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                                <asp:HiddenField ID="hdnLoginPassword" runat="server" />
                                <asp:HiddenField ID="hdnValidateLoginName" runat="server" />
                            </asp:Panel>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
