<%@ Page Title="Price Caption Setting" Language="C#" MasterPageFile="~/SunMaster.Master"
    AutoEventWireup="true" CodeBehind="PriceCaptionSetting.aspx.cs" Inherits="SUNWEB.PriceCaptionSetting" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
        <ContentTemplate>
<%--            <table style="margin-left: 1%; width: 98%;">
                <tr>
                    <td style="font-size: medium; width: 50%; font-family: 'Open Sans', sans-serif; font-weight: bolder;">
                        PRICE CAPTION SETTING
                    </td>
                    <td>
                    <label for="validationCustom03">
                   <asp:Label ID="lblBranchAliasName" ForeColor="Gray" runat="server" Text="Branch Name"></asp:Label></label>
                   <asp:DropDownList ID="cmbBranches" CssClass="custom-select" runat="server" AutoPostBack="true"
                   OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged">
                   </asp:DropDownList>

                 </td>

                </tr>
            </table>--%>

      <div class="container-fluid px-2">
    <div class="row align-items-center">
        <!-- Left: Title -->
        <div class="col-md-6 col-12 mb-2">
            <h6>
                PRICE CAPTION SETTING
            </h6>
        </div>

        <!-- Right: Branch Dropdown -->
        <div class="col-md-6 col-12 text-md-end">
            <div class="form-group mb-0">
                <label class="form-label text-muted me-2" for="cmbBranches">
                    <asp:Label ID="lblBranchAliasName" runat="server" Text="Branch"></asp:Label>
                </label>
                <asp:DropDownList ID="cmbBranches" runat="server" 
                    CssClass="form-select d-inline-block w-auto"
                    AutoPostBack="true" OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged">
                </asp:DropDownList>
            </div>
        </div>
    </div>
