<%@ page title="" language="C#" masterpagefile="~/Member/MyShopMasterPage.master" autoeventwireup="true" inherits="Member_MBF_MyGiftCards, WebApp_deploy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPHead" runat="Server">
    <style type="text/css">
        #tooltip
        {
            position: absolute;
            border: 1px solid #ccc;
            background: #333;
            padding: 2px;
            display: none;
            color: #fff;
        }
    </style>
    <script src="../Skin/CommStyle/js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var x = 100;
            var y = 20;

            $("a.tooltip").mouseover(function (e) {
                this.myTitle = this.title;
                this.title = "";
                var imgsrc = $("img", this).attr("bigimg");
                var imgTitle = this.myTitle ? "<br/>" + this.myTitle : "";
                var tooltip = "<div id='tooltip'><img src='" + imgsrc + "' alt='预览图'/>" + imgTitle + "<\/div>"; //创建div
                $("body").append(tooltip); //把它追加到文档中
                x = $("#tooltip").width();
                $("#tooltip").css({
                    "top": (e.pageY + y) + "px",
                    "left": (e.pageX - x) + "px"
                }).show("fast");   //设置x坐标和y坐标，并且显示
            }).mouseout(function () {
                this.title = this.myTitle;
                $("#tooltip").remove();  //移除 
            }).mousemove(function (e) {
                $("#tooltip").css({
                    "top": (e.pageY + y) + "px",
                    "left": (e.pageX - x) + "px"
                });
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="pageTitle">
        <font color="red">礼品卡管理</font></div>
    <br />
    <table class="SearchTableStyle">
        <tr>
            <td>
                <b>购买礼品卡</b>
            </td>
            <td colspan="4">
                <a href="MBF_BuyGiftCards.aspx">
                    <img title="点击购买礼品卡" alt="点击购买礼品卡" src="images/buygiftcard.jpg" /></a></b>
            </td>
        </tr>
    </table>
    <table class="SearchTableStyle">
        <tr>
            <td colspan="5">
                <b>我的礼品卡</b>&nbsp;&nbsp;<b></b>
            </td>
        </tr>
        <tr>
            <td style="width: 200px; padding-left: 20px;">
                礼品卡类别：<asp:DropDownList ID="DropType" OnSelectedIndexChanged="Search_OnClick" runat="server"
                    AutoPostBack="true">
                </asp:DropDownList>
            </td>
            <td style="width: 200px; padding-left: 20px;">
                面值：<asp:TextBox ID="txtFaceValueQuery" runat="server" OnTextChanged="Search_OnClick"
                    AutoPostBack="true"></asp:TextBox>
            </td>
            <td>
                开始日期：<asp:TextBox runat="server" ID="begindate" Width="75px" Height="16px" AutoPostBack="true"
                    OnTextChanged="Search_OnClick" />
            </td>
            <td>
                结束日期：
                <asp:TextBox runat="server" ID="EndDate" Width="75px" Height="16px" AutoPostBack="true"
                    OnTextChanged="Search_OnClick" />
            </td>
            <td>
                <asp:Button ID="sb" runat="server" Text="查 询" OnClick="Search_OnClick" />
            </td>
        </tr>
    </table>
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CardNumber"
        AllowPaging="True" PageSize="15" CssClass="tableHead">
        <Columns>
            <asp:BoundField ReadOnly="True" DataField="rowid" HeaderText="序号" ItemStyle-Width="60px">
            </asp:BoundField>
            <asp:BoundField ReadOnly="True" DataField="CardNumber" HeaderText="卡号" ItemStyle-Width="220px">
            </asp:BoundField>
            <asp:TemplateField HeaderText="密码" ItemStyle-Width="120px">
                <ItemTemplate>
                    <asp:Label ID="Password" runat="server" Text='<%#DisplayPwd(Eval("Password"),Eval("BuyID"),Eval("RecieveID")) %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="节日" ItemStyle-Width="160px">
                <ItemTemplate>
                    <asp:Label ID="FestivalName" runat="server" Text='<%#Eval("FestivalName") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="购买日期" ItemStyle-Width="160px">
                <ItemTemplate>
                    <asp:Label ID="BuyTime" runat="server" Text='<%#Eval("BuyTime") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="FaceValue" HeaderText="面值" ItemStyle-Width="100px"></asp:BoundField>
            <asp:BoundField DataField="Balance" HeaderText="余额" ItemStyle-Width="100px"></asp:BoundField>
            <asp:TemplateField HeaderText="查询" ItemStyle-Width="40px">
                <ItemTemplate>
                    <%#GetQueryUrl(Eval("FaceValue"), Eval("Balance"), Eval("CardNumber"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField ReadOnly="True" DataField="CouponAmount" HeaderText="已奖励" ItemStyle-Width="80px">
            </asp:BoundField>
            <asp:TemplateField HeaderText="购买者" ItemStyle-Width="100px">
                <ItemTemplate>
                    <asp:Label ID="BuyName" runat="server" Text='<%#GetUserName(Eval("BuyID")) %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="接收者" ItemStyle-Width="100px">
                <ItemTemplate>
                    <asp:Label ID="RecieveName" runat="server" Text='<%#GetUserName(Eval("RecieveID")) %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ReceiveEmail" HeaderText="接收者邮箱" ItemStyle-Width="140px">
            </asp:BoundField>
            <asp:TemplateField HeaderText="卡片" ItemStyle-Width="50px">
                <ItemTemplate>
                    <a href="javascript:void(0);" class="tooltip" title='礼品卡图片'>
                        <img alt='卡对应的图片' bigimg='../UpLoadFile/VIPCardPic/<%#Eval("Picture")%>' src='../UpLoadFile/VIPCardPic/<%#Eval("Picture")%>'
                            style="width: 20px; height: 15px" /></a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <table class="tableHearder" style="width: 98%">
                <tr>
                    <th>
                        序号
                    </th>
                    <th>
                        卡号
                    </th>
                    <th>
                        密码
                    </th>
                    <th>
                        节日
                    </th>
                    <th>
                        购买日期
                    </th>
                    <th>
                        面值
                    </th>
                    <th>
                        余额
                    </th>
                    <th>
                        奖励
                    </th>
                    <th>
                        购买者
                    </th>
                    <th>
                        接收者
                    </th>
                    <th>
                        接收者邮箱
                    </th>
                    <th>
                        礼品卡片
                    </th>
                </tr>
                <tr>
                    <td colspan="12">
                        没有符合查询条件的记录
                    </td>
                </tr>
            </table>
        </EmptyDataTemplate>
    </asp:GridView>
</asp:Content>
