计算机应用 | 古代文学 | 市场营销 | 生命科学 | 交通物流 | 财务管理 | 历史学 | 毕业 | 哲学 | 政治 | 财税 | 经济 | 金融 | 审计 | 法学 | 护理学 | 国际经济与贸易
计算机软件 | 新闻传播 | 电子商务 | 土木工程 | 临床医学 | 旅游管理 | 建筑学 | 文学 | 化学 | 数学 | 物理 | 地理 | 理工 | 生命 | 文化 | 企业管理 | 电子信息工程
计算机网络 | 语言文学 | 信息安全 | 工程力学 | 工商管理 | 经济管理 | 计算机 | 机电 | 材料 | 医学 | 药学 | 会计 | 硕士 | 法律 | MBA
现当代文学 | 英美文学 | 通讯工程 | 网络工程 | 行政管理 | 公共管理 | 自动化 | 艺术 | 音乐 | 舞蹈 | 美术 | 本科 | 教育 | 英语 |

ASP在线花店系统(一)毕业论文网(3)

2013-07-27 01:07
导读:end if dim strUrlGo strUrlGo="Detail.asp?id="productid % !--#include file="inc/login.asp"-- % dim MyListUse,MyListFlower,MyListObject,MyListPrice MyListUse="0" MyListFlower="0" MyListObject="0" MyList

  end if
  dim strUrlGo
  strUrlGo="Detail.asp?id="&productid
 %>
 <!--#include file="inc/login.asp"-->
 <%
     dim MyListUse,MyListFlower,MyListObject,MyListPrice
     MyListUse="0"
     MyListFlower="0"
     MyListObject="0"
     MyListPrice="0"
 %>   
     <!--#include file="inc/navigation.asp"--></td>
     <td width="10">&nbsp;</td>
     <td valign="top">
  <!--#include file="inc/DetailOne.asp"-->    
  <br>
  <!--#include file="inc/CommentOne.asp"-->    
     </td>
   </tr>
 </table>
 <!--#include file="inc/bottom.html"-->
 </body>
 </html>
                                                                                
 例程3-10中利用包含文件<!--#include file="Detailone.asp"-->来显示单个产品的纤细信息;利用包含<!--#include file="commondb.asp"-->来显示针对该产品的所有评论信息。在页面中Detailone.asp先调用Getproduct方法得到产品对象,如例程3-11所示/
                        

