<%@ page title="" language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="RCC_Billing_Coupons, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolkit" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="UC" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Content" runat="Server">
    <div class="col-xs-12">
        <div class="card">
            <%--<div class="header">
                <h2>
                    <asp:Literal ID="Ltl_SubsInfo" runat="server" /></h2>
            </div>--%>
            <div class="body">
                <div id="Div_Listing" runat="server">
                    <%--Filter box--%>
                    <asp:Panel ID="Pnl_Filter_Coupons" runat="server" DefaultButton="Btn_Filter">
                        <div class="row">
                            <div class="panel-group search-panel" id="AS_Coupons" role="tablist" aria-multiselectable="true">
                                <div class="col-xs-12" role="tab" id="SH_Coupons">
                                    <div class="card">
                                        <div class="header" role="button" data-toggle="collapse" data-parent="#AS_Coupons" href="#<%= CSB_Coupons.ClientID%>" aria-expanded="true" aria-controls="SH_Coupons">
                                            <h3>
                                                <%= Resources.Content.GN0000395%>
                                            </h3>
                                        </div>
                                        <div id="CSB_Coupons" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_Coupons" aria-expanded="false">
                                            <div class="row">
                                                <div class="col-md-3 col-sm-6 col-xs-12" runat="server" id="TD_OwnerTitle">
                                                    <div class="form-group form-float">
                                                        <asp:DropDownList ID="DDL_Owner" runat="server" onchange="setOwnerCookie(this)"></asp:DropDownList>
                                                    </div>
                                                </div>

                                                <div class="col-md-3 col-sm-6 col-xs-12">
                                                    <div class="form-group form-float">
                                                        <div class="form-line">
                                                            <asp:TextBox ID="TxBx_CouponCodeFilter" runat="server"></asp:TextBox>
                                                            <asp:Label ID="Label1" runat="server" EnableViewState="false" Text="<%$ Resources:Content,CouponCode%>" class="form-label"></asp:Label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-md-3 col-sm-6 col-xs-12">
                                                    <div class="form-group form-float">
                                                        <asp:DropDownList ID="DDL_DiscountTypeFilter" runat="server">
                                                            <asp:ListItem Text="<%$ Resources:Content,SelectDiscountType%>" Value="-1" />
                                                            <asp:ListItem Text="<%$ Resources:Content, GN00001017 %>" Value="0"></asp:ListItem>
                                                            <asp:ListItem Text="<%$ Resources:Content, Fixed %>" Value="1"></asp:ListItem>
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="col-xs-12">
                                                    <div class="form-group form-float">
                                                        <asp:Button ID="Btn_Filter" runat="server" class="btn btn-primary waves-effect" Text="<%$ Resources:Content,GN0000391%>" CausesValidation="false" />
                                                        <asp:Button ID="Btn_Clear" Visible="false" class="btn btn-primary waves-effect" runat="server" CausesValidation="false" Text="<%$ Resources:Content,String289 %>" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </asp:Panel>

                    <%--Start button--%>
                    <div class="row Div_OpsRow" id="Div_OpsRow" runat="server">
                        <div class="col-xs-12">
                            <div class="card">
                                <div class="header">
                                    <h3><%= Resources.Content.GN00001320%></h3>
                                </div>
                                <div class="body">
                                    <asp:Button ID="BTN_AddCoupon" class="btn btn-primary waves-effect btnAction" runat="server" Text='<%$ Resources:Content,AddCoupon %>' />
                                </div>
                            </div>
                        </div>
                    </div>
                    <%--end button--%>

                    <div class="row">
                        <div class="col-xs-12">
                            <asp:GridView CssClass="table table-bordered table-striped table-hover" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
                                ID="GV_Coupons" AllowPaging="True" AllowSorting="true" runat="server" AutoGenerateColumns="False">

                                <Columns>
                                    <asp:TemplateField HeaderText='<%$ Resources:Content, CouponCode %>' SortExpression="CouponCode" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LB_CouponCode" runat="server" CommandName="ShowDetails" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField SortExpression="CouponType" HeaderText='<%$ Resources:Content,DiscountType%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                        <ItemTemplate>
                                            <asp:Literal ID="Ltl_DiscountType" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField SortExpression="DiscountValue" HeaderText='<%$ Resources:Content,DiscountValue%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                        <ItemTemplate>
                                            <asp:Literal ID="Ltl_DiscountValue" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField SortExpression="CouponExpiry" HeaderText='<%$ Resources:Content,ExpiryDate%>' HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                                        <ItemTemplate>
                                            <asp:Literal ID="Ltl_ExpiryDate" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText='<%$ Resources:Content,SPT002811%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="LB_Owner" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField SortExpression="IsActive" HeaderText='<%$ Resources:Content,GN0000222%>' HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                                        <ItemTemplate>
                                            <asp:Literal ID="Ltl_IsActive" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LB_EditCoupon" Text='<%$ Resources:Content,strEdit%>' CssClass="btn btn-primary waves-effect" CommandName="EditCoupon" runat="server" />
                                            <asp:LinkButton ID="LB_Delete" Text='<%$ Resources:Content,GN0000377%>' CssClass="btn btn-primary waves-effect btnAction" CommandName="DeleteRow" runat="server" />
                                            <AjaxToolkit:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,CBE001%>"
                                                TargetControlID="LB_Delete" runat="server">
                                            </AjaxToolkit:ConfirmButtonExtender>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <%--PagerTemplate Start--%>
                                <PagerTemplate>
                                    <UC:Pager ID="Pager1" runat="server" />
                                </PagerTemplate>
                                <%--PagerTemplate End--%>
                            </asp:GridView>
                        </div>
                    </div>
                </div>

                <div class="row" id="Div_CouponDetails" runat="server" visible="false">
                    <div class="col-xs-12">
                        <div class="card">
                            <div class="header">
                                <h2><%= Resources.Content.CouponDetails%></h2>
                            </div>
                            <div class="body">
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.CouponCode%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_CouponCode" runat="server">
                                    </div>
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.DiscountType%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_DiscountType" runat="server">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.DiscountValue%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_DiscountValue" runat="server">
                                    </div>
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.ExpiryDate%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_ExpiryDate" runat="server">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.GN0000222%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_IsActive" runat="server">
                                    </div>
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.DateCreated%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_DateCreated" runat="server">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.AddedBy%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_AddedBy" runat="server">
                                    </div>
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.LastUpdatedBy%>:</label>
                                    </div>
                                    <div class="col-sm-3 col-xs-12" id="Div_LastUpdatedBy" runat="server">
                                    </div>
                                </div>
                            </div>

                            <div class="header">
                                <h2><%= Resources.Content.CouponUseDetails%></h2>
                            </div>
                            <div class="body">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <asp:GridView CssClass="table table-bordered table-striped table-hover" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
                                            ID="GV_CouponUsed" AllowPaging="True" AllowSorting="false" runat="server" AutoGenerateColumns="False">

                                            <Columns>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000718 %>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                                    <ItemTemplate>
                                                        <asp:HyperLink ID="Ltl_InvoiceId" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,Customer%>' HeaderStyle-CssClass="col-xs-4" ItemStyle-CssClass="col-xs-4">
                                                    <ItemTemplate>
                                                        <asp:HyperLink ID="HL_Customer" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,USM0107%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                                    <ItemTemplate>
                                                        <asp:Literal ID="Ltl_InvoicedAmount" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,CouponAmount%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                                    <ItemTemplate>
                                                        <asp:Literal ID="Ltl_CouponAmount" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content,DiscountAmount%>' HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                                    <ItemTemplate>
                                                        <asp:Literal ID="Ltl_InvoiceDiscount" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <%--PagerTemplate Start--%>
                                            <PagerTemplate>
                                                <UC:Pager ID="Pager2" runat="server" />
                                            </PagerTemplate>
                                            <%--PagerTemplate End--%>
                                        </asp:GridView>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-xs-12">
                        <asp:Button ID="Btn_Close" runat="server" class="btn btn-primary waves-effect" Text="<%$ Resources:Content,GN000150%>" CausesValidation="false" />
                    </div>

                </div>
                <div class="row" id="Div_AddCoupon" runat="server" visible="false">
                    <div class="col-xs-12">
                        <div class="card">
                            <div class="header">
                                <h2>
                                    <asp:Literal ID="Ltl_CouponHeader" runat="server" Text='<%$ Resources:Content,AddCoupon %>' /></h2>
                            </div>
                            <div class="body">
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.CouponCode%>:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_CouponCode" runat="server" />
                                            </div>
                                        </div>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_CouponCode" runat="server" Display="None"
                                            SetFocusOnError="True" ValidationGroup="addcoupon" ControlToValidate="TxBx_CouponCode" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.DiscountType%>:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <asp:DropDownList ID="DDL_DiscountType" runat="server">
                                                <asp:ListItem Text="<%$ Resources:Content, GN00001017 %>" Value="0"></asp:ListItem>
                                                <asp:ListItem Text="<%$ Resources:Content, Fixed %>" Value="1"></asp:ListItem>
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.DiscountValue%>:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_DiscountValue" runat="server" />
                                            </div>
                                        </div>
                                        <asp:RequiredFieldValidator ID="RFV_TxBx_DiscountValue" runat="server" Display="None"
                                            SetFocusOnError="True" ValidationGroup="addcoupon" ControlToValidate="TxBx_DiscountValue" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label><%= Resources.Content.ExpiryDate%>:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <div class="form-line">
                                                <asp:TextBox ID="TxBx_ExpiryDate" runat="server" onkeydown='event.preventDefault();' Style="width: 200px">
                                                </asp:TextBox>
                                                <AjaxToolkit:CalendarExtender ID="CE_ExpiryDate" runat="server" TargetControlID="TxBx_ExpiryDate"
                                                    CssClass="date__calendar">
                                                </AjaxToolkit:CalendarExtender>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-xs-12 row-label">
                                        <label>*<%= Resources.Content.GN0000222%>:</label>
                                    </div>
                                    <div class="col-sm-4 col-xs-12">
                                        <div class="form-group">
                                            <asp:CheckBox ID="ChBx_IsActive" runat="server" Text="&nbsp;" />
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="col-xs-12">
                                        <asp:ValidationSummary HeaderText='<%$ Resources:Content,EM000001 %>' ID="ValidationSummary1"
                                            runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="addcoupon" />
                                        <asp:Button ID="Btn_Save" runat="server" class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content,GN0000281%>" ValidationGroup="addcoupon" />
                                        <asp:Button ID="Btn_Cancel" runat="server" CausesValidation="false" class="btn btn-primary waves-effect"
                                            Text="<%$ Resources:Content,GN0000572%>" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</asp:Content>
