productbuy.asp

来自「生成html的ASP企业站点,可以进行二次开发的」· ASP 代码 · 共 324 行

ASP
324
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/NoHackSql.Asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<%call SiteInfo
headid=0
showtitle="Order Product"
%>
<!--#include file="Head.Asp" -->
<%
dim Products
dim mMemID,mRealName,mSex,mCompany,mAddress,mZipCode,mTelephone,mFax,mMobile,mEmail
if session("MemName")<>"" and session("MemLogin")="Succeed" then
  call MemInfo()
else
  mSex="Male"
  mMemID=0
end if
%>
<div class="clear"></div>
<div id="contant">
  <div class="cleft">
    
	<div class="news">
      <div class="title">
	  &nbsp;<b>Product List</b>
	  </div>
	  <div>
	  <ul>
	  <%call CallFolderView()%>
	  </ul>
	  </div>
    </div>
	<div class="news">
      <div class="title">
	  &nbsp;<b>Hot Product</b>
	  </div>
	  <div>
	  <ul>
	  <%=Producthot(10)%>
	  </ul>
	  </div>
    </div>
  </div>
  <div class="cright">
	<div class="crightb">
	  <div class="crightbtitle">
	    <div class="crightbtitlel">
		Location:
		</div>
		<div class="crightbtitler">
		<%=WebLocation()%>
		</div>
	  </div>
	  <div class="crightbcontent">
<table cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff" border="0" heihgt="">
    <tbody>
        <tr>
          <td height="18">&nbsp;</td>
        </tr>
        <tr>
          <td><% call ProductList() %></td>
        </tr>
        <tr>
          <td><table width="98%" border="0" align="center" cellpadding="3" cellspacing="5">
              <form action="ProductBuySave.asp?MemberID=<%=mMemID%>" method="post" name="formBuy" id="formBuy">
                <tr>
                  <td width="200" align="right">Title:</td>
                  <td><input name="OrderName" type="text" id="OrderName" value="Order product" size="40" maxlength="100" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Comments:</td>
                  <td><input type="hidden" name="Products" value="<%=Products%>" />
                    <textarea name="Remark" cols="80" rows="8" id="Remark"></textarea></td>
                </tr>
                <tr>
                  <td align="right">Name:</td>
                  <td><input name="RealName" type="text" id="RealName" value="<%=mRealName%>" size="20" maxlength="50" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Sex:</td>
                  <td><input name="Sex" type="radio" value="Male" class="inputnoborder" <%if mSex="Male" then response.write ("checked")%> />
                    M
                    <input type="radio" name="Sex" value="女士" class="inputnoborder" <%if mSex="女士" then response.write ("checked")%> />
                    F <font color="red">*</font></td></tr>
                <tr>
                  <td align="right">Company/Name:</td>
                  <td><input name="Company" type="text" id="Company" value="<%=mCompany%>" size="40" maxlength="100" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Address:</td>
                  <td><input name="Address" type="text" id="Address" value="<%=mAddress%>" size="40" maxlength="100" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Postal Code:</td>
                  <td><input name="ZipCode" type="text" id="ZipCode" value="<%=mZipCode%>" size="20" maxlength="20" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Tel:</td>
                  <td><input name="Telephone" type="text" id="Telephone" value="<%=mTelephone%>" size="20" maxlength="50" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Fax:</td>
                  <td><input name="Fax" type="text" id="Fax" value="<%=mFax%>" size="20" maxlength="50" />
                  <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Mobile:</td>
                  <td><input name="Mobile" type="text" id="Mobile" value="<%=mMobile%>" size="20" maxlength="50" />
                  <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Email:</td>
                  <td><input name="Email" type="text" id="Email" value="<%=mEmail%>" size="30" maxlength="50" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">Number:</td>
                  <td><input name="CheckCode" type="text" size="6" maxlength="6" />
                    <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>
                </tr>
                <tr>
                  <td align="right">&nbsp;</td>
                  <td><input name="Submit" type="submit" value="Save" /></td>
                </tr>
              </form>
            </table></td>
        </tr>
        <tr>
          <td height="20">&nbsp;</td>
        </tr>
      </table>
</div>
	</div>
  </div>
</div>
<!--#include file="Foot.Asp"-->
<%
'调用显示节点------------------------------
Function CallFolderView()
%>
<% Folder(0) %>
<%
End Function
'列出所有节点------------------------------
Function Folder(id)
  Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType,ViewFlag
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From LiangJingCMS_ProductSort where ViewFlag"&Language&" and ParentID="&id&" order by id"
  rs.open sql,conn,1,1
  if id=0 and rs.recordcount=0 then
    response.write ("No Information!")
    response.end
  end if  
  i=1
  response.write("<table border='0' cellspacing='0' cellpadding='0' style='margin-left:16px;'>")
  while not rs.eof
    ChildCount=conn.execute("select count(*) from LiangJingCMS_ProductSort where ParentID="&rs("id"))(0)
    if ChildCount=0 then
	  if i=rs.recordcount then
	    FolderType="SortFileEnd"
	  else
	    FolderType="SortFile"
	  end if
	  FolderName=rs("SortNameEn")&"&nbsp;"&ViewFlag
	  onMouseUp=""
    else
	  if i=rs.recordcount then
	 	FolderType="SortEndFolderOpen"
		ListType="SortEndListline"
		onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
	  else
		FolderType="SortFolderOpen"
		ListType="SortListline"
		onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
	  end if
	  FolderName=rs("SortNameEn")&"&nbsp;"&ViewFlag
    end if
    response.write("<tr>")
    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;")
    response.write("</td></tr>")
    if ChildCount>0 then
