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

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="Date" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/Common/Library/LibraryDetailBoxControl.ascx" TagName="LibraryControl" TagPrefix="Library" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/CommonSearch.ascx" TagName="CommonSearchUserControl" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl" TagPrefix="acc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="ResonMasterUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <style type="text/css">
                input:disabled + input[type=image], input:read-only + a {
                    pointer-events: visible;
                    cursor: pointer !important;
                }
            </style>
            <asp:HiddenField ID="PIdHiddenField" runat="server" Value="0" />
            <asp:HiddenField ID="IndexHiddenField" runat="server" Value="0" />
            <uc1:CommonSearchUserControl ID="CommonSearchControl" Visible="false" runat="server" />
            <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="174"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <Library:LibraryControl ID="LibraryUserControl" runat="server" Visible="true" />
                    <div class="himssuHeader5WireBox card card-box" id="SearchDiv" runat="server" visible="true">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="Panel1" runat="server">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="Label3" runat="server" Text="Search"></asp:Label>
                                        </header>
                                    </div>
                                    <div class="fRight mt-27">
                                        <asp:Button ID="AddNewButtonID" runat="server" OnClick="AddNewButton_Click" SkinID="0"
                                            class="btn btn-add fas" Text="&#xf067; Add" />
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="DetailPanel" runat="Server">
                                <div class="contentHolder">
                                    <asp:Panel ID="SearchCriteriaPanel" runat="Server">

                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="SearchNewsPaperLabel" runat="server" Text="Newspaper"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:DropDownList runat="server" ID="SearchNewsPaperDropDownList" SkinID="CustomWidthDropDownList"
                                                    CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="FromNewsDateLabel" runat="server" Text="From Newspaper Date"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <Date:DatePickerControl DisplayDatePicker="true" ID="FromNewsDatePickerControl" runat="server" />
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="ToNewsDateLabel" runat="server" Text="To Newspaper Date"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <Date:DatePickerControl DisplayDatePicker="true" ID="ToNewsDatePickerControl" runat="server" />
                                            </div>
                                        </div>

                                        <div class="alignCenter pTop5 col-md-12 center">
                                            <asp:Button ID="SearchButton" Text="&#xf002; Search" runat="Server" OnClick="SearchButton_Click"
                                                SkinID="0" class="btn-search btn fas" />
                                            <asp:Button ID="ResetButton" runat="server" Text="&#xf0e2; Reset" OnClick="ResetButton_Click" SkinID="0" class="btn-reset btn fas" />
                                            <asp:Button ID="ExportButton" runat="server" Text="&#xf093; Export" OnClick="ExportButton_Click" SkinID="0" class="btn-examcommon btn fas" />
                                            <%--<asp:Button ID="PrintMagazineReceiveButton" runat="server" Text="&#xf15b; Print" OnClick="PrintMagazineReceiveButton_Click" SkinID="0" class="btn-report btn fas"/>--%>
                                            <a href="javascript:;" onclick="OpenFileUpload();" class="btn btn-browser" id="BrowseButton" runat="server">
                                                <i class="fas fa-arrow-down"></i>Browse</a>
                                            <asp:FileUpload ID="flUpload" runat="server" onChange="readURL(this);" ClientIDMode="Static" Style="display: none;" />
                                            <asp:Button ID="ImportButton" runat="server" Text="&#xf019; Import" SkinID="0" class="btn-examcommon btn fas"
                                                OnClick="ImportButton_Click" />
                                            <asp:Label ID="Label2" runat="server" Text="" Style="padding-left: 10px; font-size: medium;"></asp:Label>
                                        </div>

                                    </asp:Panel>
                                    <div id="Div1" class="himssuHeader7WireBox" runat="server">
                                        <div id="NewspaperMasterGridViewDiv" visible="false" runat="server">

                                            <div class="himsBoxHeader card-head inner">
                                                <div class="leftdiv">
                                                </div>
                                                <div class="himsBoxTitle">
                                                    <div class="gridHeaderText" style="padding-left: 10px;">
                                                        <header>
                                                            <asp:Label ID="DetailLabel" runat="server" Text="Newspaper List"></asp:Label>
                                                        </header>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="himsBoxContent col-md-12 pTop10">
                                                <asp:UpdatePanel ID="MenuPlanDetailUpdatePanel" runat="server" UpdateMode="Always">
                                                    <ContentTemplate>
                                                        <div id="Div5" runat="server" visible="false" class="table-responsive">
                                                            <asp:GridView ID="NewspaperMasterGridView" runat="server" AutoGenerateColumns="False"
                                                                OnRowDataBound="NewspaperMasterGridView_RowDataBound" OnPageIndexChanging="NewspaperMasterGridView_PageIndexChanging"
                                                                AllowPaging="false" SkinID="" ShowHeader="True" PagerSettings-Visible="false"
                                                                DataKeyNames="Id" EmptyDataText="No records Found !!!" CssClass="table table-striped table-bordered table-hover">
                                                                <Columns>
                                                                    <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="EditLinkButton" runat="server" CommandName="Select" OnClick="LinkButton_Click"
                                                                                Text="Select" CausesValidation="false"></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Newspaper Name" ItemStyle-Width="10%" SortExpression="Newspaper Name"
                                                                        HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="NewsPaperNameLabel" runat="server" Text='<%# Bind("NewsPaperName") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Newspaper Language" ItemStyle-Width="15%" SortExpression="Newspaper Language"
                                                                        HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="NewsPaperLanguageLabel" runat="server" Text='<%# Bind("NewsPaperLanguage") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="News Type" ItemStyle-Width="10%"
                                                                        HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="NewsTypeLabel" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"NewsTypeId").ToString()=="1"? "Daily":DataBinder.Eval(Container.DataItem,"NewsTypeId").ToString()=="2"?"Weekly":"Monthly"  %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Newspaper Date" ItemStyle-Width="10%"
                                                                        HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="LanguageLabel" runat="server" Text='<%# Bind("NewsPaperDate" ,"{0:dd/MM/yyyy}") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>

                                                                    <asp:TemplateField HeaderText="No Of Copy" ItemStyle-Width="10%"
                                                                        HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="NoOfCopyLabel" runat="server" Text='<%# Bind("NoOfCopy") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <%-- add by megha for mentis 0026664 --%>
                                                                    <asp:TemplateField HeaderText="NewsPaper Amount" ItemStyle-Width="10%"
                                                                        HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="NewsPaperAmountLabel" runat="server" onkeypress="javascript:return MaskDecimal(event,8,2)" Text='<%# Bind("NewsPaperAmount") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>

                                                                </Columns>
                                                            </asp:GridView>
                                                        </div>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                    <div class="himssuHeader1WireBox card card-box" id="DetailDiv" runat="server" visible="false">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <i class="far fa-newspaper"></i>
                                        <asp:Label ID="MagazineMasterLabel" runat="server" Text="Newspaper Log"></asp:Label>
                                    </header>
                                </div>
                            </div>
                            <div class="fRight mt-27 pagination display-flex">
                                <table>
                                    <tr>
                                        <td class="formLabel">
                                            <div id="NumberOfRecordDiv" runat="server" visible="true">
                                                <asp:LinkButton AlternateText="First page" ToolTip="First page" ID="FirstRecordImageButton"
                                                    runat="server" ImageUrl="~/Images/arrowLlast.gif" CommandName="Page" CommandArgument="First"
                                                    OnClick="FirstRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-fast-backward"></i>
                                                </asp:LinkButton>
                                                <asp:LinkButton AlternateText="Previous page" ToolTip="Previous page" ID="PreviousImageButton"
                                                    runat="server" ImageUrl="~/Images/arrowLeft.gif" CommandName="Page" CommandArgument="Prev"
                                                    OnClick="PreviousImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-play fa-rotate-180"></i>
                                                </asp:LinkButton>
                                                &nbsp; &nbsp;
                                                            <asp:Label ID="LabelPage" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                                <asp:Label ID="ReCordNumber" Font-Bold="true" SkinID="Dummy" runat="server"></asp:Label>
                                                <asp:Label ID="ofLabel" Text="of" runat="server" />
                                                <asp:Label ID="TotalRecord" runat="server" />
                                                &nbsp; &nbsp;
                                                            <asp:LinkButton AlternateText="Next page" ToolTip="Next page" ID="NextImageButtom"
                                                                runat="server" ImageUrl="~/Images/arrowRight.gif" CommandName="Page" CommandArgument="Next"
                                                                OnClick="NextImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-play"></i>
                                                            </asp:LinkButton>
                                                <asp:LinkButton AlternateText="Last page" ToolTip="Last page" ID="LastRecordImageButton"
                                                    runat="server" ImageUrl="~/Images/arrowRLast.gif" CommandName="Page" CommandArgument="Last"
                                                    OnClick="LastRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-fast-forward"></i>
                                                </asp:LinkButton>
                                            </div>
                                        </td>
                                        <td>&nbsp; &nbsp;
                                            <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0"
                                                class="btn btn-back fas" Text="&#xf30a;  Back" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <div class="contentHolder">
                                <div class="tableContainer">
                                    <contenttemplate>
                                        
                                                    <div class="contentHolder">

                                                        <div class="tableContainer">
                                                             <asp:HiddenField ID="IsSingleEntryHiddenField" runat="server" />
                                                            <div ID="PnlBluckEntry" runat="server" visible="false">
                                                            
                                                                <div class="himsBoxHeader card-head inner" id="GridViewPagerDiv" runat="server">
                                                                    <div class="leftdiv">
                                                                    </div>
                                                                    <div class="himsBoxTitle">
                                                                         <div class="pull-right col display-flex ">
                                                                            <asp:DropDownList ID="AddGridDropDownList1" runat="server" SkinID="CustomWidthDropDownList"
                                                                                CssClass="form-control">
                                                                                <asp:ListItem Text="1" Value="0" Selected="True"></asp:ListItem>
                                                                                <asp:ListItem Text="5" Value="5"></asp:ListItem>
                                                                                <asp:ListItem Text="10" Value="10"></asp:ListItem>
                                                                                <asp:ListItem Text="15" Value="15"></asp:ListItem>
                                                                            </asp:DropDownList>&nbsp;&nbsp;
                                                                           <asp:Button ID="AddButton" runat="server" SkinID="0" CssClass="btn btn-add fas" OnClick="AddButton_Click"
                                                                              Text=" Add" />
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                           
                                                                <div id="Div2" class="himssuHeader6WireBox pTop5  col-md-12" runat="server">
                                                                    <div class="himsBoxContent table-responsive">
                                                                        <asp:GridView ID="NewsPaperLogFormGridView" runat="server" AutoGenerateColumns="False"
                                                                            EmptyDataText="No Records Found !!" CssClass="table table-striped table-bordered table-hover"
                                                                            DataKeyNames="Id,NewsPaperId" OnRowDataBound="NewsPaperLogFormGridView_RowDataBound" >
                                                                            <Columns>
                                                                                <asp:TemplateField HeaderText="Newspaper">
                                                                                    <ItemTemplate>
                                                                                        <asp:DropDownList ID="NewsPaperListGridviewDropDownList" runat="server"  AutoPostBack="True" class="form-control" />
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle HorizontalAlign="Left" />
                                                                                    <ItemStyle Width="12%" Wrap="True" />
                                                                                </asp:TemplateField>

                                                                                  <asp:TemplateField HeaderText="Newspaper Date">
                                                                                    <ItemTemplate>
                                                                                       <Date:DatePickerControl DisplayDatePicker="true" ID="NewsPaperDateDatePickerControl" Text='<%# Bind("NewsPaperDate") %>'  runat="server" />
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle HorizontalAlign="Left" />
                                                                                    <ItemStyle Width="18%" Wrap="True" />
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="No Of Copy">
                                                                                    <ItemTemplate>
                                                                                         <asp:TextBox ID="NoOfCopyTextBox" MaxLength="500" runat="server" onkeypress="javascript:return isNumberKey(this)" SkinID="CustomWidthTextBox" Text='<%# Bind("NoOfCopy") %>' />
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle HorizontalAlign="Left" />
                                                                                    <ItemStyle Width="10%" Wrap="True" />
                                                                                </asp:TemplateField>
                                                                                  <asp:TemplateField HeaderText="NewsPaper Amount">
                                                                                    <ItemTemplate>
                                                                                         <asp:TextBox ID="NewsPaperAmountTextBox" runat="server" onkeypress="javascript:return MaskDecimal(event,8,2)" SkinID="CustomWidthTextBox" Text='<%# Bind("NewsPaperAmount") %>' />
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle HorizontalAlign="Left" />
                                                                                    <ItemStyle Width="10%" Wrap="True" />
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="Delete">
                                                                                    <ItemTemplate>
                                                                                        <asp:ImageButton SkinID="DeleteImage" ID="DeleteImageButton1" runat="server" CommandName="Select" OnClick="DeleteImageButton1_Click"
                                                                                            ToolTip="Delete" ImageUrl="../../../Images/icons/icon_delete.gif"  />
                                                                                        <%--<asp:ImageButton ID="DeleteImageButton1" runat="server" CommandArgument='<%# Eval("Id") %>'   ImageUrl="../../../Images/icons/icon_delete.gif" />--%>

                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                            <PagerSettings Visible="False" />
                                                                        </asp:GridView>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div ID="SingleEntry" runat="server" visible="false">
                                                                <asp:HiddenField ID="IdHiddenField" runat="server" />
                                        <asp:HiddenField ID="MaxRowHiddenField" runat="server" />
                                                                <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="NewsPaperLabel" runat="server" Text="Newspaper"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:DropDownList runat="server" ID="NewsPaperDropDownList" SkinID="CustomWidthDropDownList"
                                                    CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="NewspaperDateLabel" runat="server" Text="Newspaper Date"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <Date:DatePickerControl DisplayDatePicker="true" ID="NewspaperDateDatePickerControl" runat="server" />
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="NoOfCopyLabel" runat="server" Text="No Of Copy"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:TextBox DisplayDatePicker="true" ID="NoOfCopyTextBox" onkeypress="javascript:return isNumberKey(this)" runat="server" />
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="NewsPaperAmountLabel" runat="server" Text="NewsPaper Amount"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:TextBox ID="NewsPaperAmountTextBox" onkeypress="javascript:return MaskDecimal(event,8,2)" runat="server" />
                                            </div>
                                        </div>
                                                                </div>
                                                        </div>
                                                    </div>
                                                    
                                        </contenttemplate>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                </tr>
                    </table>
                   
            </div>
            </div>
            </div>       
            </td> </div> </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../JavaScript/rjs/encrypt/magazine-master-encrypt" src="../../JavaScript/rjs/require.js"></script>--%>
    <%-- <script data-main='<%=ResolveUrl("~/JavaScript/rjs/magazine-master")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/newspaper-log")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>

    <script type="text/javascript">
        function isNumberKey(evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            else {
                if (Number(evt.value + String.fromCharCode(charCode)) > 32767) {
                    return false;
                }
                return true;
            }
        }
    </script>
</asp:Content>
