<%@ Page Title="" Language="C#" MasterPageFile="~/Application.Master" AutoEventWireup="true" CodeBehind="Equipment_Document.aspx.cs" Inherits="ICDAS_3_0_Web_App.ICDAS_3_0.Configuration.Equipment_Document" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%@ Register Src="~/User_Controls/ucSearchGrid.ascx" TagPrefix="ucSearchGrid" TagName="ucSearchGrid" %>
    <%@ Register Src="~/User_Controls/ucToolBar.ascx" TagPrefix="ucToolBar" TagName="ucToolBar" %>
    <%@ Register Src="~/User_Controls/ucUserValidation.ascx" TagPrefix="ucValidate" TagName="ucUserValidation" %>

    <script type="text/javascript">
        var confirmed = false;
        function ConfirmDelete(controlID) {
            if (confirmed) { return true; }

            bootbox.confirm("ARE YOUR SURE YOU WANT TO DELETE RECORDS?", function (result) {
                if (result) {
                    if (controlID != null) {
                        var controlToClick = document.getElementById(controlID);
                        if (controlToClick != null) {
                            confirmed = true;
                            controlToClick.click();
                            confirmed = false;
                        }
                    }
                }

            });

            return false;

        }

    </script>

    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
            font-family: Arial;
        }

        .loadingmodal {
            position: fixed;
            z-index: 999 !important;
            height: 100%;
            width: 100%;
            top: 0;
            background-color: white;
            filter: alpha(opacity=60);
            opacity: 0.8;
            -moz-opacity: 1;
        }

        .loadingcenter {
            z-index: 1000 !important;
            width: 200px;
            height: 100px;
            position: absolute;
            left: 45%;
            top: 60%;
            margin-left: -150px;
            margin-top: -150px;
            opacity: 1;
            /*-moz-opacity: 1;*/
            background: url("Images/loading.gif") no-repeat;
        }
    </style>

