<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderManage.aspx.cs" Inherits="JRAPI.Web.User.OrderManage" %>
<%@ Register src="Foot.ascx" tagname="Foot" tagprefix="uc2" %>
<%@ Register Src="Top.ascx" TagName="Top" TagPrefix="uctop" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>订单管理</title>    
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="js/command.js" type="text/javascript"></script>
    <script src="../DatePicker/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".showOther").parent().parent().next().hide();
            $(".showOther").click(function () {
                $obj = $(this).parent().parent().next();
                if ($obj.is(':hidden')) {
                    $obj.show();
                }
                else {
                    $obj.hide();
                }

            });
            $(".linkid").click(function () {
                var txt = $(this).text();
                copyToClipboard(txt);
            });
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <uctop:Top ID="top1" runat="server" hoverNum="2"/>
    <div id="content">
        <div class="box" id="ddgl">
            <p class="title">
                <b>订单管理</b></p>
            <div class="cxtj">
                <div class="time">
                <ul>
                    <li>
                    <span>起始时间</span><asp:TextBox ID="txtStartTime" runat="server" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" CssClass="Wdate"></asp:TextBox>
                    <span>结束时间</span><asp:TextBox
                        ID="txtEndTime" runat="server" onClick="WdatePicker({startDate:'%y-%M-01 23:59:59',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" CssClass="Wdate"></asp:TextBox>
                         <span>订单类型</span><asp:DropDownList ID="dpdPayType" runat="server"><asp:ListItem Value="0">所有</asp:ListItem>
                    <asp:ListItem Value="1">网银</asp:ListItem>
                    <asp:ListItem Value="2">点卡</asp:ListItem>
                    <asp:ListItem Value="3">支付宝</asp:ListItem>
                    <asp:ListItem Value="4">财付通</asp:ListItem>
                    <asp:ListItem Value="5">微信</asp:ListItem>
                </asp:DropDownList> 

                    </li>
                </ul>
                    <ul>
                    <li>
                    <span>使用通道</span><asp:DropDownList ID="dpdChannel" runat="server" style="border: solid 1px #CCCCCC" AppendDataBoundItems="True"><asp:ListItem Value="0">选择通道</asp:ListItem>
                    </asp:DropDownList> 订单状态<asp:DropDownList ID="dpdStatus" runat="server" style="border: solid 1px #CCCCCC">
                        <asp:ListItem Value="-1">选择状态</asp:ListItem>
                        <asp:ListItem Value="0">支付中</asp:ListItem>
                        <asp:ListItem Value="1" Selected>成功</asp:ListItem>
                        <asp:ListItem Value="2">失败</asp:ListItem>
                    </asp:DropDownList>
                    <span>下发状态</span><asp:DropDownList ID="dpdSendStatus" runat="server" style="border: solid 1px #CCCCCC">
                        <asp:ListItem Value="-1">选择状态</asp:ListItem>
                        <asp:ListItem Value="0">处理中</asp:ListItem>
                        <asp:ListItem Value="1">成功</asp:ListItem>
                        <asp:ListItem Value="2">失败</asp:ListItem>
                    </asp:DropDownList>
                    </li>
                    </ul>
                      <ul>
                        <li>
                            <span>订单流水</span><asp:TextBox  ID="BillNO" runat="server" style="border: solid 1px #CCCCCC"></asp:TextBox>
                    <span>商户流水</span><asp:TextBox ID="LinkID" runat="server" style="border: solid 1px #CCCCCC"></asp:TextBox>
                    <span>充值卡号</span><asp:TextBox ID="txtCard" runat="server" style="border: solid 1px #CCCCCC"></asp:TextBox>
                    <asp:Button ID="btnSearch" style="float: right; height:35px" 
                        class="btn" runat="server" Text="开始查询" onclick="btnSearch_Click" />
                        
                        </li>
                      </ul> 
                      <ul>
                      <!---<li style="margin-top:5px;"><asp:Button ID="btnSaveExcel" style="float: right; height:35px" class="btn" 
                                runat="server" Text="导出Excel" onclick="btnSaveExcel_Click"  /></li>
                      </ul>
                      <ul>--->
                        <li>
                            订单总额:<font color=red><%=orderAllRealMoney %></font>&nbsp;&nbsp;总分成:<font color=red><%=orderAllUserMoney%></font>
                            
                        </li>
                      </ul>
                     </div>
               
            </div>
                <table class="table">
                    <tr>
                        <th>
                            商户流水号
                        </th>
                        <th>
                            订单金额
                        </th>
                        <th>
                            实际金额
                        </th>
                        <th>
                            用户金额
                        </th>
                        <th>
                            支付通道
                        </th>
                        <th>
                            支付时间
                        </th>
                        <th>
                            订单状态
                        </th>
                        <th>
                            下发状态
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                    <asp:Repeater ID="repInfo" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td >
                                    <a href="javascript:void(0);" class="linkid"><%# Eval("LinkID")%></a>
                                </td>
                                <td>
                                    <%# Eval("OrderMoney")%>
                                </td>
                                <td>
                                    <%# Eval("Realmoney")%>
                                </td>
                                <td>
                                    <%# Eval("UserMoney")%>
                                </td>
                                <td>
                                    <%# Eval("ChannelName")%>
                                </td>
                                <td>
                                    <%# Eval("PayDate")%>
                                </td>
                                <td align="center">
                                    <%# JRAPI.Common.pub.getOrderStatus(Convert.ToInt32(Eval("OrderStatus")))%>
                                </td>
                                <td align="center">
                                    <%# JRAPI.Common.pub.getSendStatus(Convert.ToInt32(Eval("SendStatus")))%>
                                </td>
                                <td>
                                    <a href="javascript:void(1);" class="showOther">详细</a>&nbsp;<%# (Convert.ToInt32(Eval("OrderStatus")) > 0 && Convert.ToInt32(Eval("SendStatus"))>0) ? "|&nbsp;<a href=\"orderSend.aspx?orderid=" + Eval("OrderID") + "\"><font color=blue>订单重发</font></a>" : ""%>
                                </td>
                            </tr>
                            <tr><td colspan="9" style=" text-align:left; text-indent:100px; background-color:#efffff"><font color="red">详细信息：</font>商户号：<%# Eval("UserID") %>&nbsp;&nbsp;系统流水号：<%#Eval("BillNO")%><%#Eval("PayType").ToString() == "2" ? "&nbsp;&nbsp;卡号：<a href=\"javascript:void(0);\" class=\"linkid\">" + Eval("CardNumber") + "</a>&nbsp;&nbsp;卡密：" + Eval("CardPass"): ""%>
                            &nbsp;&nbsp;<%# Eval("OrderStatus").ToString() == "2" ? "上级网关错误信息:<font color=red>" + Eval("GateMsg") + "</font>" : ""%>&nbsp;&nbsp;<%# Convert.ToInt32(Eval("OrderStatus")) > 0?"订单完成时间:"+Eval("GiveDate"):"" %>
                            </td></tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            <tr class="tableB">
                                <th align="center">
                                    本页查询总计
                                </th>
                                <th>
                                    <b>
                                        <%=orderMoney%></b>
                                </th>
                                <th>
                                    <b>
                                        <%=orderRealMoney%></b>
                                </th>
                                <th>
                                    <b>
                                        <%=orderUserMoney%></b>
                                </th>
                                <th>
                                </th>
                                <th>
                                </th>
                                <th align="center">
                                    <input id="mylinkid" type="hidden" />
                                </th>
                                <th>
                                </th>
                                <th>
                                </th>
                            </tr>
                        </FooterTemplate>
                    </asp:Repeater>
                </table>
            
            <table runat="server" id="tbcount" visible="false">
                <tr>
                    <td style="line-height: 18px">
                    </td>
                </tr>
            </table>
            <!-- pagination -->
            <div class="page">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" LastPageText="尾页"
                    NextPageText="下一页" PrevPageText="上一页" AlwaysShow="True" PageSize="10" UrlPageIndexName="pageindex"
                    UrlPaging="False" CustomInfoHTML="<span>共有%RecordCount%条数据,每页%PageSize%条,当前第%CurrentPageIndex%页,共%PageCount%页</span>"
                    ShowCustomInfoSection="Right" CssClass="pager" CustomInfoClass="results" CurrentPageButtonClass="current"
                    MoreButtonsClass="" Width="100%" PagingButtonLayoutType="UnorderedList" OnPageChanging="AspNetPager1_PageChanging"
                    NumericButtonCount="5">
                </webdiyer:AspNetPager>
            </div>
            <!-- end pagination -->
        </div>
    </div>
    <script type="text/javascript">        setTab('one', 2, 5);</script>
    <uc2:Foot ID="Foot1" runat="server" />
    </form>
</body>
</html>