<!--#include file="../Start.asp"-->
<!--#include file="Channel_Config.asp"-->
<!--#include file="../Include/PowerEasy.Cache.asp"-->
<!--#include file="../Include/PowerEasy.Channel.asp"-->
<!--#include file="../Include/PowerEasy.Common.Front.asp"-->
<!--#include file="../Include/PowerEasy.OrderFlow.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005－2009 佛山市动易网络科技有限公司 版权所有
'**************************************************************

'判断是否需要注册
If UserLogined = False And EnableGuestBuy = False Then
    Response.Redirect "../User/User_Login.asp"
    Response.End
End If
SkinID=DefaultSkinID
If UserID > 0 And ContacterID > 0 Then
    Dim rsContacter
    Set rsContacter = Conn.Execute("select TrueName,Address,ZipCode,Mobile,OfficePhone,HomePhone,Company from PE_Contacter where ContacterID=" & ContacterID & "")
    If Not (rsContacter.BOF And rsContacter.EOF) Then
        ContacterName = rsContacter("TrueName")
        Address = rsContacter("Address") & " " & rsContacter("Company")
        ZipCode = rsContacter("ZipCode")
        Mobile = rsContacter("Mobile")
        Company = rsContacter("Company")
        If OfficePhone <> "" Then
            Phone = rsContacter("OfficePhone")
        Else
            If rsContacter("HomePhone") <> "" Then
                Phone = rsContacter("HomePhone")
            Else
                Phone = rsContacter("Mobile")
            End If
        End If
    End If
    rsContacter.Close
    Set rsContacter = Nothing
End If

CartID = ReplaceBadChar(Trim(Request.Cookies("Cart" & Site_Sn)("CartID")))
ProductList = SelectCart(CartID, 0)
PresentList = SelectCart(CartID, 1)
If ProductList = "" Then       '如果购物车为空，转入提示界面
    ShowTips_CartIsEmpty = XmlText_Class("ShowTips_CartIsEmpty", "<br><br><br><br>您好！目前您的购物车中没有任何商品，是不是<a href='ShowElite.asp'><font color='#FF0000'>继续购物</font></a>？<br><br><br><br><br><br>")
Else
    ShowTips_CartIsEmpty = ""
End If

strHtml = GetTemplate(ChannelID, 10, 0)
Call ReplaceCommon

strHtml = Replace(strHtml, "{$ShowTips_Login}", ShowTips_Login)
strHtml = Replace(strHtml, "{$TrueName}", ContacterName & "")
strHtml = Replace(strHtml, "{$ContacterName}", ContacterName & "")
strHtml = Replace(strHtml, "{$Address}", Trim(Address & ""))
strHtml = Replace(strHtml, "{$ZipCode}", ZipCode & "")
strHtml = Replace(strHtml, "{$Company}", Company & "")
strHtml = Replace(strHtml, "{$Mobile}", Mobile & "")
strHtml = Replace(strHtml, "{$Phone}", Phone & "")
strHtml = Replace(strHtml, "{$ShowPaymentTypeList}", ShowPaymentTypeList())
strHtml = Replace(strHtml, "{$ShowDeliverTypeList}", ShowDeliverTypeList())

strHtml = Replace(strHtml, "{$ShowTips_CartIsEmpty}", ShowTips_CartIsEmpty)

Call ReplaceUserInfo

strHtml = Replace(strHtml, "{$ShowCart}", ShowCart2(False))

strHtml = Replace(strHtml, "Value= ", "value='' ")
strHtml = Replace(strHtml, "value= ", "value='' ")

Response.Write strHtml
Call CloseConn

Function ShowPaymentTypeList()
    Dim strPaymentType
    strPaymentType = "<table width='100%' border='0' cellpadding='2' cellspacing='1' class='tdbg'>"
    Dim rsPaymentType
    Set rsPaymentType = Conn.Execute("select * from PE_PaymentType where IsDisabled=" & PE_False & " order by OrderID")
    Do While Not rsPaymentType.EOF
        strPaymentType = strPaymentType & "<tr class='tdbg3'>"
        strPaymentType = strPaymentType & "<td width='20'><input type='radio' name='PaymentType' value='" & rsPaymentType("TypeID") & "'"
        If rsPaymentType("IsDefault") = True Then strPaymentType = strPaymentType & " checked"
        strPaymentType = strPaymentType & "></td>"
        strPaymentType = strPaymentType & "<td width='60'>" & rsPaymentType("TypeName") & "</td>"
        strPaymentType = strPaymentType & "<td>" & rsPaymentType("Intro") & "</td>"
        strPaymentType = strPaymentType & "</tr>"
        rsPaymentType.MoveNext
    Loop
    Set rsPaymentType = Nothing
    strPaymentType = strPaymentType & "</table>"
    ShowPaymentTypeList = strPaymentType
End Function

Function ShowDeliverTypeList()
    Dim strDeliverType
    strDeliverType = "<table width='100%' border='0' cellpadding='2' cellspacing='1' class='tdbg'>"
    Dim rsDeliverType
    Set rsDeliverType = Conn.Execute("select * from PE_DeliverType where IsDisabled=" & PE_False & " order by OrderID")
    Do While Not rsDeliverType.EOF
        strDeliverType = strDeliverType & "<tr class='tdbg3'>"
        strDeliverType = strDeliverType & "<td width='20'><input type='radio' name='DeliverType' value='" & rsDeliverType("TypeID") & "'"
        If rsDeliverType("IsDefault") = True Then strDeliverType = strDeliverType & " checked"
        strDeliverType = strDeliverType & "></td>"
        strDeliverType = strDeliverType & "<td width='60'>" & rsDeliverType("TypeName") & "</td>"
        strDeliverType = strDeliverType & "<td>" & rsDeliverType("Intro") & "</td>"
        strDeliverType = strDeliverType & "</tr>"
        rsDeliverType.MoveNext
    Loop
    Set rsDeliverType = Nothing
    strDeliverType = strDeliverType & "</table>"
    ShowDeliverTypeList = strDeliverType
End Function
%>
