<!--#include file="b2b_usersys.asp"-->
<script language=JavaScript>
<%dim sql,i,j
	set rs_s=server.createobject("adodb.recordset")
	sql="select * from welcomeshengbuy order by shengorder"
	rs_s.open sql,conn,1,1
%>
	var selects=[];
	selects['xxx']=new Array(new Option('请选择城市……','xxx'));
<%
	for i=1 to rs_s.recordcount
%>
	selects['<%=rs_s("ShengNo")%>']=new Array(
<%
	set rs_s1=server.createobject("adodb.recordset")
	sql="select * from welcomeshibuy where shengid="&rs_s("id")&" order by shiorder"
	rs_s1.open sql,conn,1,1
	if rs_s1.recordcount>0 then 
		for j=1 to rs_s1.recordcount
		if j=rs_s1.recordcount then 
%>
		new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'));
<%		else
%>
		new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'),
<%
		end if
		rs_s1.movenext
		next
	else 
%>
		new Option('','0'));
<%
	end if
	rs_s1.close
	set rs_s1=nothing
	rs_s.movenext
	next
rs_s.close
set rs_s=nothing
%>
	function chsel(){
		with (document.receiveaddr){
			if(welcomeshengbuy.value) {
				welcomeshibuy.options.length=0;
				for(var i=0;i<selects[welcomeshengbuy.value].length;i++){
					welcomeshibuy.add(selects[welcomeshengbuy.value][i]);
				}
			}
		}
	}

function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>
<%
sub addtocart() 


ProductList = Session("ProductList")
Products = Split(Request("Prodid"), ",")
For I=0 To UBound(Products)
   PutToShopBag Products(I), ProductList
Next
Session("ProductList") = ProductList

if request("payment")="去收银台" then
response.redirect "b2b_ddlcsys.asp?action=1"
end if

If Request("cmdShow") = "Yes" Then
   ProductList = ""
   Products = Split(Request("ProdId"), ", ")
   For I=0 To UBound(Products)
      PutToShopBag Products(I), ProductList
   Next
   Session("ProductList") = ProductList
End If
If Len(Session("ProductList")) = 0 Then
end if
%>
<%
Set rsCheck=Server.CreateObject("ADODB.RecordSet") 
strsql="select ID,Name,Score,Price1,Price2," & LstPrice & ",amount,VipPrice,Stock from Product where ID in ("&Session("ProductList")&") order by ID"
rsCheck.open strsql,conn,1,1
%>
<link href="b2b_includefile/css.css" rel="stylesheet" type="text/css">

<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr> <form action="check.asp" method="POST" name="check"><td>

      <table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" bgcolor="#f2f2f2">
            <tr bgcolor="#f7f7f7" height="25" align="center"> 
            <td width="40"><strong>编 号</strong></td>
            <td width="300"><strong>商 品 名 称</strong></td>
            <td width="40"><strong>数量</strong></td>
			 <td width="40"><strong>积分</strong></td>
			 <td width="60"><strong>市场价</strong></td>
			 <td width="60"><strong>会员价</strong></td>
            <td width="60"><strong>成交价</strong></td>
			<td width="70"><strong>总 计</strong></td>
          </tr>
<%
Sum = 0
SumS = 0
Quatity = 1
Do While Not rsCheck.EOF
     Quatity = CInt( Request.Form( "Q_" & rsCheck("ID")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rsCheck("ID")) )
        If Quatity <= 0 Then Quatity = 1
     End If
Session(rsCheck("ID")) = Quatity

IF rsCheck("Stock") < Quatity Then
Quatity = 1
Session(rsCheck("ID")) = 1
response.write "<script language=javascript>alert('对不起，"&rsCheck("Name")&"暂时库存不足！');window.close();</script>" 
Response.End()
Conn.Close
Set Conn = Nothing
End IF