</asp:Content>
<asp:Content ID="cotMain" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upnlwzEmailDocument">
        <ProgressTemplate>
            <div class="loadingmodal">
                <div class="loadingcenter">
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="upnlwzEmailDocument" UpdateMode="Always" runat="server">
        <ContentTemplate>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_content">

                            <asp:HiddenField ID="hdnRecordId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnRecordIds" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnRowIndex" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnEquipmentId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnBiometricIPAddress" Value="" runat="server" />
                            <asp:HiddenField ID="hdnUpdatedUsers" Value="" runat="server" />
                            <asp:HiddenField ID="hdnUpdatedCardNo" Value="" runat="server" />
                            <asp:HiddenField ID="hdnBranchId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnOldSelectedUsers" Value="0" runat="server" />

                            <asp:HiddenField ID="hdncomments" Value="0" runat="server" />

                            <div class="x_title">
                                <h4>
                                    <asp:Label ID="lblFormTitle" runat="server"></asp:Label></h4>
                                <div class="clearfix"></div>
                            </div>
                            <div id="wizard" class="form_wizard wizard_horizontal">
                                <ul class="wizard_steps">
                                    <li>
                                        <a runat="server" id="aStep1" class="selected">
                                            <span class="step_no">1</span>
                                            <small>Search Records</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a runat="server" id="aStep2" class="disabled">
                                            <span class="step_no">2</span>
                                            <small>Manage Records</small>
                                            </span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <div class="col-xs-12 col-sm-12 col-lg-12">
                                <ucToolBar:ucToolBar runat="server" ID="ucToolBar" DisplaySave="N" DisplaySaveAs="N" DisplayAdd="N" DisplayPrint="N" DisplayDelete="N" />
                            </div>
                            <div class="col-xs-12 col-sm-12 col-lg-12">
                                <asp:Wizard ID="wzMain" CssClass="col-sm-12" DisplaySideBar="false" OnActiveStepChanged="wzMain_ActiveStepChanged"
                                    runat="server" class="form_wizard wizard_horizontal">
                                    <WizardSteps>
                                        <asp:WizardStep ID="Step0" runat="server">
                                            <div id="dvControl" runat="server" style="width: 100%; overflow: auto; position: relative; overflow-x: hidden">
                                                <ucSearchGrid:ucSearchGrid runat="server" ID="ucSearchGrid" />
                                            </div>
                                        </asp:WizardStep>
                                        <asp:WizardStep ID="Step1" runat="server">
                                            <div class="row">
                                                <div class="col-xs-12 col-sm-12 col-lg-6">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Equipment Name</span>
                                                        <asp:TextBox ID="txtEquipmentName" runat="server" class="form-control" AutoCompleteType="Disabled" autocomplete="off" ReadOnly="true" />
                                                    </div>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-6">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Equipment Type</span>
                                                        <asp:TextBox ID="txtEquipmentType" MaxLength="40" runat="server" class="form-control" AutoCompleteType="Disabled" autocomplete="off" ReadOnly="true" />
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-xs-12 col-sm-12 col-lg-6">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">IP Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                                        <asp:TextBox ID="txtEquipmentId" CssClass="form-control text-right" runat="server" AutoCompleteType="Disabled" autocomplete="off" ReadOnly="true" Style="text-align: left;" />
                                                    </div>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-6">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                                        <asp:TextBox ID="txtStatus" runat="server" class="form-control" AutoCompleteType="Disabled" autocomplete="off" ReadOnly="true" />
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="row">
                                                <div class="col-xs-12 col-sm-12 col-lg-6">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Upload File&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                                        <ajaxToolkit:AjaxFileUpload ID="fuplLogosmall" MaximumNumberOfFiles="1" AllowedFileTypes="pdf,doc,docx,p" runat="server" OnUploadComplete="fuplLogosmall_UploadComplete" />
                                                    </div>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-1">
                                                    <div class="input-group">
                                                        <asp:LinkButton runat="server" CssClass="btn btn-info" ID="btnLogoRefresh" OnClick="btnLogoRefresh_Click" ToolTip="CLICK REFRESH INCASE IMAGE IS NOT UPDATED"><i class="fa fa-refresh"></i></asp:LinkButton></span>
                                                    </div>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-5">
                                                    <p><b>(Note:- File formate should be .pdf,.doc or .docx)</b></p>
                                                </div>
                                            </div>


                                            <div class="row">

                                                <div class="col-xs-12 col-sm-12 col-lg-12">
                                                    <table id="tblHeader0" runat="server" width="100%" style="background-color: #b7ecd3" class="table table-bordered dt-responsive nowrap ">
                                                        <tr>
                                                            <td style="width: 100%; text-align: Left">File Name</td>
                                                        </tr>
                                                    </table>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-12" style="height: 200px; overflow: auto">
                                                    <asp:GridView CssClass="table table-striped table-bordered table-hover" ID="grdViewUploadedFiles" AutoGenerateColumns="false" ShowHeader="false"
                                                        OnRowCommand="grdViewUploadedFiles_RowCommand" ViewStateMode="Enabled" DataKeyNames="EquipmentId" runat="server">
                                                        <EmptyDataRowStyle HorizontalAlign="Center" />
                                                        <EmptyDataTemplate>
                                                            No files have been uploaded
                                                        </EmptyDataTemplate>
                                                        <Columns>
                                                            <asp:BoundField DataField="EquipmentId" Visible="false" />
                                                            <asp:TemplateField HeaderText="File Name" HeaderStyle-CssClass="text-center">
                                                                <ItemTemplate>
                                                                    <asp:HyperLink Text='<%#Eval("DocumentFile") %>' CssClass="btn btn-link" NavigateUrl='<%#Eval("DocumentCaption") %>' Target="_blank" runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField>
                                                                <ItemStyle HorizontalAlign="Center" />
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="ibtDelete" CommandName="DeleteDoc" CommandArgument='<%# Eval("DocumentFile") %>' ImageUrl="~/Images/trash_bin.png" runat="server" ToolTip="Delete" OnClientClick="return ConfirmDelete(this.id);" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                </div>
                                            </div>


                                            <%--</br>
                                                <ucValidate:ucUserValidation runat="server" ID="ucUserValidation" />
                                            </br>--%>
                                            <asp:Button ID="btnSave" Visible="false" runat="server" Text="Save" CssClass="btn btn-primary btn-sm alignright" OnClick="btnSave_Click" />
                                        </asp:WizardStep>
                                    </WizardSteps>
                                    <StartNavigationTemplate>
                                        <asp:Button ID="btnNextButton" Visible="false" runat="server" Text="Next" CommandName="MoveNext" CssClass="btn btn-primary btn-sm" />
                                    </StartNavigationTemplate>
                                    <FinishNavigationTemplate>
                                        <br />
                                        <asp:Button ID="btnPrevious" runat="server" formnovalidate="true" Text="Previous" CssClass="btn btn-success btn-sm" ToolTip="MOVE BACK TO PREVIOUS SCREEN" CommandName="MovePrevious" />
                                    </FinishNavigationTemplate>
                                </asp:Wizard>
                            </div>

                        </div>


                    </div>
                </div>
            </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

