order.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:17k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../FS_Inc/Function.asp" -->
  5. <!--#include file="lib/strlib.asp" -->
  6. <!--#include file="lib/UserCheck.asp" -->
  7. <%
  8. Response.Buffer = True
  9. Response.Expires = -1
  10. Response.ExpiresAbsolute = Now() - 1
  11. Response.Expires = 0
  12. Response.CacheControl = "no-cache"
  13. if Request.QueryString("Action") = "lock_order" then
  14. '进行判断
  15. dim rsOrderTF
  16. set rsOrderTF =User_Conn.execute("select M_state,IsSuccess From FS_ME_Order where OrderNumber='"& NoSqlHack(Request.QueryString("OrderNumber"))&"' and UserNumber='"& Fs_User.UserNumber &"'")
  17. if not rsOrderTF.eof then
  18. if rsOrderTF("M_state")=1 then
  19. strShowErr = "<li>已经处理的定单,您不能取消!</li>"
  20. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  21. Response.end
  22. end if 
  23. if rsOrderTF("IsSuccess")=1 then
  24. strShowErr = "<li>支付成功的定单,您不能取消!</li>"
  25. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  26. Response.end
  27. end if 
  28. end if
  29. rsOrderTF.close:set rsOrderTF = nothing
  30. User_Conn.execute("Delete From FS_ME_Order  where OrderNumber='"& NoSqlHack(Request.QueryString("OrderNumber"))&"' and UserNumber='"& Fs_User.UserNumber &"'")
  31. User_Conn.execute("Delete From FS_ME_Order_detail  where OrderNumber='"& NoSqlHack(Request.QueryString("OrderNumber"))&"'")
  32. strShowErr = "<li>操作定单成功!</li>"
  33. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  34. Response.end
  35. End if
  36. %>
  37. <html xmlns="http://www.w3.org/1999/xhtml">
  38. <title>定单-网站内容管理系统</title>
  39. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  40. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  41. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  42. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  43. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  44. <head>
  45. <body>
  46. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  47.   <tr>
  48.     <td>
  49.       <!--#include file="top.asp" -->
  50.     </td>
  51.   </tr>
  52. </table>
  53. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  54.   
  55.     <tr class="back"> 
  56.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td>
  57.     </tr>
  58.     <tr class="back"> 
  59.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  60.           <!--#include file="menu.asp" -->
  61.         </div></td>
  62.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  63.         <tr class="hback"> 
  64.           <td class="hback"><strong>位置:</strong><a href="../">网站首页</a> &gt;&gt; 
  65.             <a href="main.asp">会员首页</a> &gt;&gt;定单</td>
  66.         </tr>
  67.         <tr class="hback">
  68.           <td class="hback"><a href="Order.asp">一般定单</a>┆<a href="Order_Pay.asp">在线支付定单</a></td>
  69.         </tr>
  70.       </table>
  71.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  72.         <form name="form1" method="post" action="Order.asp">
  73.           <tr class="hback"> 
  74.             <td colspan="6" class="hback"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  75.                 <tr> 
  76.                   <td width="44%"> <strong> 
  77.                     <%
  78.   dim strTmp,strLogType,strTmp1,OrderNumber
  79.   strLogType = NoSqlHack(Trim(Request.QueryString("LogTye")))
  80.   OrderNumber =  NoSqlHack(Trim(Request.QueryString("OrderNumber")))
  81.   if OrderNumber<>"" then OrderNumber = " and OrderNumber='"&OrderNumber&"' "
  82.      if Request.QueryString("LogTye")<>"" then
  83.    strTmp =  " and LogType='"& strLogType &"'"
  84.      Else
  85.    strTmp =  " "
  86.     End if
  87. Dim RsOrderObj,RsOrderSQL
  88. Dim strpage,strSQLs,StrOrders
  89. strpage=request("page")
  90. if len(strpage)=0 Or strpage<1 or trim(strpage)=""  Then strpage="1"
  91. Set RsOrderObj = Server.CreateObject(G_FS_RS)
  92. RsOrderSQL = "Select * From FS_ME_Order  where UserNumber='"& Fs_User.UserNumber &"' and OrderType<>3 "&OrderNumber&" order by  OrderID desc"
  93. RsOrderObj.Open RsOrderSQL,User_Conn,1,1
  94. Response.Write RsOrderObj.recordcount
  95. %>
  96.                     </strong> 个定单</td>
  97.                   <td width="56%"><div align="left"> </div></td>
  98.                 </tr>
  99.               </table></td>
  100.           </tr class="hback">
  101.           <tr class="hback"> 
  102.             <td width="20%" class="xingmu"><div align="left"><strong> 定单号(点定单查看详情)</strong></div></td>
  103.             <td width="11%" class="xingmu"><div align="center">审核状态</div></td>
  104.             <td width="21%" class="xingmu"><div align="center">成功日期</div></td>
  105.             <td width="18%" class="xingmu"><strong>日期</strong></td>
  106.             <td width="9%" class="xingmu"><div align="center"><strong>类型</strong></div></td>
  107.             <td width="13%" class="xingmu"><div align="center"><strong>支付</strong></div></td>
  108.           </tr>
  109.           <%
  110. Dim select_count,select_pagecount,i
  111. if RsOrderObj.eof then
  112.    RsOrderObj.close
  113.    set RsOrderObj=nothing
  114.    set conn=nothing
  115.    set user_conn=nothing
  116.    set fs_user=nothing
  117.    Response.Write"<TR><TD colspan=""10""  class=""hback"">没有记录。</TD></TR>"
  118. else
  119. if Request("CountPage")="" or len(Request("CountPage"))<1 then
  120. RsOrderObj.pagesize = 20
  121. Else
  122. RsOrderObj.pagesize = Request("CountPage")
  123. End if
  124. RsOrderObj.absolutepage=cint(strpage)
  125. select_count=RsOrderObj.recordcount
  126. select_pagecount=RsOrderObj.pagecount
  127. for i=1 to RsOrderObj.pagesize
  128. if RsOrderObj.eof Then exit For 
  129.  %>
  130.           <tr class="hback"> 
  131.             <td class="hback"  id=item$pval[CatID]) style="CURSOR: hand"  onmouseup="opencat(Orderid<% = RsOrderObj("OrderID")%>);"  language=javascript><div align="left"> 
  132.                 <% = RsOrderObj("OrderNumber")%>
  133.               </div></td>
  134.             <td class="hback"> <div align="center"> 
  135.                 <%
  136. if RsOrderObj("isLock")=1 then
  137. Response.Write("<a href=""Order.asp?Action=lock_order&type=1&OrderNumber="& RsOrderObj("OrderNumber") &""" onClick=""{if(confirm('确定取消定单?')){return true;}return false;}"" title=""取消定单""><font color=red>审核中...</font></a>")
  138. Else
  139. Response.Write("已审核...")
  140. End if
  141. %>
  142.               </div></td>
  143.             <td class="hback"><div align="center"> 
  144.                 <% = RsOrderObj("M_PayDate")%>
  145.               </div></td>
  146.             <td class="hback"> 
  147.               <% = RsOrderObj("AddTime")%>
  148.             </td>
  149.             <td class="hback"><div align="center"> 
  150.                 <%
  151. if RsOrderObj("OrderType")=0 then
  152. Response.Write("会员组")
  153. Elseif RsOrderObj("OrderType")=1 then
  154. Response.Write("商品")
  155. Elseif RsOrderObj("OrderType")=2 then
  156. Response.Write("点卡")
  157. Elseif RsOrderObj("OrderType")=3 then
  158. Response.Write("在线支付")
  159. Else
  160. Response.Write("其他")
  161. End if
  162. %>
  163.               </div></td>
  164.             <td class="hback"> <div align="center"> 
  165.                 <%
  166. if RsOrderObj("IsSuccess")=0 then
  167. %>
  168.                 <font color="#FF0000">未支付</font> 
  169.                 <%Else%>
  170.                 已支付 
  171.                 <%End if%>
  172.               </div></td>
  173.           </tr>
  174.           <tr class="hback"  id="Orderid<% = RsOrderObj("OrderID")%>" style="display:none"> 
  175.             <td height="106" colspan="6" class="hback"> <table width="100%" border="0" cellspacing="1" cellpadding="5" class="table">
  176.                 <tr class="hback"> 
  177.                   <td width="11%" class="hback_1"><div align="center">产品</div></td>
  178.                   <td colspan="3" class="hback"> <div align="left"> 
  179. <%
  180. Dim tmp_rs,tmp_SQL,tmp_i,sum_Moeny,p_rs
  181. Set tmp_rs = Server.CreateObject(G_FS_RS)
  182. tmp_SQL = "Select [DetailID],OrderNumber,ProductID,ProductNumber,M_state,Moneys From FS_ME_Order_detail  where OrderNumber='"& RsOrderObj("OrderNumber") &"' order by  DetailID desc"
  183. tmp_rs.Open tmp_SQL,User_Conn,1,3
  184. sum_Moeny = 0 
  185. for tmp_i = 1 to tmp_rs.recordcount
  186. if tmp_rs.eof then exit for
  187. if RsOrderObj("OrderType")=1 then
  188. set p_rs = Conn.execute("select ProductTitle From FS_MS_Products where id="&tmp_rs("ProductID"))
  189. if not p_rs.eof then
  190. Response.Write "·<a href="& get_productsLink(tmp_rs("ProductID")) &">"&p_rs("ProductTitle") &"</a><br>"
  191. else
  192. Response.Write "·商品已经删除<br>"
  193. end if
  194. else
  195. Response.Write "<br />"
  196. end if
  197. sum_Moeny = sum_Moeny + tmp_rs("Moneys")
  198. tmp_rs.moveNext
  199. next
  200. %>
  201.                     </div></td>
  202.                   <td class="hback_1"><div align="center">总金额</div></td>
  203.                   <td class="hback"> 
  204.                     <% = sum_Moeny %>
  205.                   </td>
  206.                 </tr>
  207.                 <tr class="hback"> 
  208.                   <td class="hback_1"><div align="center">联系电话</div></td>
  209.                   <td width="22%" class="hback"> 
  210.                     <% = RsOrderObj("M_Tel")%>
  211.                   </td>
  212.                   <td width="9%" class="hback_1">移动电话</td>
  213.                   <td width="26%" class="hback"> 
  214.                     <% = RsOrderObj("M_Mobile")%>
  215.                   </td>
  216.                   <td width="9%" class="hback_1"><div align="center">性别</div></td>
  217.                   <td width="23%" class="hback"> 
  218.                     <%
  219.   if  RsOrderObj("M_Sex") = 0 then
  220.    Response.Write("男")
  221. Else
  222.    Response.Write("女")
  223. End if
  224.   %>
  225.                   </td>
  226.                 </tr>
  227.                 <tr class="hback"> 
  228.                   <td class="hback_1"><div align="center">购买方式</div></td>
  229.                   <td class="hback"> 
  230.                     <%
  231.   if  RsOrderObj("M_Type")=0 then
  232.    Response.Write("邮寄")
  233.   Elseif RsOrderObj("M_Type") =1 then
  234.    Response.Write("电汇(送货上门)")
  235.   Elseif RsOrderObj("M_Type") =1 then
  236.    Response.Write("电汇(送货上门)")
  237.   Else
  238.    Response.Write("上门取货")
  239.   End if
  240.   %>
  241.                   </td>
  242.                   <td class="hback_1"><div align="center">地址</div></td>
  243.                   <td colspan="3" class="hback"> <div align="left"> 
  244.                       <% = RsOrderObj("M_Province")%>
  245.                       <% = RsOrderObj("M_City")%>
  246.                       <% = RsOrderObj("M_Address")%>
  247.                         邮编: 
  248.                       <% = RsOrderObj("M_PostCode")%>
  249.                     </div></td>
  250.                 </tr>
  251.                 <tr class="hback"> 
  252.                   <td class="hback_1"><div align="center">收货人</div></td>
  253.                   <td class="hback"> 
  254.                     <% = RsOrderObj("M_UserName")%>
  255.                   </td>
  256.                   <td class="hback_1"><div align="center">物流公司</div></td>
  257.                   <td class="hback"> 
  258.                     <% = RsOrderObj("M_ExpressCompany")%>
  259.                   </td>
  260.                   <td class="hback">支付方式</td>
  261.                   <td class="hback"> 
  262.                   <%
  263.   if RsOrderObj("M_PayStyle") =0 then
  264.    Response.Write("在线支付")
  265.   Elseif RsOrderObj("M_PayStyle") =1 then
  266.    Response.Write("电汇(银行汇款)")
  267.   Elseif RsOrderObj("M_PayStyle") =2 then
  268.    Response.Write("邮寄")
  269.   Elseif RsOrderObj("M_PayStyle") =3 then
  270.    Response.Write("帐户支付(金币)")
  271.   Else
  272.    Response.Write("点卡")
  273.   End if
  274.   %>
  275.                   </td>
  276.                 </tr>
  277.                 <tr class="hback"> 
  278.                   <td class="hback_1"><div align="center">发货状态</div></td>
  279.                   <td class="hback"> 
  280.                     <%
  281. if RsOrderObj("M_state")=0 then
  282. Response.Write("未发货")
  283. elseif RsOrderObj("M_state")=1 then
  284. Response.Write("已发货")
  285. if RsOrderObj("OrderType")=1 then 
  286. ''是商品则显示退货申请
  287. response.Write(" | <a href=""Mall/WithDraw_Apply.asp?Act=Add&OrderNumber="&RsOrderObj("OrderNumber")&""" title=""若你需要退货可点此进入退货申请或退货管理"">我要退货</a>")
  288. end if
  289. End if
  290. %>
  291.                   </td>
  292.                   <td class="hback_1"><div align="center">备注</div></td>
  293.                   <td class="hback"> 
  294.                     <% = RsOrderObj("Content")%>
  295.                   </td>
  296.                   <td class="hback_1"><div align="center">支付</div></td>
  297.                   <td class="hback"> 
  298. <%
  299. if RsOrderObj("IsSuccess")=0 then
  300. if RsOrderObj("M_PayStyle") =0 then
  301. %>
  302. <a href="onlinepay.asp?OrderNumber=<% = RsOrderObj("OrderNumber")%>&Moneys=<%=sum_Moeny%>&OrderID=<%=RsOrderObj("OrderID")%>"><strong><font color="#FF0000">支付</font></strong></a> 
  303. <%
  304. Elseif RsOrderObj("M_PayStyle") =1 or RsOrderObj("M_PayStyle") =2 then
  305. %>
  306. <a href="PayCenter.asp?PayStyle=PostOrBank&OrderNumber=<% = RsOrderObj("OrderNumber")%>&Moneys=<%=sum_Moeny%>&OrderID=<%=RsOrderObj("OrderID")%>"><strong><font color="#FF0000">支付</font></strong></a> 
  307. <%
  308. Elseif RsOrderObj("M_PayStyle") =3 then
  309. %>
  310. <a href="PayCenter.asp?PayStyle=MySelfAcc&OrderNumber=<% = RsOrderObj("OrderNumber")%>&Moneys=<%=sum_Moeny%>&OrderID=<%=RsOrderObj("OrderID")%>"><strong><font color="#FF0000">支付</font></strong></a> 
  311. <%
  312. Else
  313. %>
  314. <a href="PayCenter.asp?PayStyle=Card&OrderNumber=<% = RsOrderObj("OrderNumber")%>&Moneys=<%=sum_Moeny%>&OrderID=<%=RsOrderObj("OrderID")%>"><strong><font color="#FF0000">支付</font></strong></a> 
  315. <%
  316. End if
  317. Else
  318. %>
  319. 已支付 
  320. <%
  321. End if
  322. %>
  323.                   </td>
  324.                 </tr>
  325.               </table></td>
  326.           </tr>
  327.           <%
  328.   RsOrderObj.MoveNext
  329.   Next
  330.   %>
  331.           <tr class="hback"> 
  332.             <td colspan="6" class="xingmu"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
  333.                 <tr> 
  334.                   <td width="80%"> <span class="top_navi"> 
  335.                     <%  Response.Write("每页:"& RsOrderObj.pagesize &"个,")
  336. Response.write"&nbsp;共<b>"& select_pagecount &"</b>页<b>&nbsp;" & select_count &"</b>条记录,本页是第<b>"& strpage &"</b>页。"
  337. if int(strpage)>1 then
  338. Response.Write"&nbsp;<a href=?page=1&LogType="&Request("LogTye")&">第一页</a>&nbsp;&nbsp;"
  339. Response.Write"&nbsp;<a href=?page="&cstr(cint(strpage)-1)&"&LogType="&Request("LogTye")&">上一页</a>&nbsp;&nbsp;"
  340. End if
  341. If int(strpage)<select_pagecount then
  342. Response.Write"&nbsp;<a href=?page="&cstr(cint(strpage)+1)&"&LogType="&Request("LogTye")&">下一页</a>&nbsp;"
  343. Response.Write"&nbsp;<a href=?page="& select_pagecount &"&LogType="&Request("LogTye")&">最后一页</a>&nbsp;&nbsp;"
  344. End if
  345. Response.Write"<br>"
  346. RsOrderObj.close
  347. Set RsOrderObj=nothing
  348. End if
  349. %>
  350.                     </SPAN></td>
  351.                 </tr>
  352.               </table></td>
  353.           </tr>
  354.         </form>
  355.       </table>
  356.       </td>
  357.     </tr>
  358.     <tr class="back"> 
  359.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  360.           <!--#include file="Copyright.asp" -->
  361.         </div></td>
  362.     </tr>
  363.  
  364. </table>
  365. </body>
  366. </html>
  367. <%
  368. '得到商品栏目地址
  369. function get_productsLink(f_id)
  370. MFConfig_Cookies
  371. get_productsLink = ""
  372. dim rs,config_rs,config_mf_rs,class_rs
  373. dim SaveproductsPath,fileName,FileExtName,ClassId,IsDomain,LinkType,Mf_Domain,Url_Domain,ClassEName,c_Domain,c_SavePath
  374. set rs = Conn.execute("select ID,ClassId,SavePath,fileName,fileExtName from fS_MS_products where Id="&f_id)
  375. SaveproductsPath = rs("SavePath")
  376. fileName = rs("fileName")
  377. fileExtName = rs("fileExtName")
  378. ClassId = rs("ClassId")
  379. set config_rs = Conn.execute("select top 1 IsDomain from fS_MS_SysPara")
  380. IsDomain = config_rs("IsDomain")
  381. LinkType = "1"
  382. config_rs.close:set config_rs=nothing
  383. Mf_Domain = Request.Cookies("foosunMfCookies")("foosunMfDomain")
  384. set class_rs = Conn.execute("select ClassEName,IsURL,URLAddress,[Domain],SavePath from fS_MS_productsClass where ClassId='"&ClassId&"'")
  385. if not class_rs.eof then
  386. ClassEName = class_rs("ClassEName")
  387. c_Domain = class_rs("Domain")
  388. c_SavePath = class_rs("SavePath")
  389. class_rs.close:set class_rs=nothing
  390. else
  391. ClassEName = ""
  392. class_rs.close:set class_rs=nothing
  393. end if
  394. if not rs.eof then
  395. if trim(c_Domain)<>"" then
  396. Url_Domain = "http://"&c_Domain
  397. else
  398. Url_Domain = ""
  399. end if
  400. get_productsLink = Url_Domain & c_SavePath& "/" & ClassEName &SaveproductsPath &"/"&fileName&"."&fileExtName
  401. rs.close:set rs=nothing
  402.   else
  403. get_productsLink = ""
  404. rs.close:set rs=nothing
  405.   end if
  406.   get_productsLink = get_productsLink
  407. End function
  408. Set Fs_User = Nothing
  409. %>
  410. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->