Dim YourPrice,strprice2,strvipprice,ProScore
strprice1 = Round(rsCheck("Price1"),2)
strprice2 = Round(rsCheck("Price2"),2)
strvipprice = Round(rsCheck("VipPrice"),2)
ProScore = rsCheck("Score")
YourPrice =  Round(rsCheck("" & LstPrice & ""),2)
Sum = Sum + (YourPrice + strvipprice)*Quatity
Sum=Round(Sum,2) 
SumS = SumS + ProScore*Quatity
%> 
          <tr bgcolor="#FFFFFF" height="25" align="center"> 
            <td><input type="CheckBox" name="ProdId" value="<%=rsCheck("ID")%>" Checked></td>
			 
            <td align="left">&nbsp;<a href="b2b_cpinfo.asp?ID=<%=rsCheck("ID")%>" target="_blank"><%=rsCheck("Name")%></a></td>
            <td><input type="Text" name="<%="Q_" & rsCheck("ID")%>" value="<%=Quatity%>" size="2" class="input_sr" onMouseOver="this.focus()" onMouseOut="if(this.value=='')this.value='';" onFocus="this.select()" onClick="if(this.value=='')this.value=''" ></td>
			<td><%=ProScore %></td>
			<td><%=strprice1 %></td>
			<td><%=strprice2 %></td>
			<td><%=YourPrice %></td>
			<td><%=Round((YourPrice + strvipprice)*Quatity,2) %></td>
          </tr>
          <%
     rsCheck.MoveNext
     Loop
rsCheck.close
set rsCheck=nothing
%> 
<tr bgcolor="#F7F7F7"> 
 <td height="25" colspan="9" align="center" valign="middle">             
                <input name="order" type="submit" class="input_bot" value="更新商品"> 
                &nbsp;&nbsp;&nbsp;
                <input name="payment" type="submit" class="input_bot" value="去收银台"> 
                &nbsp;&nbsp;&nbsp; 
                <input name="button" type="button" class="input_bot" onClick="javascript:window.close()" value="继续购物" language=javascript>
                <input type="hidden" name="cmdShow" value="Yes">
&nbsp;&nbsp;&nbsp;&nbsp;您现在是：<%= strTitle %>
| 价格总计：<font color="#FF0000"><b><%=Round(Sum,2) %></b></font>&nbsp;元 | 获得积分：<%=SumS %>&nbsp;分 </td>
</tr>
      </table>
      
 </td></form>
</tr>
</table>
	  
<%
end sub
sub receiveaddr()
dim rs2
if strUserName="" then
response.Write "<center>请先登录</center>"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&strUserName&"' ",conn,1,1
%>
<table width="96%" border=0 align=center cellpadding=4 cellspacing=1 bgcolor=#f2f2f2>
<form name=receiveaddr method=post action=saveprofile.asp?action=receiveaddr>
<tr bgcolor=#FFFFFF height=28>
<td width=12% bgcolor="#F7F7F7" >收货人姓名：</td>
<td colspan="3" bgcolor="#FFFFFF"><input name=receipt type=text class="input_sr" id=receipt value="<% = trim(rs("realname")) %>" size=12> 
&nbsp;&nbsp;
<select name="UserSex" id="UserSex">
			    <option value="0" <% if rs("UserSex")=0 Then Response.write("Selected") %>>男</option>
                <option value="1" <% if rs("UserSex")=1 Then Response.write("Selected") %>>女</option>
      </select></td>
</tr>
<tr height=28 bgcolor=#FFFFFF>
<td height=16 bgcolor=#F7F7F7 >详细地址：</td>
<td width="39%" bgcolor="#FFFFFF"><input name=address type=text class="input_sr" id=address value="<% = trim(rs("address"))%>" size=40></td>
<td width="14%" bgcolor="#F7F7F7">邮　　编：</td>
<td bgcolor="#FFFFFF"><input name=postcode type=text class="input_sr" id=postcode value=<% = trim(rs("postcode")) %>></td>
</tr>
<tr height=28 bgcolor=#FFFFFF>
<td bgcolor="#F7F7F7" >电　　话：</td>
<td bgcolor="#FFFFFF"><input name=usertel type=text class="input_sr" id=usertel value=<% = trim(rs("usertel")) %>></td>
<td bgcolor="#F7F7F7">手　　机：</td>
<td bgcolor="#FFFFFF"><input name=UserMobile type=text class="input_sr" id=UserMobile value=<% = trim(rs("UserMobile")) %>></td>
</tr>
<tr height=28 bgcolor=#FFFFFF>
<td bgcolor="#F7F7F7" >腾讯  QQ：</td>
<td bgcolor="#FFFFFF"><input name=userqq type=text class="input_sr" id=userqq value=<% = trim(rs("userqq")) %>></td>
<td bgcolor="#F7F7F7">MSN：</td>
<td bgcolor="#FFFFFF"><input name=MSN type=text class="input_sr" id=MSN value=<% = trim(rs("MSN")) %>></td>
</tr>
<tr bgcolor=#FFFFFF align=center>
<td height=32 colspan=4 ><input name=Submit type=submit class="input_bot" onclick='return checkreceiveaddr();' value=提交保存></td></tr>
</form></table>
<%
rs.close
set rs=nothing
end sub

