ProductBuy.Asp
上传用户:mtjhgs
上传日期:2021-12-08
资源大小:3755k
文件大小:12k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <!--#include file="../Include/Const.asp" -->
  3. <!--#include file="../Include/NoHackSql.Asp" -->
  4. <!--#include file="../Include/ConnSiteData.asp" -->
  5. <%call SiteInfo
  6. headid=0
  7. showtitle="Order Product"
  8. %>
  9. <!--#include file="Head.Asp" -->
  10. <%
  11. dim Products
  12. dim mMemID,mRealName,mSex,mCompany,mAddress,mZipCode,mTelephone,mFax,mMobile,mEmail
  13. if session("MemName")<>"" and session("MemLogin")="Succeed" then
  14.   call MemInfo()
  15. else
  16.   mSex="Male"
  17.   mMemID=0
  18. end if
  19. %>
  20. <div class="clear"></div>
  21. <div id="contant">
  22.   <div class="cleft">
  23. <div class="news">
  24.       <div class="title">
  25.   &nbsp;<b>Product List</b>
  26.   </div>
  27.   <div>
  28.   <ul>
  29.   <%call CallFolderView()%>
  30.   </ul>
  31.   </div>
  32.     </div>
  33. <div class="news">
  34.       <div class="title">
  35.   &nbsp;<b>Hot Product</b>
  36.   </div>
  37.   <div>
  38.   <ul>
  39.   <%=Producthot(10)%>
  40.   </ul>
  41.   </div>
  42.     </div>
  43.   </div>
  44.   <div class="cright">
  45. <div class="crightb">
  46.   <div class="crightbtitle">
  47.     <div class="crightbtitlel">
  48. Location:
  49. </div>
  50. <div class="crightbtitler">
  51. <%=WebLocation()%>
  52. </div>
  53.   </div>
  54.   <div class="crightbcontent">
  55. <table cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff" border="0" heihgt="">
  56.     <tbody>
  57.         <tr>
  58.           <td height="18">&nbsp;</td>
  59.         </tr>
  60.         <tr>
  61.           <td><% call ProductList() %></td>
  62.         </tr>
  63.         <tr>
  64.           <td><table width="98%" border="0" align="center" cellpadding="3" cellspacing="5">
  65.               <form action="ProductBuySave.asp?MemberID=<%=mMemID%>" method="post" name="formBuy" id="formBuy">
  66.                 <tr>
  67.                   <td width="200" align="right">Title:</td>
  68.                   <td><input name="OrderName" type="text" id="OrderName" value="Order product" size="40" maxlength="100" />
  69.                     <font color="red">*</font></td>
  70.                 </tr>
  71.                 <tr>
  72.                   <td align="right">Comments:</td>
  73.                   <td><input type="hidden" name="Products" value="<%=Products%>" />
  74.                     <textarea name="Remark" cols="80" rows="8" id="Remark"></textarea></td>
  75.                 </tr>
  76.                 <tr>
  77.                   <td align="right">Name:</td>
  78.                   <td><input name="RealName" type="text" id="RealName" value="<%=mRealName%>" size="20" maxlength="50" />
  79.                     <font color="red">*</font></td>
  80.                 </tr>
  81.                 <tr>
  82.                   <td align="right">Sex:</td>
  83.                   <td><input name="Sex" type="radio" value="Male" class="inputnoborder" <%if mSex="Male" then response.write ("checked")%> />
  84.                     M
  85.                     <input type="radio" name="Sex" value="女士" class="inputnoborder" <%if mSex="女士" then response.write ("checked")%> />
  86.                     F <font color="red">*</font></td></tr>
  87.                 <tr>
  88.                   <td align="right">Company/Name:</td>
  89.                   <td><input name="Company" type="text" id="Company" value="<%=mCompany%>" size="40" maxlength="100" />
  90.                     <font color="red">*</font></td>
  91.                 </tr>
  92.                 <tr>
  93.                   <td align="right">Address:</td>
  94.                   <td><input name="Address" type="text" id="Address" value="<%=mAddress%>" size="40" maxlength="100" />
  95.                     <font color="red">*</font></td>
  96.                 </tr>
  97.                 <tr>
  98.                   <td align="right">Postal Code:</td>
  99.                   <td><input name="ZipCode" type="text" id="ZipCode" value="<%=mZipCode%>" size="20" maxlength="20" />
  100.                     <font color="red">*</font></td>
  101.                 </tr>
  102.                 <tr>
  103.                   <td align="right">Tel:</td>
  104.                   <td><input name="Telephone" type="text" id="Telephone" value="<%=mTelephone%>" size="20" maxlength="50" />
  105.                     <font color="red">*</font></td>
  106.                 </tr>
  107.                 <tr>
  108.                   <td align="right">Fax:</td>
  109.                   <td><input name="Fax" type="text" id="Fax" value="<%=mFax%>" size="20" maxlength="50" />
  110.                   <font color="red">*</font></td>
  111.                 </tr>
  112.                 <tr>
  113.                   <td align="right">Mobile:</td>
  114.                   <td><input name="Mobile" type="text" id="Mobile" value="<%=mMobile%>" size="20" maxlength="50" />
  115.                   <font color="red">*</font></td>
  116.                 </tr>
  117.                 <tr>
  118.                   <td align="right">Email:</td>
  119.                   <td><input name="Email" type="text" id="Email" value="<%=mEmail%>" size="30" maxlength="50" />
  120.                     <font color="red">*</font></td>
  121.                 </tr>
  122.                 <tr>
  123.                   <td align="right">Number:</td>
  124.                   <td><input name="CheckCode" type="text" size="6" maxlength="6" />
  125.                     <a href="javascript:refreshimg()" title="Can not see clearly, change a picture."><img src="../Include/CheckCode/CheckCode.asp" name="checkcode" align="absmiddle" id="checkcode" style="border: 1px solid #ffffff" /></a> <font color="red">*</font></td>
  126.                 </tr>
  127.                 <tr>
  128.                   <td align="right">&nbsp;</td>
  129.                   <td><input name="Submit" type="submit" value="Save" /></td>
  130.                 </tr>
  131.               </form>
  132.             </table></td>
  133.         </tr>
  134.         <tr>
  135.           <td height="20">&nbsp;</td>
  136.         </tr>
  137.       </table>
  138. </div>
  139. </div>
  140.   </div>
  141. </div>
  142. <!--#include file="Foot.Asp"-->
  143. <%
  144. '调用显示节点------------------------------
  145. Function CallFolderView()
  146. %>
  147. <% Folder(0) %>
  148. <%
  149. End Function
  150. '列出所有节点------------------------------
  151. Function Folder(id)
  152.   Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType,ViewFlag
  153.   Set rs=server.CreateObject("adodb.recordset")
  154.   sql="Select * From Wygkcnflash_ProductSort where ViewFlag"&Language&" and ParentID="&id&" order by id"
  155.   rs.open sql,conn,1,1
  156.   if id=0 and rs.recordcount=0 then
  157.     response.write ("No Information!")
  158.     response.end
  159.   end if  
  160.   i=1
  161.   response.write("<table border='0' cellspacing='0' cellpadding='0' style='margin-left:16px;'>")
  162.   while not rs.eof
  163.     ChildCount=conn.execute("select count(*) from Wygkcnflash_ProductSort where ParentID="&rs("id"))(0)
  164.     if ChildCount=0 then
  165.   if i=rs.recordcount then
  166.     FolderType="SortFileEnd"
  167.   else
  168.     FolderType="SortFile"
  169.   end if
  170.   FolderName=rs("SortNameEn")&"&nbsp;"&ViewFlag
  171.   onMouseUp=""
  172.     else
  173.   if i=rs.recordcount then
  174.   FolderType="SortEndFolderOpen"
  175. ListType="SortEndListline"
  176. onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
  177.   else
  178. FolderType="SortFolderOpen"
  179. ListType="SortListline"
  180. onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
  181.   end if
  182.   FolderName=rs("SortNameEn")&"&nbsp;"&ViewFlag
  183.     end if
  184.     response.write("<tr>")
  185.     response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap><a href=""ProductList.asp?SortID="&rs("ID")&""">"&FolderName&"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
  186.     response.write("</td></tr>")
  187.     if ChildCount>0 then
  188. %>
  189.       <tr id="a<%= rs("id")%>" style="display:none"><td class="<%= ListType%>" nowrap></td><td ><% Folder(rs("id")) %></td></tr>
  190. <%
  191.     end if
  192.     rs.movenext
  193.     i=i+1
  194.   wend
  195.   response.write("</table>")
  196.   rs.close
  197.   set rs=nothing
  198. end function
  199. function WebMenu(ParentID,i,level)
  200.   dim rs,sql
  201.   set rs = server.createobject("adodb.recordset")
  202.   sql="select * from Wygkcnflash_ProductSort where ViewFlag"&Language&" and ParentID="&ParentID&" order by ID asc"
  203.   rs.open sql,conn,1,1
  204.   if conn.execute("select ID from Wygkcnflash_ProductSort Where ViewFlag"&Language&" and ParentID=0").eof then
  205.     response.write "No relevant information"
  206.   end if
  207.   do while not rs.eof
  208.    If ISHTML = 1 Then
  209. AutoLink = ""&ProSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
  210. Else
  211. AutoLink = "ProductList.asp?SortID="&rs("ID")&""
  212. End If
  213. if ParentID=0 then
  214.   response.write "<Li>  <img src=""images/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href="""&AutoLink&""" target=""_blank"" style=""margin-left:5px;"">"&rs("SortName"&Language)&"</a></li>"
  215. else
  216.   response.write string(i," ")&"<Li>  <img src=""images/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href="""&AutoLink&""" target=""_blank"" style=""margin-left:5px;"">"&rs("SortName"&Language)&"</a></li>"
  217. end if
  218.     i=i+1
  219. if i<level then call WebMenu(rs("ID"),i,level)
  220. i=i-1
  221. rs.movenext
  222.   loop 
  223.   rs.close
  224.   set rs=nothing
  225. end function
  226. function WebLocation()
  227.   WebLocation="&nbsp;Location:<a href=""index.asp"" class=""agray"">Home</a> - <a href=""ProductList.asp"" class=""agray"">Product</a> - Orders"&VbCrLf
  228. end Function
  229. function NoList()
  230.   if request("UpdateOrder")="Update" then
  231.     Session("NoList")=""
  232.   end if
  233.   dim ProductNo,NoArray,i
  234.   if trim(request("ProductNo"))<>"" then ProductNo=trim(request("ProductNo"))&","
  235.   if session("NoList")="" and trim(request("ProductNo"))="" then
  236.     NoList=""
  237.     exit function
  238.   end if
  239.   if instr(ProductNo,",")>0 then
  240.    NoArray=split(ProductNo, ",")
  241.    for i = 0 to ubound(NoArray)
  242.       if not instr(session("NoList"),NoArray(i)&",")>0 then session("NoList")=session("NoList")&NoArray(i)&","
  243.    next
  244.   end if
  245.   for i = 0 to ubound(split(session("NoList"), ","))
  246.     NoList=NoList&"'"&trim(split(session("NoList"),",")(i))&"',"
  247.   next
  248.   NoList=left(NoList,len(NoList)-4)
  249. end Function
  250. function ProductList()
  251. Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
  252. Response.Write "  <form action=""ProductBuy.asp"" method=""POST"" name=""check"">"&VbCrLf
  253. Response.Write "    <tr>"&VbCrLf
  254. Response.Write "      <td height=""28"" colspan=""2"" style=""background:url(Images/bg2.gif) repeat-x left bottom;"">The product that you make choice of purchase:</td>"&VbCrLf
  255. Response.Write "    </tr>"&VbCrLf
  256. if Nolist()="" then
  257. Response.Write "    <tr>"&VbCrLf
  258. Response.Write "      <td height=""28"" colspan=""2"" align=""center"">No Information</td>"&VbCrLf
  259. Response.Write "    </tr>"&VbCrLf
  260. else
  261. dim rs,sql
  262. set rs = server.createobject("adodb.recordset")
  263. sql="select * from Wygkcnflash_Products where ProductNo in ("&NoList()&") order by id"
  264. rs.open sql,conn,1,1
  265. while not rs.eof
  266. If ISHTML = 1 Then
  267. AutoLink = ""&ProName&""&Separated&""&rs("ID")&"."&HTMLName&""
  268. Else
  269. AutoLink = "ProductView.asp?ID="&rs("ID")&""
  270. End If
  271. Response.Write "    <tr>"&VbCrLf
  272. Response.Write "      <td width=""3%"" height=""28"" style=""background:url(Images/bg2.gif) repeat-x left bottom;""><input type=""CheckBox"" name=""ProductNo"" value="""&rs("ProductNo")&""" class=""inputnoborder"" Checked></td>"&VbCrLf
  273. Response.Write "      <td width=""97%"" style=""background:url(Images/bg2.gif) repeat-x left bottom;""><a href="""&AutoLink&""" title="""&rs("ProductName"&Language)&""">"&rs("ProductName"&Language)&"&nbsp;["&rs("ProductNo")&"]</a></td>"&VbCrLf
  274. Response.Write "    </tr>"&VbCrLf
  275. Products=Products&rs("ProductName"&Language)&" Product No:"&rs("ProductNo")&"<br />"
  276. rs.movenext
  277.     wend
  278. Response.Write "    <tr>"&VbCrLf
  279. Response.Write "      <td colspan=""2"" height=""35""><input type=""submit"" name=""UpdateOrder"" value=""Up_date""></td>"&VbCrLf
  280. Response.Write "    </tr>"&VbCrLf
  281.     rs.close
  282.     set rs=nothing
  283. end if
  284. Response.Write "  </form>"&VbCrLf
  285. Response.Write "</table>"&VbCrLf
  286. end function
  287. sub MemInfo()
  288.   dim rs,sql
  289.   set rs = server.createobject("adodb.recordset")
  290.   sql="select * from Wygkcnflash_Members where MemName='"&session("MemName")&"'"
  291.   rs.open sql,conn,1,1
  292.   if rs.bof and rs.eof then
  293.     response.write "<center>No relevant information</center>"
  294.   else
  295.     mMemID=rs("ID")
  296. if not rs("RealName")="" then
  297.   mRealName=rs("RealName")
  298. else
  299.   mRealName=rs("MemName")
  300. end if
  301. mSex=rs("Sex")
  302. mCompany=rs("Company")
  303. mAddress=rs("Address")
  304. mZipCode=rs("ZipCode")
  305. mTelephone=rs("Telephone")
  306. mFax=rs("Fax")
  307. mMobile=rs("Mobile")
  308. mEmail=rs("Email")
  309.   end if
  310.   rs.close
  311.   set rs=nothing
  312. end sub
  313. %>
  314. <script language="javascript">
  315. <!--
  316. function refreshimg(){document.all.checkcode.src="../Include/CheckCode/CheckCode.asp";}
  317. //-->
  318. </script>