</div>
<br />



            <div class="row" style="display:none">
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="form-row">
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <caption>
                                        <label for="validationCustom03">
                                        </label>
                                        <asp:TextBox ID="txtStartDt" class="form-control" runat="server" Visible="false"></asp:TextBox>
                                        <asp:CalendarExtender ID="calFirstDueDate" Format="yyyy-MM-dd" runat="server" TargetControlID="txtStartDt"
                                            PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>
                                    </caption>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <label for="validationCustom03">
                                    </label>
                                    <asp:TextBox ID="txtEndDt" class="form-control" runat="server" Visible="false"></asp:TextBox>
                                    <asp:CalendarExtender ID="CalendarExtender1" Format="yyyy-MM-dd" runat="server" TargetControlID="txtEndDt"
                                        PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                   
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <asp:Button ID="btnGetReports" runat="server" Text="Apply" CssClass="btn btn-primary"
                                        OnClick="btnGetReports_Click" Visible="false" OnClientClick="return validate()" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="simple-card" role="tabpanel" id="TabsID">
                <div class="tab-content" id="TabContent">
                    <div class="card">
                        <h7 class="card-header" style="background-color: #4c4c4c; color: White;">
                            PRICE CAPTION
                        </h7>
                        <div class="card-body">
                            <div class="form-group">
                                <div class="form-row">
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                        <label class="col-form-label">
                                            Price Caption Name</label>
                                        <asp:TextBox ID="txtPriceCaptionName" runat="server" class="form-control" autocomplete="off"> </asp:TextBox>
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                     <label class="col-form-label">
                                       </label>
                                        <asp:TextBox ID="txtPriceCaptionID" runat="server" class="form-control" ReadOnly="true" Visible="false" autocomplete="off"> </asp:TextBox>
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                        <label class="col-form-label">
                                            Price 1 Caption</label>
                                        <asp:TextBox ID="txtPrice1Caption1" runat="server" class="form-control" autocomplete="off"> </asp:TextBox>
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                        <label class="col-form-label">
                                            Price 2 Caption</label>
                                        <asp:TextBox ID="txtPrice1Caption2" runat="server" class="form-control" autocomplete="off"> </asp:TextBox>
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                        <label class="col-form-label">
                                            Price 3 Caption</label>
                                        <asp:TextBox ID="txtPrice1Caption3" runat="server" class="form-control" autocomplete="off"> </asp:TextBox>
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                        <label class="col-form-label">
                                            Price 4 Caption</label>
                                        <asp:TextBox ID="txtPrice1Caption4" runat="server" class="form-control" autocomplete="off"> </asp:TextBox>
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    </div>
                                </div>
                                <div>
                                    <asp:Button ID="btnSavePriceCaption" runat="server" class="btn btn-primary" Text="Save"
                                        OnClick="btnSavePriceCaption_Click" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <%--<div class="card">
                        <h7 class="card-header" style="background-color: #4c4c4c; color: White;">
                            PRICE CAPTION LIST
                        </h7>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table id="example" class="table table-striped table-bordered second" style="width: 100%">
                                    <tbody>
                                        <caption>
                                            <asp:Panel ID="Panel8" runat="server" BackColor="white" Height="180px" ScrollBars="Auto"
                                                Width="1500px">
                                                <asp:GridView ID="grdPriceCaption" runat="server" AutoGenerateColumns="False" EmptyDataRowStyle-CssClass="alert-dark"
                                                    Font-Size="15px" HeaderStyle-BackColor="RoyalBlue" EmptyDataText="No Record! "
                                                    DataKeyNames="ID" FooterStyle-BackColor="Green" FooterStyle-ForeColor="white"
                                                    Width="920px" AllowPaging="true" PageSize="150" BackColor="White" AllowSorting="true"
                                                    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" Height="180px" OnSelectedIndexChanged="OnSelectedIndexChanged">
                                                   
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="ID" Visible="true" ItemStyle-Width="15%">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblPriceCaptionID" runat="server" Text='<%#Eval("id") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Price Caption Name" ItemStyle-Width="30%">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblPriceCaptionname" runat="server" Text='<%#Eval("pricecaptionname") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="" ItemStyle-Width="15%">
                                                            <ItemTemplate>                                                                
                                                                <asp:LinkButton ID="hlinkEdit" runat="server" Font-Underline="true" ForeColor="Blue"
                                                                    CommandName="Select" CausesValidation="false" CommandArgument="<%# Container.DataItemIndex %>">Edit</asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <PagerStyle CssClass="gridview"></PagerStyle>
                                                    <FooterStyle BackColor="#006699" ForeColor="White"></FooterStyle>
                                                    <HeaderStyle BackColor="LightBlue" Font-Bold="True" ForeColor="Black"></HeaderStyle>
                                                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                                    <RowStyle ForeColor="#000066" />
                                                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                                                </asp:GridView>
                                            </asp:Panel>
                                        </caption>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>--%>

                    <div class="card">
    <div class="card-header text-white" style="background-color: #4c4c4c;">
        PRICE CAPTION LIST
    </div>

    <div class="card-body">
        <div class="table-responsive">
            <!-- Remove outer <table>, it's not needed -->
            <asp:Panel ID="Panel8" runat="server" Height="250px" ScrollBars="Auto">
                <asp:GridView ID="grdPriceCaption" runat="server" AutoGenerateColumns="False"
                    CssClass="table table-striped table-bordered"
                    Font-Size="15px" 
                    EmptyDataRowStyle-CssClass="alert alert-dark text-center"
                    EmptyDataText="No Record!" 
                    DataKeyNames="ID" BackColor="White"
                    AllowPaging="true" PageSize="150"
                    AllowSorting="true" HeaderStyle-BackColor="White"
                    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="3" Height="50px" Width="700px"
                    OnSelectedIndexChanged="OnSelectedIndexChanged">

                    <Columns>
                        <asp:TemplateField HeaderText="ID" ItemStyle-Width="15%">
                            <ItemTemplate>
                                <asp:Label ID="lblPriceCaptionID" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Price Caption Name" ItemStyle-Width="30%">
                            <ItemTemplate>
                                <asp:Label ID="lblPriceCaptionname" runat="server" Text='<%# Eval("pricecaptionname") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Action" ItemStyle-Width="15%">
                            <ItemTemplate>
                                <asp:LinkButton ID="hlinkEdit" runat="server"
                                    CommandName="Select" CausesValidation="false"
                                    CommandArgument="<%# Container.DataItemIndex %>"
                                    CssClass="btn btn-link text-primary p-0">Edit</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>

                    <PagerStyle CssClass="pagination justify-content-center" />
                    <%--<HeaderStyle CssClass="table-info font-weight-bold" />--%>
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
            </asp:Panel>
        </div>
    </div>
</div>


                </div>
            </div>
            <div>
                <h4>
                    &nbsp;<asp:Label ID="lblGreeting" runat="server"></asp:Label></h4>
              </div>
        </ContentTemplate>
    </asp:UpdatePanel>

     <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css?v=1.1" rel="stylesheet" />

    <!-- Bootstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />

<!-- Optional Bootstrap Icons -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet" />
</asp:Content>