sub deposit()
dim strscore,strvipscore,strdeposit
if strUserName="" then
response.Write "<center>请先登录</center>"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select score,deposit from [user] where username='"&strUserName&"' ",conn,1,1
strscore = rs("score")
strdeposit = rs("deposit")
rs.close
rs.open "select webimg14 from b2b_systemdata",conn,1,1
strvipscore = rs("webimg14")
rs.close
%>
<table width=96% border=0 align=center cellpadding=3 cellspacing=1 bgcolor="#f2f2f2">
  <tr bgcolor=#FFFFFF>
    <td bgcolor="#F7F7F7"><br>      
      &nbsp;您目前的积分为： <font color=#FF6600>
      <% = strscore %>
      </font> 分， 现在的兑换价格是每积分可以转换&nbsp;<font color="#FF6600">
      <% = webbj6 %>
    </font>&nbsp;元预存款</td>
  </tr>
  <tr bgcolor=#FFFFFF> 
    <td width="483"><form name="uptovip" method="post" action="vip.asp?action=chgscore">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td>
              <br>              &nbsp;您目前的预存款有： <font color=#FF6600><% = Round(strdeposit,2) %></font> 元。把<input name="strchg" type="text" class="input_sr" value="0" size="10" maxlength="5">
              <input name="Submit" type="submit" class="input_bot" value="积分转换成预存款"></td>
          </tr>
        </table></form>
		
        <table width="111%" border="0" cellspacing="0" cellpadding="0">
				
			  <%
			  '查询出用户的等级和积分
			  mSql="Select a.UserID as UserID,a.Username as UserName,a.Score as Score,a.grpID as grpID,b.GrpName as GrpName From [User] a,[b2b_userjb] b where a.GrpID = b.GrpID and a.UserID="&session("uid")
			  set mRs=conn.execute(mSql)
			  if not (mRs.eof and mRs.bof) then
			  	mGrpID=mRs("GrpID")
			  	mGrpName=mRs("GrpName")
				mScore=mRs("Score")
			  end if
			  'response.write mGrpName&mScore
			  mRs.close
			  set mRs=nothing
			  '列出系统内所有的用户等级,排除ID=4的普通用户
			  mSql="select grpID,grpName,miniPost From b2b_userjb where grpID<>4"
			  set mRs=conn.execute(mSql)
			  if not (mRs.eof and mRs.bof) then
			  	while not mRs.eof
			  %>
          	<tr><td>
			  <form name=sq1 method="post" action="sq_new.asp?grpID=<%=mRs("grpID")%>&id=<%=session("uid")%>">
			  <input name="Submit" type="submit"
			   class="input_bot"  onclick="javascript:return confirm('您已经以<%=mRs("miniPost")%>积分申请为<%=mRs("grpName")%>，系统将扣除相应的积分，请等待审核，您确定吗？');" value="<%response.write "申请成为"&mRs("grpName")%>" 
			  <%if (mRs("miniPost")=0) or (mRs("miniPost")>mScore) or (mRs("grpName")=mGrpName) then%> disabled="True"
			  <%end if%>>
			  	<%if mRs("miniPost")=0 then %>
				<% response.write "此等级需要向管理员直接申请,"%>
				<a href="#" onClick="window.open('addmes.asp?c=<%=mRs("grpName")%>','','width=580,scrollbars=yes,height=370')">点击发送短信<img src="image/mes.gif" width="15" height="15" border="0" align="absmiddle"></a>
				<%end if%>
				<%if (mRs("miniPost")>mScore) and (mRs("grpName")<>mGrpName)  then response.write "您的积分还不够升级到该等级，申请该等级需积分："&mRs("miniPost")%>
				<%if (mRs("miniPost")>mScore) and (mRs("grpName")=mGrpName)  then response.write "您已经是该等级用户"%>
				<%if (mRs("miniPost")<=mScore) and (mRs("miniPost")<>0) and (mRs("grpName")<>mGrpName) then response.write "申请该等级将用积分："&mRs("miniPost")%>
				<%if (mRs("miniPost")<=mScore) and (mRs("miniPost")<>0) and (mRs("grpName")=mGrpName) then response.write "您已经是该等级用户"%>
			  </form>
			  
			  </td></tr>
			  <%
					mRs.movenext
				wend
			  end if
			  mRs.close
			  set mRs=nothing
			  %>

      </table>
		
    </td>
  </tr>
