<%@ Page Language="C#" Debug="true" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Kesion.NET.WebSite.Course.Admin_Course_CsOrderShow" Codebehind="KS.CsOrderShow.aspx.cs" %>

<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.APPCode" %>

<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="Server">
    <style>
        .categorynav {line-height: 25px;width: 97%;margin: 0 auto;margin-bottom: 10px;border: 1px solid #DEEFFA;background-color: #F7FBFE;padding: 5px 0px 5px 10px;height: 100%;overflow: hidden;}
        ul, li {padding: 0px;margin: 0px;}
        .categorynav li {width: 160px;float: left;}
        .cartbox .kb_box {border: 1px dashed #f7d6b2;width:100%; box-sizing:border-box;text-align: left;padding: 0px 15px 0px 35px;line-height: 40px;font-size: 12px;margin-bottom: -1px;background: #fefaf5 url(../yes.png) no-repeat 10px 50%;}
		.cartbox .kb_box b {color:#ed9a47;padding-left: 10px; font-weight:normal;}
		.cartbox .kb_box em {text-decoration: line-through;color: #999;}
		.cartbox .kb_box span {float: right;}
		.cartbox .kb_box a {font-size: 14px;}
		.cartbox .kb_box a:hover {color: #666;}
		.cartbox .kb_box:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;}
		.tabs_header li{ margin-left:0;}
    </style>

    <div class="content-area mt20">
        <script>
            var box = '';
            function showOrderDetail(logdeliverid, orderid) {
                var w = 800;
                box = jQuery.dialog.open("Course/KS.CosShowDelivery.aspx?logdeliverid=" + logdeliverid + "&orderid=" + orderid, {
                    title: '查看详情记录',
                    width: w,
                    height: 415,

                    cancelVal: '取消',
                    max: false,
                    min: false,
                    cancel: true /*为true等价于function(){}*/
                });
            }
        </script>
        <asp:Panel ID="ListPanel" runat="server" Width="100%">
            <div class="tabs_header">
                <input type="button" class="fr mr20 button" id="backBtn" value="返回" onclick="history.back(-1);" />
                <ul class="tabs">
                    <li <%=KSCMS.S("Status")==""?" class='active'":string.Empty %>><a href="#"><span>订单详情</span></a></li>
                </ul>
            </div>

            <div class="message top_message">
                订单编号：<asp:Label ID="LabOrderID" runat="server" Text="Label"></asp:Label>
                订单状态：  <%=Kesion.Course.CourseOrderService.GetCosOrderStatus(Utils.StrToInt(dr["Status"].ToString()),Utils.StrToInt(dr["DeliverStatus"].ToString()),Utils.StrToInt(dr["IsSendNote"].ToString()),Utils.StrToInt(dr["IsInvoice"].ToString()) ) %>
                <br />
                订单来源：<%=Utils.OrderDeviceName(Utils.StrToInt(dr["OrderDevice"].ToString())) %>
                
               <br/>付款方式/类型：
               <%=Kesion.Course.CourseOrderService.GetPayStatusType( Utils.StrToInt(dr["paystatus"].ToString()),Utils.StrToInt(dr["PaymentPlatId"].ToString()),Utils.StrToInt(dr["id"].ToString()),dr["courseOrder"].ToString(),1,Utils.StrToInt(dr["Status"].ToString()))%>
            </div>
            <table border="0" cellpadding="0" cellspacing="0" width="100%" class="mt20 md20 sTable no-borderTable" >
                <tr>
                    <td width="20"></td>
                    <td width="80">下单用户：</td>
                    <td width="300" style="text-align: left;"><asp:Label ID="LabUserName" runat="server" Text="Label"></asp:Label></td>
                    <td width="80">下单时间：</td>
                    <td width="200" style="text-align: left;">
                        <asp:Label ID="LabInputTime" runat="server" Text="Label"></asp:Label></td>
                    <td width="80">付款时间：</td>
                    <td style="text-align: left;"><%= dr["paytime"].ToString() %></td>
                </tr>
                <tr>
                    <td width="20"></td>
                    <td width="80">联系手机：</td>
                    <td width="300" style="text-align: left;"><%=dr["mobile"].ToString()%></td>
                    <td width="80">真实姓名：</td>
                    <td width="200" style="text-align: left;"><%= dr["realname"].ToString() %></td>
                    <td width="80">订单附言：</td>
                    <td style="text-align: left;">
                        <%= dr["remark"].ToString() %>
                    </td>
                </tr>
            </table>
            <%if (Utils.StrToInt(dr["IsSendNote"].ToString()) > 0)
             { %>
            <div class="tabs_header" <%= Utils.StrToInt(dr["IsSendNote"].ToString()) == 0?"style='display:none'":string.Empty %>>
                <ul class="tabs">
                    <li <%=KSCMS.S("Status") == "" ? " class='active'" : string.Empty %>>
                        <a href="#"><span>收件人信息</span></a></li>
                </ul>
            </div>
            <table border="0" cellpadding="0" cellspacing="0" class="CTable" <%= Utils.StrToInt(dr["IsSendNote"].ToString()) == 0?"style='display:none'":string.Empty %>>
                <tr>
                    <td width="100">收货人姓名：</td>
                    <td width="300" style="text-align: left;"><%= dr["RealName"].ToString() %></td>
                    <td width="100">联系电话：</td>
                    <td width="200" style="text-align: left;"><%= string.IsNullOrEmpty(dr["Mobile"].ToString())?dr["QQ"].ToString():dr["Mobile"].ToString() %></td>
                    <td width="100">电子邮箱：</td>
                    <td style="text-align: left;"><%= dr["Email"].ToString() %></td>
                </tr>
                <tr>
                    <td width="100">收货人地址：</td>
                    <td width="300" style="text-align: left;"><%= string.Concat(MyCache.GetAreaName(Convert.ToInt16(dr["ProvinceID"].ToString()), "city"), MyCache.GetAreaName(Convert.ToInt16(dr["CityID"].ToString()), "city"), MyCache.GetAreaName(Convert.ToInt16(dr["CountyID"].ToString()), "city"), dr["Address"].ToString()) %></td>
                    <td width="100">邮政编码：</td>
                    <td width="200" style="text-align: left;"><%= dr["ZipCode"].ToString() %></td>
                    <td width="100">送货方式：</td>
                    <td style="text-align: left;">
                        <%= Utils.StrToInt(dr["DeliverID"].ToString()) > 0 ? DataFactory.GetOnlyValue("select    DeliveryName from  KS_ProDelivery where DeliveryId=" + Utils.StrToInt(dr["DeliverID"].ToString())) : string.Empty %>

                    </td>
                </tr>
            </table>


            <%} %>
            <%if (Utils.StrToInt(dr["IsInvoice"].ToString()) > 0)
        { %>

            <div class="tabs_header" <%= Utils.StrToInt(dr["IsInvoice"].ToString()) == 0?"style='display:none'":string.Empty %>>
                <ul class="tabs">
                    <li class="active">
                        <a href="#"><span>发票信息</span></a></li>
                </ul>
            </div>
            <table border="0" cellpadding="0" cellspacing="0" class="CTable" <%= Utils.StrToInt(dr["IsInvoice"].ToString()) == 0?"style='display:none'":string.Empty %>>
                <tr class="CTitle">
                    <td style="text-align: left;"><b>发票信息</b> (<%=dr["Invoiced"].ToString() == "1" ? "<font color=greenFont>已开</font>" : "<font color=redFont>未开</font>" %>)</td>
                </tr>
                <tr>
                    <td style="text-align: left; height: 26px; padding: 2px 0px 0px 20px;">
                        <asp:Label ID="LabInvoice" runat="server" Text=""></asp:Label>
                    </td>
                </tr>

            </table>

            <%} %>

            <div class="tabs_header">
                <ul class="tabs">
                    <li <%=KSCMS.S("Status")==""?" class='active'":string.Empty %>>
                        <a href="#"><span>课程详情</span></a></li>
                </ul>
            </div>

            <asp:Repeater ID="Repeater2" runat="server" OnItemDataBound="Repeater2_ItemDataBound">
                <HeaderTemplate>
                    <table border="0" cellpadding="0" cellspacing="0" class="CTable">
                        <tr align="center" class="CTitle">
                            <td align="center"><b>课程名称</b></td>
                            <td align="center"><b>类型</b></td>
                            <td align="center"><b>发布者</b></td>
                            <td align="center"><b>返现金额</b></td>
                            <td align="center"><b>返现时间</b></td>
                            <td align="center"><b>赠送积分</b></td>
                            <!--<td align="center"><b>原价(元)</b></td>-->
                            <td align="center"><b>实价(元)</b></td>
                            <td align="center"><b>资料价格(元)</b></td>
                            <td align="center"><b>税金(元)</b></td>
                            <td align="center"><b>小计(元)</b></td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td class="splittd" align="left">
                            <table border='0' cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="60" height="70" align="center" class="img">
                                        <img onerror="this.src='<%=MyCache.GetCacheShopConfig(9) %>';" src="<%#Eval("photourl") %>" width='50' height='50' align='left' />
                                    </td>
                                    <td align="center">
                                        <a href="<%# Kesion.APPCode.Public.GetCosUrl(Utils.StrToInt(Eval("OrderFlag")),Utils.StrToInt(Eval("OrderType")),Utils.StrToInt(Eval("CourseID")),ref cosType,Utils.StrToInt(Eval("isBundleSale")),Utils.StrToInt(Eval("BindType"))) %>" target="_blank"><%# Eval("Cname") %></a><br />

                                        <div <%#Eval("PeriodIDs").ToString()==""?"style='display:none'":"" %>>

                                              <%#Kesion.Course.CourseOrderService.GetPeriodList(Eval("PeriodIDs").ToString(),Utils.StrToInt(Eval("CourseID"))) %>
                                       	</div>

                                          <div class="Caption" <%#Eval("orderflag").ToString()=="2"?"":"style='display:none'" %>>
                                          <asp:Repeater ID="RepeaterBind" runat="server" >
                                         <ItemTemplate>
											  <div style="display:none"><%# Kesion.APPCode.Public.GetBindUrl(Utils.StrToInt(Eval("BindType")),Utils.StrToInt(Eval("CourseID")),ref bindCosType) %></div>
                                           <div class="kb_box"><font class="redFont">【<%#bindCosType %>】</font><a href="<%#Kesion.APPCode.Public.GetBindUrl(Utils.StrToInt(Eval("BindType")),Utils.StrToInt(Eval("CourseID")),ref bindCosType) %>" target="_blank" title="<%# Eval("Cname") %> "><%# Eval("Cname") %></a></div>

                                            </ItemTemplate>
                                          </asp:Repeater>
                                         </div>


                                        <span <%# Convert.ToString(Eval("ordertype"))== "1" ?"style='color:red'":"style='display:none'" %>>课时时限<%#Eval("shixian") %>天</span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td align="center" class="splittd" style="width: 50px; text-align: center"><%#Gettype(Utils.StrToInt(Eval("ordertype").ToString())) %></td>
                        <td align="center" class="splittd" style="width: 85px; text-align: center"><%#Eval("business").ToString() %></td>
                        <td align="center" class="splittd" style="width: 85px;">
                            <%=MyCache.GetCurrencySymbol %><%# Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(Eval("PayDiscountMoney").ToString()))%>  <%=MyCache.GetCurrencyUnit %>
                        </td>
                        <td align="center" class="splittd" style="width: 85px;"><%# Eval("EffectiveDay")%>天</td>
                        <td align="center" class="splittd" style="width: 85px;"><%# Eval("ChangeScore")%>分</td>
                       <!-- <td align="center" class="splittd" style="width: 85px;"><%# Public.ReturnShopPrice(Convert.ToString(Eval("price")))%></td>-->
                        <td align="center" class="splittd" style="width: 85px;"><%# Public.ReturnShopPrice(Convert.ToString(Eval("OrderTotalPrice")))%></td>
                        <td align="center" class="splittd" style="width: 85px;"><%# Public.ReturnShopPrice(Eval("NotePrice"))%></td>
                        <td align="center" class="splittd" style="width: 85px;"><%# Public.ReturnShopPrice(Eval("TaxPrice"))%></td>
                        <td align="center" class="splittd" style="width: 85px;"><%# Public.ReturnShopPrice(Convert.ToString(Eval("TotalPrice")))%></td>
                    </tr>
                    <%#(Eval("IsBundleSale").ToString()=="1"?GetItem(Eval("orderid").ToString()):"") %>
                </ItemTemplate>
                <FooterTemplate>
                    </table> 
                </FooterTemplate>
            </asp:Repeater>
            <table border="0" cellpadding="0" cellspacing="0" class="CTable nTable" width="99%">
                <tr>
                    <td style="padding:3px; line-height:35px;" class="tdbg">
                    	<span class="mr20">
                            商品金额：
							<font class="greenFont"><%=MyCache.GetCurrencySymbol %><asp:Label ID="LabGoodsMoney" runat="server" Text="Label"></asp:Label>
                            <%=MyCache.GetCurrencyUnit %></font>
                        </span>
                        <span class="mr20">
                            资料：
							<font class="redFont"><%=MyCache.GetCurrencySymbol %><asp:Label ID="LabNotePrice" runat="server" Text="Label"></asp:Label>
                            <%=MyCache.GetCurrencyUnit %></font>
                        </span>
                        <span class="mr20">
                            税金：
							<font class="grayFont"><%=MyCache.GetCurrencySymbol %><asp:Label ID="LabelTaxPrice" runat="server" Text="Label"></asp:Label>
                            <%=MyCache.GetCurrencyUnit %></font>
                        </span>
         				优惠：   
                        <span class="orangeFont">
            
                             <%if (Utils.StrToFloat(dr["UserHongBaoMoney"].ToString()) > 0||Utils.StrToFloat(dr["UseCouponMoney"].ToString()) > 0||Utils.StrToFloat(dr["UserCahseMoney"].ToString())>0)
                                 { %>
                             <asp:Label ID="LabCouponTips" runat="server"></asp:Label>
                             <asp:Label ID="LabRedpacketTips" runat="server"></asp:Label>
                              <asp:Label ID="LabelUserCahseMoney" runat="server"></asp:Label>
                             <%}else {%>
            
                             <%=MyCache.GetCurrencySymbol %>0<%=MyCache.GetCurrencyUnit %>
                             <% } %>
                         </span>
                        <%if (Utils.StrToInt(dr["ScoreTF"].ToString())>0){ %>

                        <%}
            if (Utils.StrToInt(dr["orderscore"].ToString()) > 0)
            {
                Response.Write("&nbsp;&nbsp;<font class=greenFont>本单为积分兑换订单，已支付积分<font class=brownFont>" + dr["orderscore"].ToString() + "</font>分</font>");
            } %>
                        <br />
                        <%---优惠券金额--%>
                        订单金额：<span class="grayFont">商品金额-支付方式优惠+资料+税金＝</span><span class="orangeFont"><%=MyCache.GetCurrencySymbol %><asp:Label ID="LabNoUseCouponMoney" runat="server" Text="0"></asp:Label><%=MyCache.GetCurrencyUnit %></span></td>
                        <td class="tdbg" width="400" style="text-align: right">
                     &nbsp;订单金额：<span class="redFont"><%=MyCache.GetCurrencySymbol %><asp:Label ID="LabMoneyReceive" runat="server" Text="Label"></asp:Label></span><%=MyCache.GetCurrencyUnit %>
                    
                  
                    </td>
                </tr>

            </table>
            <br />

         <div class="tips">注:<font class="greenFont">“市场价”</font>指的是下单时的市场参考价格,<font class="redFont">“实价”</font>指的是系统自动计算出来的商品最终销售价格。“订单金额”指系统自动算出来的价格，本订单的最终价格以“应付金额”为准。</div>

        <br />
            <div class="tabs_header" <%=(Utils.StrToInt(dr["Status"].ToString()) == 1 && Utils.StrToInt(dr["DeliverStatus"].ToString())>0)?"":" style='display:none'" %>>
                <ul class="tabs">
                    <li <%=KSCMS.S("Status")==""?" class='active'":string.Empty %>>
                        <a href="#"><span>订单跟踪信息</span></a></li>
                </ul>
            </div>
            <asp:Repeater ID="Repeater3" runat="server">
                <HeaderTemplate>
                    <table border="0" cellpadding="2" cellspacing="1" class="CTable">
                        <tr align="center" class="CTitle">
                            <td style="width: 150px; text-align: center">处理时间</td>
                            <td align="Left">处理信息</td>
                            <td align="center">操作人</td>
                            <td align="center">详情</td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td class="Ctd" align="center"><%# Eval("Adddate") %> </td>
                        <td class="Ctd" style="width: 180px; word-break: break-all"><%# Eval("Remark") %></td>
                        <td class="Ctd" align="center"><%# Eval("Inputer") %></td>
                        <td class="Ctd" align="center">
                            <%# Convert.ToString(Eval("Status"))=="3"?"<a href='javascript:;' onclick='showOrderDetail("+Eval("LogID")+",\""+Eval("OrderID")+"\")'>查看物流</a>":"-" %> 
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <tr class="tdbg" style="display: <%# bool.Parse((Repeater3.Items.Count==0).ToString())?"":"none"%>">
                        <td class="splittd" style="text-align: center" colspan="7">该订单还没有任何信息!</td>
                    </tr>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </asp:Panel>
    </div>
</asp:Content>
