<%@ page language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_Support_Utility_Gallery_View_Category, App_Web_djui4w5k" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
            height: 100%;
        }

        .modal {
            display: none;
            position: absolute;
            top: 0px;
            left: 0px;
            background-color: black;
            z-index: 100;
            opacity: 0.8;
            filter: alpha(opacity=60);
            -moz-opacity: 0.8;
            min-height: 100%;
        }

        #divImage {
            display: none;
            z-index: 9999999;
            position: fixed;
            top: 0 !important;
            left: 0 !important;
            background-color: White;
            height: 100%;
            width: 600px;
            padding: 3px;
            border: solid 1px black;
            background: #33333375;
            width: 100%;
        }
    </style>
    <asp:UpdatePanel ID="StockIssueUpdatePanel" runat="server">

        <ContentTemplate>
            <asp:HiddenField ID="IsHidden" Value="0" runat="server" />
            <cc1:ModalPopupExtender ID="ImageExtender" runat="server" TargetControlID="HidenButton"
                PopupControlID="DetailPanel1" BackgroundCssClass="modalBackground" DropShadow="false" />
            <asp:LinkButton runat="server" ID="HidenButton" />
            <asp:Panel ID="PhotoMasterPopippanel" runat="server" Width="600px" BorderWidth="0"
                CssClass="confirmationPanel card card-box">
                <asp:Panel ID="DetailPanel1" runat="server" Width="600px" meta:resourcekey="DetailPanelResource1">
                    <div class="himssuHeaderconfirmWireBox">
                        <div class="himsBoxHeader card-head text-center">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="fLeft headerText" style="visibility: hidden">
                                    <header>Image Viewer</header>
                                </div>
                                <div class="windowcloseButton">
                                    <asp:ImageButton runat="server" ID="CloseButton" CssClass="fRight" ToolTip="Close"
                                        ImageUrl="~/Images/closebox.png" />
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent">
                            <div class="contentHolder">
                                <asp:Image ID="ImageViewer" runat="server" Visible="false" />

                                <asp:Button runat="server" ID="CancelButton" Text="&#xf00d; Cancel" OnClick="CancelButton_Click"
                                    Visible="false" CssClass="btn btn-cancel fas" />
                            </div>
                        </div>
                    </div>
                </asp:Panel>
            </asp:Panel>
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="157"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader1WireBox card card-box">
                        <div class="himsBoxHeader card-head" id="Div2" runat="server" visible="True">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="gridHeaderText fLeft">
                                    <header>
                                        <i class="fas fa-eye"></i>
                                        <asp:Label ID="Label1" Text="View Category" runat="server" Font-Bold="True" />
                                    </header>
                                </div>

                                <div class="fRight mt-27">
                                    <asp:Button ID="AddCategoryButton" runat="Server" OnClick="AddCategory_Click" SkinID="0"
                                        class="btn btn-add fas" Text="&#xf067; Add" />
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <div class="contentHolder">
                                <div class="himssuHeader1WireBox box-body box-solid">
                                    <div class="himsBoxContent">
                                       <div class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="BatchLabel" runat="server" Text="Batch" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="BatchYearDropDownList" SkinID="CustomWidthDropDownList"
                                                        AutoPostBack="true" class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                        </div>
                                        <div class="col-md-12 bg-lghtgrey radiobtn">
                                            <div class="col-md-3 controlLabelWidth">
                                                <asp:RadioButtonList ID="ViewTypeRadioButtonList" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="ViewTypeRadioButtonList_SelectedIndexChanged" AutoPostBack="true">
                                                    <asp:ListItem Text="List View" Value="1" Selected="True"></asp:ListItem>
                                                    <asp:ListItem Text="Grid View" Value="2"></asp:ListItem>
                                                </asp:RadioButtonList>
                                            </div>
                                        </div>
                                        <div class="outerBox col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="SourceTypeLabel" Text="Source Type" runat="server" SkinID="MandatoryLabel" Visible="false"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:DropDownList ID="SourceTypeDropDownList" runat="server" CssClass="form-control" OnSelectedIndexChanged="SourceTypeDropDownList_SelectedIndexChanged" AutoPostBack="true" Visible="false"></asp:DropDownList>
                                            </div>
                                        </div>
                                        <div id="DataListDiv" runat="server" visible="false">
                                            <asp:DataList ID="dtlist" runat="server" CssClass="" RepeatColumns="8"
                                                CellPadding="0" OnItemDataBound="dtlist_OnItemDataBound"
                                                RepeatDirection="Horizontal">
                                                <ItemTemplate>
                                                    <div style="padding-bottom: 10px; padding-top: 10px;" class="gallery5">
                                                        <asp:Panel ID="Panel1" runat="server" Height="125px" Width="127px" CssClass="panel">
                                                            <asp:ImageButton Width="120" Height="120" ID="ImageButton1" ImageUrl='<%# Bind("PhotoPath") %>'
                                                                PostBackUrl='<%# Bind("PhotoPageUrl") %>' runat="server" CssClass="zoomin" BorderWidth="0" />
                                                        </asp:Panel>
                                                        <asp:HyperLink ID="HyperLink1" Text='<%# Bind("CategoryName") %>' NavigateUrl='<%# Bind("CategoryPageUrl") %>' runat="server" />
                                                        <asp:Label ID="PhotoCount" runat="server" Text='<%# Bind("PhotoCount") %>'></asp:Label>
                                                    </div>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center"
                                                    VerticalAlign="Bottom" />
                                            </asp:DataList>
                                        </div>
                                        <div class="outerBox col-md-12" id="DeleteImages" runat="server" visible="false">
                                            <div class="controlLabelWidth">
                                            </div>
                                            <div class="fLeft pRight5">

                                              
                                                 <asp:Button ID="DeleteImagesButtonID" runat="server" OnClick="DeleteImagesButtonID_Click"
                                                meta:resourcekey="ClearButtonResource1" Text="&#xf2ed; Delete Images" CssClass="btn-delete btn fas" SkinID="0" OnClientClick="return confirmation();" />
                                            </div>
                                        </div>
                                        <div id="GridViewDiv" runat="server" visible="false">
                                            <asp:GridView ID="ViewCategoryGridView" runat="server" AutoGenerateColumns="False" EmptyDataText="No records found"
                                                OnRowDataBound="ViewCategoryGridView_RowDataBound" DataKeyNames="Id,CreatedDateTime,OrgGroupBatchId" CssClass="table table-striped table-bordered table-hover">
                                                <Columns>
                                                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
                                                        <HeaderTemplate>
                                                            <label class="rt-chkbox rt-chkbox-outline">
                                                                <asp:CheckBox ID="HeaderSelectCheckBox" runat="server" onclick="CheckAll(this);" />
                                                                <span></span>
                                                            </label>
                                                        </HeaderTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        <ItemTemplate>
                                                            <label class="rt-chkbox rt-chkbox-outline">
                                                                <asp:CheckBox ID="SelectCheckBox" runat="server" />
                                                                <span></span>
                                                            </label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Category Name" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="CategoryNameHyperLink" Text='<%# Bind("CategoryName") %>' NavigateUrl='<%# Bind("CategoryPageUrl") %>' runat="server" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="CreatedDateTime" HeaderText="Date Time" DataFormatString="{0:dd/MM/yyyy hh:mm tt}" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
                                                    <asp:BoundField DataField="PhotoCount" HeaderText="No Of Photos" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
                                                    <asp:BoundField DataField="ScopeSourceType" HeaderText="Assign Type (Source)" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="40%" />
                                                    <asp:BoundField DataField="PhotoCategorySize" HeaderText="Total Size" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
                                                    <asp:TemplateField HeaderText="Photo" ItemStyle-Width="10%" ItemStyle-Wrap="true">
                                                        <ItemTemplate>
                                                            <asp:ImageButton Width="120" Height="120" ID="ImageButton1" ImageUrl='<%# Bind("PhotoPath") %>'
                                                               runat="server" />
                                                            <asp:Panel ID="Panel1" runat="server" Height="125px" Width="127px" CssClass="panel">
                                                                <%--<asp:imagebutton width="120" height="120" id="imagebutton1" imageurl='<%# Bind("photopath") %>' postbackurl='<%# Bind("photopageurl") %>'
                                                                     runat="server" cssclass="zoomin" borderwidth="0"  onclick="imagebutton1_click" OnClientClick="return LoadDiv(this.src);"/>--%>
                                                            </asp:Panel>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="UserName" HeaderText="User Name" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
                                                </Columns>
                                            </asp:GridView>
                                            <input type="hidden" id="myField" value="" />
                                            <div id="divBackground" class="modal">
                                            </div>
                                            <div id="divImage">
                                                <table style="height: 100%; width: 100%">
                                                    <tr>
                                                        <td valign="middle" align="center">
                                                            <img id="imgFull" alt="" src="" style="display: none; height: 55%; margin-top: 46px;" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="center" valign="bottom">
                                                            <input id="btnClose" type="button" class="btn btn-delete fas" value="&#xf00d; Close" onclick="HideDiv()" style="position: absolute; top: 9%; right: 29%;" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">
        function LoadDiv(url) {
            alert(url);
            var img = new Image();
            var bcgDiv = document.getElementById("divBackground");
            var imgDiv = document.getElementById("divImage");
            var imgFull = document.getElementById("imgFull");

            img.onload = function () {
                imgFull.src = img.src;
                imgFull.style.display = "block";

            };
            img.src = url;
            var width = document.body.clientWidth;
            if (document.body.clientHeight > document.body.scrollHeight) {
                bcgDiv.style.height = document.body.clientHeight + "px";
            }
            else {
                bcgDiv.style.height = document.body.scrollHeight + "px";
            }
            imgDiv.style.left = (width - 650) / 2 + "px";
            imgDiv.style.top = "150px";
            bcgDiv.style.width = "0px";

            bcgDiv.style.display = "block";
            imgDiv.style.display = "block";
            return false;
        }
        function HideDiv() {
            var bcgDiv = document.getElementById("divBackground");
            var imgDiv = document.getElementById("divImage");
            var imgFull = document.getElementById("imgFull");
            if (bcgDiv != null) {
                bcgDiv.style.display = "none";
                imgDiv.style.display = "none";
                imgFull.style.display = "none";
            }
        }
        function abc() {
            alert('Hello');
        }
    </script>
     <script type="text/javascript">
         function confirmation() {
             if (confirm("Are you sure you want to Delete?"))
                 return true;
             else return false;
         }
    </script>
    <%--<script data-main="../../../../JavaScript/rjs/encrypt/assign-organization-encrypt" src="../../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/assign-organization")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>