</table>
<%
set rs = nothing
end sub

sub profile()
if strUserName="" then
	response.Write "<center>请先登录</center>"
	response.End
end if
maction=FormatSQL(SafeRequest("maction",0))
mIDs=FormatSQL(SafeRequest("mIDs",0))
if maction="del" then
	mSql="Delete from welcomemesbuy where ID="&mIDs
	conn.execute(mSql)
end if
mSql="Update welcomemesbuy set isLook = True where UserID='"&Session("uID")&"'"
conn.execute(mSql)
mSql="select * from welcomemesbuy where UserID='"&Session("UID")&"' Order By PublishTime desc"
set mrs=conn.execute(mSql)
%>
<%
if not (mrs.eof and mrs.bof) then
	while not mrs.eof
%> 
<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#f2f2f2">
  <tr>
    <td width="85%" height="25"><img src="image/mespic.gif" align="absmiddle">　您好，管理员在
        <b><%response.write mrs("PublishTime")%>
        </b>
        给您发布了一条站内短消息：</td>
    <td width="15%" align="center"><a href="profile.asp?action=profile&maction=del&mIDs=<%=mrs("ID")%>">删除</a> | <a href="#" onClick="window.open('addmes.asp?ID=<%=mrs("ID")%>','','width=580,scrollbars=yes,height=370')">回复<img src="image/mes.gif" width="15" height="15" border="0" align="absmiddle"></a></td>
  </tr>
<tr><td height="25" colspan="2" bgcolor="#FFFFFF"><table width="96%"  border="0" align="center" cellpadding="3" cellspacing="3">
    <tr>
      <td><%response.write mrs("Content")%></td>
    </tr>
  </table></td></tr>
</table><br><%
		mrs.movenext
	wend
end if
mrs.close
set mrs=nothing
%>
<%
end sub
sub customerinfo()
if strUserName="" then
response.Write "<center>请先登录</center>"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select [User].useremail,[User].vip,[User].identify,[User].UserQuestion,[User].realname,[User].GrpID,b2b_userjb.GrpName from [User] Inner Join b2b_userjb On [User].GrpID = b2b_userjb.GrpID where username='"&strUserName&"' ",conn,1,1
%>
<br>
<table width=96% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#f2f2f2">
<form name=userinfo method=post action=saveprofile.asp?action=customerinfo>
<tr bgcolor="#FFFFFF"><td width="51%" height=25>&nbsp;&nbsp;用 户 名： <font color=#FF6600>
  <% = strUserName %></font></td>
  <td width="49%">&nbsp;&nbsp;会员级别： <b><font color=#FF6600>
    <% = trim(rs("GrpName")) %>
  </font></b></td>
</tr>
<tr bgcolor="#FFFFFF"><td height=25>&nbsp;&nbsp;E-Mail　：  <input name=useremail type=text class="input_sr" id=useremail2 value=<% =trim(rs("useremail")) %> size="30"></td>
  <td>&nbsp;&nbsp;真实姓名：
    <input name=realname type=text class="input_sr" id=realname value=<% = trim(rs("realname"))%>></td>
</tr>
<tr bgcolor="#FFFFFF"><td height=25>&nbsp;&nbsp;密码提问： <input name=UserQuestion type=text class="input_sr" id=UserQuestion value=<% = trim(rs("UserQuestion"))%>></td>
  <td>&nbsp;&nbsp;问题答案：
    <input name=UserAnswer type=text class="input_sr" id=UserAnswer></td>
</tr>
<tr align="center" bgcolor="#f7f7f7"><td height=25 colspan="2">    <input name=Submit2 type=submit class="input_bot" onclick='return checkuserinfo();' value=提交保存>
    </td>
  </tr>
</form></table>
<%
rs.close
set rs=nothing
end sub