(转载自中国科教评价网www.nseac.com )


                           例程3-11  调用Getproduct方法得到产品对象
                                                                                 
 〈%
      Dim one
      One=Getproduct (productid)
    If one(FIELDAYTOID)<0 Then
         Response.write”该商品不存在!”
         Response.end
       Else
 %>

                                                                         
 在例程3-11得到产品对象后,然后调用类似one(DIELDNAME)方法便可以得到产品名称等属性然后结合HTML控制便可以得到图3-10所示的效果。
 主页面主要包含头、尾文件。经过处理得到产品ID,如果没有就跳转到系统首页。
 Commentone.asp页面主要显示用户针对该产品的所有评论,例程3-12为Commentone.asp页面实现的参考代码。
   (科教范文网http://fw.nseac.com)
                     例程3-12  Commentone.asp页面实现的参考代码
                                                                             
 <%
   dim dbc,rs,query
   shopopendatabase dbc
     query =  "select TOP 10 * from comment where  productid = " & productid & " order by lasttime desc"
     set rs = dbc.execute(query)
     dim content,ptime,pren,preply
     dim n
     n=0
     Do WHILE not rs.EOF and n<10
  content= rs("comment")
  ptime = rs("lasttime")
  pren = rs("nickname")
  preply = rs("reply")
  n=n+1
 %>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="text6">
  <tr>
  <td style="padding-left:20px;padding-right:5px">
  &nbsp;&nbsp;<%=content%>
          </td>
          <td width="60"> <%=ptime%> </td>
          <td  width="45"> <%=pren%> </td>
  </tr>
 <%
  if (preply<>"") then 

(转载自http://zw.NSEaC.com科教作文网)


 %>
  <tr>
     <td style="padding-left:20px;padding-right:5px">
     &nbsp;&nbsp;<font color=red>答复:</font><%=preply %>
     </td>
     <td width="60">
     </td>
     <td width="45">
     </td>
    </tr>
 <%
  end if
 %>
  <tr>
     <td colspan="3" background='images/topbg.gif' height=3></td>
    </tr>
  </table>
 <%
  rs.movenext      
     Loop
     closerecordset rs
     shopclosedatabase dbc
 %>
                                                                               
 
 例程3-12中的query =  "select TOP 10 * from comment where  productid = " & productid & " order by lasttime desc"语句,是从数据库comment表中得到相关产品的最后增加的前10条评论(按时间倒顺序排列,然后取前10条)。
 
3.5.3我的购物车页面设计

我的购物车页面主要暂存用户选择的预购买的产品,图3-21为购物车页面。
.
                         图3-21  购物车页面 (转载自科教范文网http://fw.nseac.com)
Cart.asp购物车页面代码如例程3-13所示。

                        例程3-13  cart.asp购物车页面代码
                                                                            
<%
dim myaction
dim cartstr,cartnumstr
DimMyProductArray(20), MyNumArray(20),totalnum,MyProductArrayTmp,MyNumArrayTmp
cartstr = getCartFromCookie()
cartnumstr=getCartNumFromCookie()
 
if (cartstr=NULL or cartstr ="") then
cartstr =""
end if
if (cartnumstr=NULL or cartnumstr ="") then
cartnumstr =""
end if
MyProductArrayTmp = Split(cartstr, ",",-1,1)
MyNumArrayTmp = Split(cartnumstr, ",",-1,1)
'response.write "cartstr=" & cartstr &"<br>"
'response.write "cartnumstr=" & cartnumstr &"<br>"
'response.write "UBound(MyProductArrayTmp)=" &UBound(MyProductArrayTmp) &"<br>"
'response.write "LBound(MyProductArrayTmp)=" &LBound(MyProductArrayTmp) &"<br>"
'response.write "UBound(MyNumArrayTmp=" &UBound(MyNumArrayTmp) &"<br>"
'response.write "LBound(MyNumArrayTmp)=" &LBound(MyNumArrayTmp) &"<br>"

If(UBound(MyProductArrayTmp)<>UBound(MyNumArrayTmp)or LBound(MyProductArrayTmp)<>LBound(MyNumArrayTmp)) then
cartstr =""
cartnumstr =""
setCartToCookie cartstr,cartnumstr,0,0
 MyProductArrayTmp = Split(cartstr, ",",-1,1)
 MyNumArrayTmp = Split(cartnumstr, ",",-1,1) (科教作文网http://zw.ΝsΕac.cOM编辑)
end if
dim n
For n =LBound(MyProductArrayTmp) to  UBound(MyProductArrayTmp)
MyProductArray(n)=MyProductArrayTmp(n)
MyNumArray(n)=MyNumArrayTmp(n)
Next
totalnum=getCartTotalNumFromCookie()
if (totalnum=NULL or totalnum="") then
totalnum=0
end if
myaction=request("myaction")
dim productidif (myaction="add") then
productid=request("productid")
if (IsValid(productid)) then
if (cartstr=NULL or cartstr ="") then
 cartstr=productid
 cartnumstr=1
MyProductArray(0)=productid
 MyNumArray(0)=1
 totalnum=1
else
Dim i,IsExist
 IsExist="false"
For i = 0 to CInt(totalnum)-1
if (MyProductArray(i) =productid) then
 IsExist="true"
 exit for
 end if
if (IsExist="true") then
MyNumArray(i)=MyNumArray(i)+1    
 cartnumstr=""
For i = 0 to CInt(totalnum)-1
 if (cartnumstr="") then
cartnumstr=CStr(MyNumArray(0))
 else
cartnumstr=CStr(cartnumstr)+","+CStr(MyNumArray(i))
 end if 
 Next
else
cartstr=CStr(cartstr)+","+CStr(productid)
cartnumstr=cartnumstr+",1"
MyProductArray(totalnum)=productid
MyNumArray(totalnum)=1
totalnum=totalnum+1
end if 
end if
setCartToCookie cartstr,cartnumstr,totalnum,0
response.redirect("cart.asp")
response.end
else
 response.write "增加的产品id不合法!<br>" 
end if 
else
 if(myaction="del") then
productid=request("productid")
if (IsValid(productid)) then
 cartstr=""
cartnumstr=""
For i = 0 to CInt(totalnum)-1
 if (productid<>MyProductArray(i)) then
 if (cartnumstr="") then
cartstr=CStr(MyProductArray(i))
cartnumstr=CStr(MyNumArray(i)) (科教作文网http://zw.ΝsΕAc.com发布)
end
cartstr=cartstr+","+CStr(MyProductArray(i))
cartnumstr=CStr(cartnumstr)+","+CStr(MyNumArray(i))
 end if 
end if
 Next
end if
else
 if(myaction="update") then 
 cartstr="update"
else
end if
end if
end ifsetCartToCookie cartstr,cartnumstr,totalnum,0
ShowCart("yes")
%>
  
3.5.4结帐处理
   
 当用户把产品放进购物车中,单击“结帐”按钮时,需要显示结帐页面,结帐页面如图3-22所示。
 结帐页面对应的文件是check.asp.从图3-22可以看出,在结帐页面需要先显示用户决定购买的产品信息,然后提供表单让用户输入姓名,选择送货的时间等。
 
 
                             图3-22 网站结帐页面
 例程3-14为结帐页面表单的参考代码
 
                           例程3-14  结帐页面表单的参考代码
                                                                         
<%
dim cartstr
cartstr = getCartFromCookie()
if (cartstr=NULL or cartstr ="") then
response.redirect "Cart.asp"
response.end
end if
dim payName,payPhone,payEmail,payAddress
if (session("userautoid")<=0) then (科教范文网 fw.nseac.com编辑发布)
payName=""
payPhone=""
payEmail=""
payAddress=""
else
dim dbc,query,rs
shopopendatabase dbc
query =  "select * from myUser where autoid = " & session("userautoid")
set rs = dbc.execute(query)
Ifrs.EOF ThepayName=rs("realname")payPhone=rs("phone")payEmail=rs("userid")payAddress=rs("Address")end if
   closerecordset rs 
   shopclosedatabase dbc
end if

%>
<html>
<head>
<title>绿植鲜花玩具礼品店</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc/lvzhi.css" type="text/css">
<STYLE type=text/css>TD {
    FONT-SIZE: 12px; FONT-FAMILY: "宋体"
}
</STYLE>
<script language="java script">
    function setReceiverFormVisible(vGet)
        {if(vGet=='1'){document.all.receiverinfo_form.style.display='none';}else{document.all.receiverinfo_form.style.display='block'}
function checkinput(){var payName=document.mymainform.MypayName.value;
 if (payName=="")
{alert("付款人名称不能为空!");
document.mymainform.MypayName.focus();
eturn false;}
var payPhone=document.mymainform.payPhone.value;
 if (payPhone=="")
{alert("付款人电话不能为空!");
document.mymainform.payPhone.focus();
eturn false;}
f(document.mymainform.myrec2.checked==true)
{var recName=document.mymainform.recName.value;
 if (recName==""){alert("收货人名称不能为空!");
document.mymainform.recName.focus();
eturn false;}
var recPhone=document.mymainform.recPhone.value;
 f (recPhone==""){alert("收货人电话不能为空!");
document.mymainform.recPhone.focus();
return false;}}
return true;}
</script>

(科教范文网 Lw.nsEAc.com编辑整理)

</head>
<body bgcolor="#FFFFFF" topmargin="0">
<!--#include file="inc/top.html"--> <br>
<%
ShowCart("yes")
%>
<form name=mymainform id=mymainform action="CheckConfirm.asp" method=post onSubmit="return checkinput();">
<table width="760" border="0" cellspacing="1" cellpadding="3" bgcolor="#4a4a4a" align="center">
  <tr class="title">
    <td colspan="7"><b>付款人信息</b>(姓名,电话必填项,客服确认后收款发货)</td>
  </tr>
 <tr class="bg2">
    <td colspan="7" align="center">
      <input type=radio name=myrec  value="1" id=myrec1 onClick="setReceiverFormVisible('1')" checked>
      付款人收货(付款与收货同一个人)
      <input type=radio name=myrec  value="2"  id=myrec2 onClick="setReceiverFormVisible('2')">
      其他人收货(付款送给其他人) </td>
  </tr>
</table>
  <table width="760" border="0" cellspacing="1" cellpadding="3" bgcolor="#4a4a4a" align="center">
  <tr class="bg1">
    <td width="14%">您的姓名:
    </td>
    <td width="36%">
   <input type="text" id="MypayName" name="MypayName" size=20 maxlength=40 value="<%=payName%>">
     </td>
    <td width="14%">联系电话:
    </td>
    <td width="36%">
   <input type="text" id="payPhone" name="payPhone" size=20 maxlength=40 value="<%=payPhone%>">
     </td> (转载自http://zw.nseac.coM科教作文网)
  </tr>
   <tr class="bg1">
    <td width="14%">邮箱Email:
    </td>
    <td width="36%">
   <input type="text" id="payName" name="payEmail" size=20 maxlength=40 value="<%=payEmail%>">
     </td>
    <td width="14%">详细地址:
    </td>
    <td width="36%">
   <input type="text" id="payName" name="payAddress" size=20 maxlength=40 value="<%=payAddress%>">
     </td>
  </tr>
  <tr class="bg1">
   <td width="14%">送货时间:
    </td>
   <td width="86%" colspan=3>
     <select id="sendMonth" name="sendMonth">
              <option  value=1>1</option>
              <option  value=2>2</option>
              <option  value=3>3</option>
              <option  value=4>4</option>
              <option  value=5>5</option>
              <option  value=6>6</option>
              <option  value=7>7</option>
              <option  value=8>8</option> (转载自http://zw.NSEAC.com科教作文网)
              <option  value=9>9</option>
              <option  value=10>10</option>
              <option  value=11>11</option>
              <option  value=12>12</option>
     </select>月
     <select id="sendDay" name="sendDay">
              <option  value=1>1</option>
              <option  value=2>2</option>
              <option  value=3>3</option>
              <option  value=4>4</option>
              <option  value=5>5</option>
              <option  value=6>6</option>
              <option  value=7>7</option>
              <option  value=8>8</option>
              <option  value=9>9</option>
              <option  value=10>10</option>
              <option  value=11>11</option> (转载自中国科教评价网http://www.nseac.com
              <option  value=12>12</option>
              <option  value=13>13</option>
              <option  value=14>14</option>
              <option  value=15>15</option>
              <option  value=16>16</option>
              <option  value=17>17</option>
              <option  value=18>18</option>
      &
上一篇:信用卡数据分析系统编程理论基础(一)毕 下一篇:没有了