。近年来,网络购物已经成为潮流,越来越多的人开始注重将电子商务应用到农产品的交易中。当前,国内农产品电子商务的应用大部分是以农产品信息发布平台的形式存在,还不能满足真正实现农产品的虚拟交易。本平台基于B/S(服务器/浏览器)模式架构,以ASP作为主要开发环境,Dreamweaver 搭建主要框架并以Access2007建立后台数据库,分前台和后台功能模块,前台模块包括用户登录模块、农产品信息模块、农业新闻发布展示模块、在线选购和交易信息反馈等模块;后台有会员基础信息管理、农产品信息管理、新闻管理、留言管理、订单管理,通过这些功能模块的实现,为农户开拓了更为广泛的交易市场,加强了农户与供应商、经销商之间的交流,使得供需双方的目标更为明确,为整个农产品市场的发展带来一定的利益。
关键词:网络交易平台; ASP;Access2007;B/S结构
I
The Design of Internet Trading Platform of ‘TianJia’
China is a big country of agriculture, and agriculture is the basic industry :Abstract
of our country. China is rich in agricultural resources what are widely distributed in China. However many farmers and operators have asymmetric information in the agricultural production and sale. In recent years, online shopping has become to be a
trend, more and more people had forced themselves on the agricultural mode of e-commerce transactions. At present, the domestic agricultural e-commerce applications are mostly in the form of information publishing platform, it can not content the truly virtual trading of agricultural products. This system bases on the B/S pattern, uses ASP to take the main development language, builds the main frame with Dreamweaver, and uses Microsoft Access as the back database. The system is divided into foreground and background sub-function module, the foreground including the user login module, agricultural information module, agricultural news show module, online purchasing and trading information feedback module; The background including the customer information management, agricultural information management,news management, message management and orders management modules. These functional modules, not only open up a broader market for farmers, but also strengthened the communication between the farmers, suppliers and demand, so the trading platform will brought a new opportunity to agricultural markets.
Internet trading platform; ASP; Microsoft Access; B/S Structure :Key words
II
目 录
摘要 ............................................................ I Abstract ........................................................?
1.前 言.......................................................... 1
1.1平台开发的背景 ............................................... 1
1.2平台
<%
dim nclassid
nclassid=request("nclassid")
set rss=server.createobject("adodb.recordset")
if request("nclassid")<>"" then If Not(isNumeric(nclassid)) or nclassid="" or nclassid=0 Then‘判断循环条件 response.write ""
33
“田家”农产品网络交易平台开发
response.End
End If
rss.open "select nclassid,nclass from shop_nclass where ‘获取农产品编号和名称nclassid="&nclassid,conn,1,1 else
rss.open "select nclassid,nclass from shop_nclass order by nclassid
desc",conn,1,1
end if
do while not rss.eof
nclassid=rss("nclassid")
set rs=server.createobject("adodb.recordset")
rs.open "select priceid,nclassid,nclass,price1,price2 from shop_price where
nclassid='"&nclassid&"' order by priceid desc",conn,1,1%>
<%i=1
do while not rs.eof
i=-i%>
<%=rs("nclass")%>
,<%=trim(rs("price1"))%>元/千克
,<%=trim(rs("price2"))%>元/千克
<%rs.movenext
loop
rs.close
set rs=nothing
rss.movenext
loop
rss.close
set rss=nothing%>
news.asp文件:
农业动态
<%
set conn=server.createobject("adodb.Connection") connstr="provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath(""&"database/Vshop.mdb") conn.Open connstr
set rs=server.createobject("adodb.recordset") sql="select * from shop_news"
rs.open sql,conn,1,1
if rs.eof then
%>
<%
else
do while not rs.eof
%>
<%
newsid=rs("newsid")
sql1="select top 5 * from shop_news where newsid="&newsid&" order by newsid
DESC"
set rs1=server.createobject("adodb.recordset") rs1.open sql1,conn,3,3
35
“田家”农产品网络交易平台开发
if rs1.eof then
else
do while not rs1.eof
%>
<%
if len(rs1("newstitle"))>30 then
newstitle=left(rs1("newstitle"),11) %>
<%=newstitle%>„„ <%else%>
"><%=rs1("newstitle")%>
<%end if%>
<%
rs1.movenext
loop
end if
rs1.close
%>
<%
rs.movenext
loop
end if
rs.close
%>
3.留言管理代码设计
Lygl.asp文件:
36
盐城工学院本科生毕业设计报告 2011
留言管理
<%
Const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
select case selectm
37
“田家”农产品网络交易平台开发
case ""
rs.open "select id,name,content,dates from lygl order by dates
desc",conn,1,1
case "0"
response.write "
"
response.End
case "name"
rs.open "select id,name,content,dates from lygl where name like '%"&selectkey&"%' order by dates desc",conn,1,1
case "zuozhe"
rs.open "select id,name,content,dates from lygl where makein like '%"&selectkey&"%' order by dates desc",conn,1,1
case "chubanshe"
rs.open "select id,name,content,dates from lygl where mark like '%"&selectkey&"%' order by dates desc",conn,1,1
end select
if err.number<>0 then
response.write "数据库中无数据"
end if
if rs.eof And rs.bof then
Response.Write "
数据库中无数据~
"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if
(currentpage-1)*MaxPerPage>totalput then
if (totalPut mod
MaxPerPage)=0 then
currentpage= totalPut \
MaxPerPage
else
38
盐城工学院本科生毕业设计报告 2011
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"xwgl.asp"
else
if
(currentPage-1)*MaxPerPage
41
“田家”农产品网络交易平台开发
附录三 用户操作手册 1.运行环境
系统除了需要以下的软硬件环境外,不需要另外安装其他的文件或程序。
硬件环境:
(1)内存:1GMB以上;
(2)硬盘:50G以上。
软件环境:
(1)操作系统:Windows xp/Windows vista/Win7; (2)数据库:Microsoft Access 2007;
(3)浏览器:IE5.0,推荐使用IE6.0;
(4)Web服务器:IIS6.0;
(5)分辨率:最佳效果1280*800。
2.Pc配置:
Win7或Vista操作系统下,首先搜索IIS,如下图所示:
右击,选择添加虚拟目录,如下图所示:
42
盐城工学院本科生毕业设计报告 2011
IIS6.0安装完毕后,配置系统DSN,在控制面板,选择“管理工具”,ODBC数据源管理器,如下图所示:
以上所有配置完成后,就可以在IE浏览器中输入URL访问本地“田家”农产品网络交易平台的网站了。
3.前台操作
3.1用户注册
由于网站的大多数功能都以用户的登录为前提的。所以打开网站首页,用户应先进行注册。
注册步骤如下:
(1)单击网站首页的“注册”按钮。
(2)在填写用户信息页面输入各项信息。需要注意的是:“密码”与“确认密码”必须一致;“邮箱”格式要正确;“邮编”必须是六位数字。如果输入的信息有误,在提交时会出现错误提示。
(3)提交信息后,若出现“注册成功~请返回首页”提示,则表示注册成功。
3.2用户登录
43
“田家”农产品网络交易平台开发
在网站首页的“会员中心”的模块中输入用户名和密码,即完成登录操作。如果用户名或密码输入错误,则会出现错误提示。
3.3购物操作
用户登录后,最重要的是完成购物操作。整个购物过程步骤如下:
(1)用户选择自己想购买的商品,可以单击“购物车”图标。
(2)单击“购物车”图标,将商品放入购物车中。在出现的“我的购物车”页面中,用户可以选择“继续购物”,“去下订单”,完成修改数量后,点击“下一步”即可。
(3)在出现的页面中对购物的信息进行确认,若用户确认无误,则单击“下一步”,若信息有误,用户可以单击“修改购物车”返回购物车进行信息修改。
(4)用户单击“下一步”,出现收货信息页面。在该页面中,用户可以输入有关收货的相关信息,如收货地址,邮编,支付方式和支付方式等。完成信息输入后,单击“下一步”。
(5)出现订单信息,包括商品信息及收货信息。用户确认无误后,单击“完成”,即完成订单的生成。
3.4注销退出
为了方便用户退出登录,可以直接单击网站导航栏中的“注销退出”来完成退出系统。
4.后台操作
4.1后台会员管理模块
平台会员信息的管理,包括会员基本信息的添加、删除、修改。点击用户管理,可以设置用户权限。
4.2新闻发布管理
管理员进入后台,点击“新闻管理”,点击标题可以修改新闻内容。
4.3订单管理模块
管理员进入后台,点击“商品管理”分类下的“订单管理”,尽可进入用户订单信息管理。
4.4留言信息管理
在“留言管理”中管理员可以删除留言信息以及审核留言信息。
44