sub changepass()
if strUserName="" then
response.Write "<center>请先登录</center>"
response.End
end if %>
<table width=96% border=0 align=center cellpadding=1 cellspacing=1 bgcolor=#f2f2f2>
<form name=userpass method=post action=saveprofile.asp?action=changepass>
<tr bgcolor=#F7F7F7>
      <td width=50% height="25" align="right">用 户 名：</td>
<td width=50% height="25" bgcolor="#FFFFFF"><font color=#FF6600>
  <% = strUserName %></font></td>
</tr>
<tr bgcolor=#F7F7F7>
      <td height="25" align="right">原 密 码：</td>
<td height="25" bgcolor="#FFFFFF"><input name=UserPassword type=Password class="input_sr" id=UserPassword></td>
</tr>
<tr bgcolor=#F7F7F7>
      <td height="25" align="right">新 密 码：</td>
<td height="25" bgcolor="#FFFFFF"><input name=UserPassword1 type=Password class="input_sr" id=UserPassword1></td>
</tr>
<tr bgcolor=#F7F7F7>
<td height="25" align="right">确认密码：</td>
<td height="25" bgcolor="#FFFFFF"><input name=UserPassword2 type=Password class="input_sr" id=UserPassword2></td>
</tr>
<tr bgcolor="#F7F7F7">
<td height="25" colspan=2 align="center"><input name=Submit type=submit class="input_bot" onclick='return checkrepass();' value=确认修改 改></td></tr>
</form></table>
<%
end sub

sub repass()
dim shop
shop=SafeRequest("shop",1)
select case shop
'//输入用户名
case ""
response.Write "<br><table width=96% border=0 align=center cellpadding=01 cellspacing=1>"
response.Write "<form name=shop0 method=post action=repassw.asp?action=repass&shop=1>"
response.Write "<tr><td height=28 bgcolor=#ffffff><div align=center>请输入您的用户名： <input name=username type=text class=input_sr id=username size=16></div></td></tr>"
response.Write "<tr><td height=32 bgcolor=#ffffff><div align=center><input type=submit name=Submit class=input_bot value=确&nbsp;定 onclick='return check0();'></div></td></tr>"
response.Write "</form></table>"
'//输入问题答案
case "1"
set rs=server.CreateObject("adodb.recordset")
rs.open "select UserQuestion,UserAnswer from [user] where username='"&trim(request.form("username"))&"' ",conn,1,1
if rs.eof and rs.bof then
response.write "<center><br>查无此用户，请返回！</center>"
else
response.Write "<br><table width=96% border=0 align=center cellpadding=1 cellspacing=1 bgcolor=#FFFFFF>"
response.Write "<form name=shop1 method=post action=repassw.asp?action=repass&shop=2>"
response.Write "<tr><td width=21% bgcolor=#ffffff STYLE='PADDING-LEFT: 20px'>您的密码提问：</td><td width=79% height=28 bgcolor=#ffffff STYLE='PADDING-LEFT: 20px'><font color=red>"&trim(rs("UserQuestion"))&"</font><input type=hidden name=username1 value="&trim(request.form("username"))&" ID=Hidden></td></tr>"
response.Write "<tr><td bgcolor=#ffffff STYLE='PADDING-LEFT: 20px'>您的密码答案：</td><td height=28 bgcolor=#ffffff STYLE='PADDING-LEFT: 20px'><input name=UserAnswer class=input_sr type=text id=UserAnswer></td></tr>"
response.Write "<tr bgcolor=#ffffff><td height=32 colspan=2 STYLE='PADDING-LEFT: 50px'><input class=input_bot type=submit name=Submit2 value=确&nbsp;定 onclick='return check1();'></td></tr>"
response.Write "</form></table>"
end if
rs.close
set rs=nothing
'//输入新密码
case "2"
set rs=server.CreateObject("adodb.recordset")
rs.open "select UserAnswer from [user] where username='"&trim(request.form("username1"))&"' ",conn,1,1
'//判断答案是否正确
if trim(rs("UserAnswer"))<>md5(trim(request.form("UserAnswer"))) then
response.write "<script language=javascript>alert('对不起，您输入的问题答案不正确');history.go(-1);</script>"
response.end
else
response.Write "<br><table width=96% border=0 align=center cellpadding=1 cellspacing=1 bgcolor=#f2f2f2>"
response.Write "<form name=shop2 method=post action=saveprofile.asp?action=repass>"
response.Write "<tr><td width=20% bgcolor=#f2f2f2 STYLE='PADDING-LEFT: 20px'>请输入新密码：</td><td width=80% height=28 bgcolor=#ffffff STYLE='PADDING-LEFT: 20px'><input name=UserPassword1 class=input_sr type=Password id=UserPassword1><input type=hidden name=username2 value="&trim(request.form("username1"))&"></td></tr>"
response.Write "<tr><td bgcolor=#f2f2f2 STYLE='PADDING-LEFT: 20px'>输入确认密码：</td><td height=28 bgcolor=#ffffff STYLE='PADDING-LEFT: 20px'><input class=input_sr name=UserPassword2 type=Password id=UserPassword2></td></tr>"
response.Write "<tr><td height=32 colspan=2 bgcolor=#ffffff STYLE='PADDING-LEFT: 50px'><input type=submit name=Submit3 class=input_bot value=确&nbsp;定 onclick='return check2();'></td></tr>"
response.Write "</form></table>"
end if
rs.close
set rs=nothing
end select
end sub