%>
      <tr id="a<%= rs("id")%>" style="display:none"><td class="<%= ListType%>" nowrap></td><td ><% Folder(rs("id")) %></td></tr>
<%
    end if
    rs.movenext
    i=i+1
  wend
  response.write("</table>")
  rs.close
  set rs=nothing
end function

function WebMenu(ParentID,i,level)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from LiangJingCMS_ProductSort where ViewFlag"&Language&" and ParentID="&ParentID&" order by ID asc"
  rs.open sql,conn,1,1
  if conn.execute("select ID from LiangJingCMS_ProductSort Where ViewFlag"&Language&" and ParentID=0").eof then
    response.write "No relevant information"
  end if
  do while not rs.eof
  	If ISHTML = 1 Then
		AutoLink = ""&ProSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
	Else
		AutoLink = "ProductList.asp?SortID="&rs("ID")&""
	End If
	if ParentID=0 then
	  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>"
	else
	  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>"
	end if
    i=i+1
	if i<level then call WebMenu(rs("ID"),i,level)
	i=i-1
	rs.movenext
  loop 
  rs.close
  set rs=nothing
end function


function WebLocation()
  WebLocation="&nbsp;Location:<a href=""index.asp"" class=""agray"">Home</a> - <a href=""ProductList.asp"" class=""agray"">Product</a> - Orders"&VbCrLf
end Function

function NoList()
  if request("UpdateOrder")="Update" then
    Session("NoList")=""
  end if
  dim ProductNo,NoArray,i
  if trim(request("ProductNo"))<>"" then ProductNo=trim(request("ProductNo"))&","
  if session("NoList")="" and trim(request("ProductNo"))="" then
    NoList=""
    exit function
  end if
  if instr(ProductNo,",")>0 then
  	NoArray=split(ProductNo, ",")
  	for i = 0 to ubound(NoArray)
      if not instr(session("NoList"),NoArray(i)&",")>0 then session("NoList")=session("NoList")&NoArray(i)&","
  	next
  end if
  for i = 0 to ubound(split(session("NoList"), ","))
    NoList=NoList&"'"&trim(split(session("NoList"),",")(i))&"',"
  next
  NoList=left(NoList,len(NoList)-4)
end Function

function ProductList()
	Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
	Response.Write "  <form action=""ProductBuy.asp"" method=""POST"" name=""check"">"&VbCrLf
	Response.Write "    <tr>"&VbCrLf
	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
	Response.Write "    </tr>"&VbCrLf
if Nolist()="" then
	Response.Write "    <tr>"&VbCrLf
	Response.Write "      <td height=""28"" colspan=""2"" align=""center"">No Information</td>"&VbCrLf
	Response.Write "    </tr>"&VbCrLf
else
	dim rs,sql
	set rs = server.createobject("adodb.recordset")
	sql="select * from LiangJingCMS_Products where ProductNo in ("&NoList()&") order by id"
	rs.open sql,conn,1,1
	while not rs.eof
	If ISHTML = 1 Then
		AutoLink = ""&ProName&""&Separated&""&rs("ID")&"."&HTMLName&""
	Else
		AutoLink = "ProductView.asp?ID="&rs("ID")&""
	End If
	Response.Write "    <tr>"&VbCrLf
	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
	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
	Response.Write "    </tr>"&VbCrLf
	Products=Products&rs("ProductName"&Language)&" Product No:"&rs("ProductNo")&"<br />"
	rs.movenext
    wend
	Response.Write "    <tr>"&VbCrLf
	Response.Write "      <td colspan=""2"" height=""35""><input type=""submit"" name=""UpdateOrder"" value=""Up_date""></td>"&VbCrLf
	Response.Write "    </tr>"&VbCrLf
    rs.close
    set rs=nothing
end if
	Response.Write "  </form>"&VbCrLf
	Response.Write "</table>"&VbCrLf
end function
sub MemInfo()
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from LiangJingCMS_Members where MemName='"&session("MemName")&"'"
  rs.open sql,conn,1,1
  if rs.bof and rs.eof then
    response.write "<center>No relevant information</center>"
  else
    mMemID=rs("ID")
	if not rs("RealName")="" then
	  mRealName=rs("RealName")
	else
	  mRealName=rs("MemName")
	end if
	mSex=rs("Sex")
	mCompany=rs("Company")
	mAddress=rs("Address")
	mZipCode=rs("ZipCode")
	mTelephone=rs("Telephone")
	mFax=rs("Fax")
	mMobile=rs("Mobile")
	mEmail=rs("Email")
  end if
  rs.close
  set rs=nothing
end sub
%>
<script language="javascript">
<!--
function refreshimg(){document.all.checkcode.src="../Include/CheckCode/CheckCode.asp";}
//-->
</script>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?