<%@ control language="C#" autoeventwireup="true" inherits="controls_admin_faq, controls.admin" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<div class="row">
    <div class="container">
        <div class="row">

            <div class="panel panel-primary">
                <!-- Default panel contents -->
                <div class="panel-heading">FAQ</div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-8">
                            <h4>FAQ Management</h4>
                        </div>
                        <div class="col-md-4 text-right">
                            <asp:LinkButton ID="btnNewQuestion" CssClass="glyphicon glyphicon-plus palette-add"
                                runat="server" OnClick="btnNewQuestion_Click" data-toggle="tooltip" title="Add">
                            </asp:LinkButton>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <asp:UpdatePanel ID="upFAQ" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:Panel ID="pnlGrid" runat="server">
                                        <div class="table-responsive">
                                            <asp:Repeater ID="rptFaq" runat="server">
                                                <HeaderTemplate>
                                                    <table class="dataTableGrid table table-bordered table-striped table-hover" data-page-length="15">
                                                        <thead>
                                                            <tr>
                                                                <th>Question</th>
                                                                <th>Answer</th>
                                                                <th>Display Order</th>
                                                                <th>Active</th>
                                                                <th class="optionCol">Edit</th>
                                                                <th class="optionCol">Remove</th>
                                                            </tr>
                                                        </thead> <tbody>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                   
                                                        <tr>
                                                            <td>
                                                                <%#DataBinder.Eval(Container, "DataItem.question")%>
                                                            </td>
                                                            <td>
                                                                <%#DataBinder.Eval(Container, "DataItem.answer")%>
                                                            </td>
                                                            <td>
                                                                <%#DataBinder.Eval(Container, "DataItem.sequence")%>
                                                            </td>
                                                            <td>
                                                                <%#DataBinder.Eval(Container, "DataItem.isActive")%>
                                                            </td>
                                                            <td class="optionCol">
                                                                <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%# Bind("recId") %>'
                                                                    CssClass="glyphicon glyphicon-edit palette-edit" OnClick="lnkEdit_Click"
                                                                    data-toggle="tooltip" title="Edit">
                                                                </asp:LinkButton>
                                                            </td>
                                                            <td class="optionCol">
                                                                <asp:LinkButton ID="lnkRemove" CssClass="glyphicon glyphicon-remove palette-remove"
                                                                    OnClientClick="return window.confirm('Are you sure wish to remove this item?');"
                                                                    runat="server" CommandArgument='<%# Bind("recId") %>' OnClick="lnkRemove_Click"
                                                                    data-toggle="tooltip" title="Remove">
                                                                </asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    
                                                </ItemTemplate>
                                                <FooterTemplate>
                                                    </tbody></table>
                                                </FooterTemplate>
                                            </asp:Repeater>
                                        </div>
                                    </asp:Panel>
                                    <asp:Panel ID="pnlForm" runat="server" Visible="false">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <hr />
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6 col-lg-offset-2 form-horizontal">
                                                <div class="col-sm-offset-4 col-sm-8">
                                                    <asp:ValidationSummary ID="ValidationSummary6" CssClass="alert alert-danger alert-dismissible" ShowMessageBox="false" runat="server" DisplayMode="BulletList"
                                                        Visible="true" ValidationGroup="faq" />
                                                    <asp:Panel ID="pnlResult" Width="100%" Visible="false" runat="server">
                                                        <div class="alert alert-warning alert-dismissible" role="alert">
                                                            <p>
                                                                <asp:Label ID="lblResult" runat="server"></asp:Label>
                                                            </p>
                                                        </div>
                                                    </asp:Panel>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-horizontal">
                                                    <div class="row">
                                                        <div class="col-sm-12">
                                                            <div class="form-group">
                                                                <label for="txtQuestion" class="col-sm-2 control-label">Question</label>
                                                                <div class="col-sm-10">
                                                                    <asp:TextBox runat="server" TextMode="MultiLine" CssClass="form-control" ID="txtQuestion"></asp:TextBox>
                                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" SetFocusOnError="true"
                                                                        ControlToValidate="txtQuestion" ValidationGroup="faq" Display="None"
                                                                        ErrorMessage="Missing: Question"></asp:RequiredFieldValidator>
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <label for="txtAnswer" class="col-sm-2 control-label">Answer</label>
                                                                <div class="col-sm-10">
                                                                    <asp:TextBox runat="server" TextMode="MultiLine" CssClass="form-control" ID="txtAnswer"></asp:TextBox>
                                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="true"
                                                                        ControlToValidate="txtAnswer" ValidationGroup="faq" Display="None"
                                                                        ErrorMessage="Missing: Answer"></asp:RequiredFieldValidator>
                                                                </div>
                                                            </div>

                                                            <div class="form-group">
                                                                <label for="ddSequence" class="col-sm-2 control-label">Display Order</label>
                                                                <div class="col-sm-2">
                                                                    <asp:DropDownList ID="ddSequence" runat="server" CssClass="form-control"></asp:DropDownList>

                                                                </div>
                                                            </div>


                                                            <div class="form-group">
                                                                <label for="chkActive" class="col-sm-2 control-label">Active</label>
                                                                <div class="col-sm-10">
                                                                    <asp:CheckBox runat="server" ID="chkActive" />

                                                                </div>
                                                            </div>

                                                        </div>

                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-12">
                                                            <div class="form-group">
                                                                <div class="col-sm-3 col-sm-offset-5">
                                                                    <asp:Button ID="btnSave" runat="server" CssClass="btn btn-info" Text="Save" ValidationGroup="faq" OnClick="btnSave_Click" data-toggle="tooltip" title="Save" />
                                                                    |
                                                                <asp:Button ID="btnCancel" runat="server" CssClass="btn btn-warning" Text="Back" OnClick="btnCancel_Click" data-toggle="tooltip" title="Back" />
                                                                </div>

                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </ContentTemplate>
                                <%--<Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
                                    <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                                    <ajax:AsyncPostBackTrigger ControlID="btnNewQuestion" EventName="Click" />
                                </Triggers>--%>
                            </asp:UpdatePanel>

                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

</div>