sub statinfo()
if strUserName="" then
response.Write "<center>请先登录</center>"
response.End
end if

dim joindtm,myorder,successed,successedsum,lastorder
set rs=server.CreateObject("adodb.recordset")
rs.open "select adddate from [user] where username='"&strUserName&"'",conn,1,1
joindtm=rs("adddate")
rs.close
rs.open "select distinct(goods),actiondate from orders where username='"&strUserName&"' and state<6 ",conn,1,1
if rs.eof and rs.bof then
response.write ""
else
rs.movelast
lastorder=rs("actiondate")
myorder=rs.recordcount
end if
rs.close
rs.open "select sum(paid) as paid from orders where username='"&strUserName&"' and state<6 and state>3",conn,1,1 
if rs("paid")>0 then
successedsum=rs("paid")
else
successedsum=0
end if
rs.close
rs.open "select distinct(goods) from orders where username='"&strUserName&"' and state<6 and state>3",conn,1,1
successed=rs.recordcount
set rs=nothing %>

<table width=96% border=0 align=center cellpadding=2 cellspacing=1 bgcolor=#f2f2f2>
<tr><td height=14 colspan=2 align="center">&nbsp;</td>
</tr>
<tr><td height="5"></td></tr>
<tr height=14  bgcolor=#FFFFFF>
<td height="25" align=right bgcolor="#F7F7F7">注册日期：</td>
<td width=56% height="25">&nbsp;
  <% =joindtm %></td></tr>
<tr height=14  bgcolor=#FFFFFF><td height="25" align=right bgcolor="#F7F7F7">上次下单：</td>
<td height="25">&nbsp;
  <% =lastorder %></td></tr>
<tr height=14  bgcolor=#FFFFFF><td height="25" align=right bgcolor="#F7F7F7">下单次数：</td>
<td height="25">&nbsp;
  <% = myorder %>次</td></tr>
<tr height=14  bgcolor=#FFFFFF><td height="25" align=right bgcolor="#F7F7F7">成交次数：</td>
<td height="25">&nbsp;
  <% =successed %>次</td></tr>
<tr height=14  bgcolor=#FFFFFF><td height="25" align=right bgcolor="#F7F7F7">成交金额：</td>
<td height="25">&nbsp;
  <% =successedsum %>元</td></tr>
</table>
<%
end sub

sub goods()
if strUserName="" then
response.Write "<center><center>请先登录</center></center>"
response.End
end if
%>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="96%"> 
<tr><td align="center"> 
  <table width="720" height="60" border="0" align="center" cellpadding="0" cellspacing="1"> 
<tr><td width="894" align="right" background="image/gupic9.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="85%">&nbsp;</td>
    <td width="15%"><!--<select name="state" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
      <option value="profile.asp?action=goods&state=0" selected>--请选择查询状态--</option>
      <option value="profile.asp?action=goods&state=0" >全部订单状态</option>
      <option value="profile.asp?action=goods&state=1" >未作任何处理</option>
      <option value="profile.asp?action=goods&state=2" >用户已划出款</option>
      <option value="profile.asp?action=goods&state=3" >服务商已收到款</option>
      <option value="profile.asp?action=goods&state=4" >已发货/订单完成</option>
      <option value="profile.asp?action=goods&state=5" >用户已经收到货</option>
    </select>--></td>
  </tr>
