%
memberid = CheckUserID()
if memberid < 1 then
Response.Redirect userLogin
end if
Set cnConn = Server.CreateObject("ADODB.Connection")
Set rsTable = Server.CreateObject("ADODB.Recordset")
cnConn.Open strCONNECT
if Request("otitle") <> "" then
if Request("otitle") <> "" and Request("oname") <> "" and Request("oaddress") <> "" and Request("opost") <> "" then
oid=Month(Now)&Day(Now)&Hour(Now)&Minute(Now)&Second(Now)
owhen=Cstr(Now())
strSql = "INSERT INTO orders (oid,ouser,otitle,owhen,oshow,olook,oprice,ostatus,opay,oship,oname,omail,oaddress,ophone,opost,omemo) VALUES ("&oid&","&memberid&",'"&Request("otitle")&"',#"&owhen&"#,False,0,"&Request("oprice")&",0,"&Request("opay")&","&Request("oship")&",'"&Request("oname")&"','"&Request("omail")&"','"&Request("oaddress")&"','"&Request("ophone")&"','"&Request("opost")&"','"&Request("omemo")&"')"
cnConn.Execute strSql
strSql = "INSERT INTO order_content (corder,cdowns,cwhen) SELECT "&oid&" as oid,fdowns,fwhen FROM favorite WHERE fuser="&memberid
cnConn.Execute strSql
strSql = "DELETE FROM favorite WHERE fuser="&memberid
cnConn.Execute strSql
cnConn.Close
Response.Redirect "./order.asp?oid="&oid
else
actMsg = "必须添写(*)相关信息.."
end if
end if
if Request("act") = "add" and clng(Request("did")) > 0 then
adTime=Cstr(Now())
strSql = "DELETE FROM "&tabPRE&"favorites WHERE fuser="&memberid&" AND fdowns="&Request("did")
cnConn.Execute strSql
strSql = "INSERT INTO "&tabPRE&"favorites (fuser,fdowns,fwhen) VALUES ("&memberid&","&Request("did")&","&unixNow&")"
cnConn.Execute strSql
actMsg = "软件已成功添加到收藏夹.."
elseif Request("act") = "del" and clng(Request("did")) > 0 then
adTime=Cstr(Now())
strSql = "DELETE FROM "&tabPRE&"favorites WHERE fuser="&memberid&" AND fdowns="&Request("did")
cnConn.Execute strSql
actMsg = "选定软件已从收藏夹中删除.."
end if
%>
|
| 会员功能 |
|
| <%= ShowUserMenu()%>
|
|
|
| 我的收藏夹 <%= actMsg%> |
<%
lngTotal = 0
intCount = 0
strSql = "SELECT did,dname,dver,dsize,dshow,kvalue,fwhen FROM "&tabPRE&"favorites,"&tabPRE&"downs,"&tabPRE&"kinds WHERE fdowns=did AND dkind=kid AND fuser="&memberid&" ORDER BY fwhen DESC"
rsTable.Open strSql,cnConn
while not rsTable.EOF
Response.Write ""
if rsTable("dshow") > 0 then
Response.Write "| "&rsTable("dname")&" "&rsTable("dver")&" | "
else
Response.Write ""&rsTable("dname")&" "&rsTable("dver")&" | "
end if
Response.Write ""&rsTable("fwhen")&" | "&FormatNumber(Clng(rsTable("dsize")),0)&" KB | 删除 | "
lngTotal = lngTotal + Clng(rsTable("dsize"))
intCount = intCount + 1
rsTable.MoveNext
wend
rsTable.Close
if intCount < order_count then
oprice = order_price
else
oprice = order_pricemore
end if
intDisk = Cint(lngTotal/640000) + 1
oprice = oprice * intDisk
%>
|
|
<%
cnConn.Close
Set cnConn=Nothing
Set rsTable=Nothing
%>