<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.CustomersControl"
    CodeBehind="Customers.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="ToolTipLabel" Src="ToolTipLabelControl.ascx" %>
<div class="section-header">
    <div class="title">
        <img src="Common/ico-customers.png" alt="Customers" />
        Manage Customers
    </div>
    <div class="options">
        <asp:Button ID="SearchButton" runat="server" Text="Search" CssClass="adminButtonBlue"
            OnClick="SearchButton_Click" ToolTip="Search for customers based on the criteria below" />
        <asp:Button runat="server" Text="Export to XML" CssClass="adminButtonBlue" ID="btnExportXML"
            OnClick="btnExportXML_Click" ValidationGroup="ExportXML" ToolTip="Export customers list to a xml file" />
        <input type="button" onclick="location.href='CustomerAdd.aspx'" value="Add new" id="btnAddNew"
            class="adminButtonBlue" title="Add a new customer" />
    </div>
</div>
<table width="100%">
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblRegistrationFrom" Text="Registration from:"
                ToolTip="The registration from date for the search in Coordinated Universal Time (UTC)."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:TextBox runat="server" ID="txtStartDate" />
            <asp:ImageButton runat="Server" ID="iStartDate" ImageUrl="~/images/Calendar_scheduleHS.png"
                AlternateText="Click to show calendar" /><br />
            <ajaxToolkit:CalendarExtender ID="cStartDateButtonExtender" runat="server" TargetControlID="txtStartDate"
                PopupButtonID="iStartDate" />
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblRegistrationTo" Text="Registration to:"
                ToolTip="The registration to date for the search in Coordinated Universal Time (UTC)."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:TextBox runat="server" ID="txtEndDate" />
            <asp:ImageButton runat="Server" ID="iEndDate" ImageUrl="~/images/Calendar_scheduleHS.png"
                AlternateText="Click to show calendar" /><br />
            <ajaxToolkit:CalendarExtender ID="cEndDateButtonExtender" runat="server" TargetControlID="txtEndDate"
                PopupButtonID="iEndDate" />
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblEmail" Text="Email:" ToolTip="A customer Email."
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:TextBox ID="txtEmail" CssClass="adminInput" runat="server"></asp:TextBox>
        </td>
    </tr>
    <asp:PlaceHolder runat="server" ID="phUsername">
        <tr>
            <td class="adminTitle">
                <nopCommerce:ToolTipLabel runat="server" ID="lblUsername" Text="Username:" ToolTip="A customer username (if usernames are enabled)."
                    ToolTipImage="~/Administration/Common/ico-help.gif" />
            </td>
            <td class="adminData">
                <asp:TextBox ID="txtUsername" CssClass="adminInput" runat="server"></asp:TextBox>
            </td>
        </tr>
    </asp:PlaceHolder>
</table>
<p>
</p>
<asp:GridView ID="gvCustomers" runat="server" AutoGenerateColumns="False" Width="100%"
    OnPageIndexChanging="gvCustomers_PageIndexChanging" AllowPaging="true" PageSize="15">
    <Columns>
        <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" Visible="False"></asp:BoundField>
        <asp:TemplateField HeaderText="Email" ItemStyle-Width="20%">
            <ItemTemplate>
                <a href="customerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>" title="Edit customer details">
                    <%#Server.HtmlEncode(Eval("Email").ToString())%>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Name" ItemStyle-Width="20%">
            <ItemTemplate>
                <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>" title="Edit customer details">
                    <%#Server.HtmlEncode(Eval("FullName").ToString())%>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Username" ItemStyle-Width="20%">
            <ItemTemplate>
                <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>" title="Edit customer details">
                    <%#Server.HtmlEncode(Eval("Username").ToString())%>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>" title="Edit customer details">
                    Edit </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="IsAdmin" HeaderText="Is admin" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
        <asp:TemplateField HeaderText="Registration date" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("RegistrationDate")).ToString()%>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