</table></td>
</tr> </table>
          <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#f2f2f2">
            <tr align="center" bgcolor="#F7F7F7"> 
              <td height="25"><strong>订单号</strong></td>
              <td height="25"><strong>合计金额</strong></td>
              <td height="25"><strong>积分</strong></td>
              <td height="25"><strong>付款方式</strong></td>
              <td height="25"><strong>收货方式</strong></td>
              <td height="25"><strong>订单日期</strong></td>
              <td height="25"><strong>订单状态</strong></td>
            </tr>
            <%set rs=server.CreateObject("adodb.recordset")
  dim state
  state=SafeRequest("state",1)
  if state=0 or state="" then
  select case state
  case "0"
  rs.open "select distinct(goods),realname,actiondate,deliverymethord,paymethord,state from orders where username='"&strUserName&"' and state<6 order by actiondate desc",conn,1,1
  case ""
  rs.open "select distinct(goods),realname,actiondate,deliverymethord,paymethord,state from orders where username='"&strUserName&"' and state<6 order by actiondate desc",conn,1,1
  end select
  else
  rs.open "select distinct(goods),realname,actiondate,deliverymethord,paymethord,state from orders where username='"&strUserName&"' and state="&state&" order by actiondate",conn,1,1
  end if

  do while not rs.eof
   %>
            <tr bgcolor=#FFFFFF align="center"> 
			<% dim shop,rs2 
			set shop=server.CreateObject("adodb.recordset")
			shop.open "select sum(paid) as paid,sum(score) as score from orders where goods='"&trim(rs("goods"))&"' ",conn,1,1
				%>
              <td height="25" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><a href=# onClick="javascript:window.open('chkorder.asp?dan=<%=trim(rs("goods"))%>&score=<% = trim(shop("score")) %>','','width=710,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><%=trim(rs("goods"))%></a></td>
              <td height="25" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"> 
			  <%
				set rs2=server.CreateObject("adodb.recordset")
				rs2.open "select * from delivery where deliveryid="&rs("deliverymethord"),conn,1,1
				Dim LngFee
				
		  IF webbj5 = 0 Then
		  LngFee = rs2("fee")
		  Else
		  		If shop("paid") >= webbj5 Then
				LngFee = 0
				Else
				LngFee = rs2("fee")
				End IF
		  End IF
	response.write "<font color=#FF6600>"&Round((shop("paid")*(1+rs2("payfee")/100)+LngFee),2)&"元</font>" 
	rs2.close
	set rs2=nothing %>
              </td>
              <td height="25" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''">
                <% = shop("score") %>
                <%
	shop.close
	set shop=nothing
	%>
              </td>
              <td height="25" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"> 
                <%set rs2=server.CreateObject("adodb.recordset")
        rs2.open "select * from delivery where deliveryid="&rs("paymethord"),conn,1,1
        response.Write trim(rs2("subject"))
        rs2.close
        set rs2=nothing%>
              </td>
              <td height="25" align="center" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''">
                <%set rs2=server.CreateObject("adodb.recordset")
        rs2.open "select * from delivery where deliveryid="&rs("deliverymethord"),conn,1,1
        response.Write trim(rs2("subject"))
        rs2.close
        set rs2=nothing
        %>
              </td>
              <td height="25" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''"><%=trim(rs("actiondate"))%></td>
              <td height="25" onmouseover="this.style.backgroundColor='#f2f2f2'; this.style.color='#ff0000' " onmouseout="this.style.backgroundColor='';this.style.color=''">
                <%select case rs("state")
	case "1"
	response.write "未作任何处理"
	case "2"
	response.write "订单处理中"
	case "3"
	response.write "服务商收到款"
	case "4"
	response.write "已发货/订单完成"
	case "5"
	response.write "用户已收到货"
	end select%>
              </td>
            </tr>
            <%
   rs.movenext
  loop
  rs.close
  set rs=nothing%>
      </table>
          <br>
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="right">给管理员发送站内短信<a href="####"><img src="image/mes.gif" width="15" height="15" border="0" align="absmiddle" onClick="window.open('addmes.asp','','width=580,scrollbars=yes,height=370')"></a></td>
            </tr>
          </table></td>
</tr> </table> <%end sub
sub UserLogins()
dim url
url=Request.ServerVariables("HTTP_REFERER") %>
          <%
end sub
%>