Professional Documents
Culture Documents
Thuong Mai - Thuong Mai Dien Tu (E-Commerce)
Thuong Mai - Thuong Mai Dien Tu (E-Commerce)
Thng mi in t (E-Commerce) l qu trnh mua bn hng ho hay dch v thng qua mng in t. Phng tin ph bin dng trong ECommerce l Internet
GII THIU MN HC
Cng ngh thng tin v ang thay i mnh m, nhanh chng phng thc tin hnh hot ng kinh doanh, thay i c bn cc chin lc v t chc cng ty
GII THIU MN HC
Internet tc ng mnh m n mi hot ng ca nn kinh t, ngnh v doanh nghip; to dng mi trng kinh doanh mi, hnh thnh knh thng tin, cung cp, phn phi mi trn cc th trng in t. Cc hot ng thng mi in t nh mua bn hng ho, dch v, thng tin... ang tng trng vi tc rt cao hng nm v thc s lm thay i th gii, cc doanh nghip, cc ngnh ngh v tng c nhn
GII THIU MN HC
Thng mi in t thay i cc m hnh kinh doanh truyn thng; c bit i vi cc doanh nghip xut nhp khu, TMT em li phng thc tin hnh mi, hiu qu hn, nhanh hn cho tt c cc hot ng truyn thng, m ra c hi tip cn th trng quc t, nng cao hiu qu, tng li nhun, gim chi ph, duy tr v nng cao nng lc cnh tranh da trn cc ng dng cng ngh thng tin. Mc khc cng em li nhng nguy c ln nu khng nm bt ng dng cng ngh thng tin
GII THIU MN HC
Mn hc Thng mi in t ngy cng tr nn cn thit, do nhu cu kinh doanh, giao dch thng qua mng ngy cng tng ln. Thng mi in t gp phn hon thin thng mi truyn thng, lm gim ri ro, chi ph, nng cao hiu qu thng mi ni chung v bun bn quc t ni ring. i vi cc doanh nghip c lin quan n hot ng xut nhp khu ni ring v thng mi quc t ni chung Thng mi in t thc s cn thit v nhng li ch to ln m n ang v s em li.
i thng tin thng mi thng qua cc phng tin in t, khng cn phi in ra giy bt c cng on no ca ton b qu trnh giao dch. Thng tin c hiu l bt c th g c th truyn ti bng k thun in t, bao gm c th t, cc file vn bn, cc c s d liu, cc bn tnh, cc bn thit k, hnh ho, qung co, hi hng, n hng, ho n, bng gi, hp ng, hnh nh ng, m thanh...
Xc nh vn , c hi v mc tiu
Xc nh vn cn s gip ca h thng thng tin C hi l nhng tnh th c th cho php s dng h thng thng tin tng tnh cnh tranh Xc nh mc tiu tr li cu hi cn phi lm nhng g ?
Xc nh cc yu cu thng tin
Xc nh cc yu cu thng tin m ngi dng h thng a ra Kt qu giai on ny l bo co chc nng tng th cng nh tng b phn Cc kt qu ny cn c s thng nht ca ngi s dng v c vit dng ph thng d hiu
Thit k h thng mi
Thit k logic Thit k biu mu v mn hnh Thit k s thc th - quan h Thit k c s d liu Thit k u ra trn mn hnh, my in, a cng Kt qu giai on ny l mt ti liu m t chi tit cc trang mn hnh vo-ra, cc s , cc bng ca c s d liu cng vi th tc kim tra tnh ng n ca d liu
Kim nh h thng
Vic kim nh thng qua cc d liu gi nh v theo hai phng php: kim nh tng b phn v kim nh theo chc nng. Kim nh b phn bo m tng m un khng c sai st Kim nh chc nng nhm bo m chc nng chy thng sut
Ci t v nh gi h thng
Ci t ti v tr ngi dng o to ngi dng i cc tp tin ang c thnh cc tp tin c s d liu nh gi h thng: phi tha mn nhng yu cu t ra
Data Binding
Data binding cho php a d liu t bn ngoi chn vo trong trang web D liu c th ly t cc bin, cc trng, biu mu, c s d liu Dng data binding, c th qun tr d liu t xa ngay trong trnh duyt
ng dng client-side
Cc ng dng trong phm vi my client, c h tr bi trnh duyt. C th dng cc phn t HTML: text, images, multimedia, script, ng dng client-side khng x l y tnh nng ca mt h ng dng
ng dng server-side
ng dng server-side l ct li ca h ng dng, n bao gm thu nhn yu cu ca client, thc hin cc x l v tr li kt qu cho client Cng ngh: CGI, ASP, PHP, JSP,
Cn thc hin quy trnh thit k theo chu k pht trin h thng thng tin. S dng nhng cng c trin khai thng dng
Xc nh vn , c hi v mc tiu
Vn : Tng li nhun C hi: dng mt trang web, mt din n, mt sn giao dch, mt ca hng o, Mc tiu: nhm tng lng khch hng, tng cht lng phc v khch hng, vi hy vng tip th hiu qu v kinh t
Xc nh cc yu cu thng tin
Nu lp trang web th cc yu cu c th l: Gii thiu cng ty, cc u mi lin h, cch tip xc Hin th cc loi sn phm ca cng ty Hin th chi tit sn phm Cho php khch hng c kin v sn phm v phc v ca cng ty
Thit k h thng mi
Cc biu mu vo-ra trn mn hnh Phng thc x l qua c s d liu Xy dng s thc th quan h v thit k c s d liu M t cc bng, trng v cch thc kim tra tnh ng dn ca d liu
Kim nh h thng
ng dng web i hi phi kim nh c pha client v pha server. Kim nh d liu nhp Loi b nhng lin kt khng xc nh
Ci t v nh gi h thng
Bn giao ng dng web cho cng ty trn c s : Cng ty c th t m nhn vic qun tr trang web Cng ty t cp nht trang web, x l nhng yu cu khch hng Theo di lu lng truy cp trang web
Web Server
Vi cc h iu hnh Win2K web server l phn mm IIS (Internet Information Service) c ci bn trong (nu thiu, c th ci thm bng Add/Remove Software) Mc nh, IIS qun l vng a cng C:\Inetpub\wwwroot\
Vn chuyn
Xem sn phm
Thc hin
Np gi hng
n hng
Tnh tin
Bin nhn
Ph vn chuyn
Thanh ton
Cc hp phng trnh by hot ng ca khch hng; Cc hp ba chiu trnh by cc quy trnh kinh doanh khng do khch hng thc hin
Tip th
Mc ch l nhm n nhng ngi mua tim nng v thu ht h vo site TMT. S dng internet tip th n khch hng theo nhiu cch khc nhau: qung co, email,hi ch,... Thnh lp cng ng (user group), din n, chat, thm d,... nhm to mi trng thu ht ngi xem tr li TMT tp trung tip th nhng khch hng tm thy website
Thm website
Ngay sau khi mt c nhn vo website, mt site kinh doanh s c ti xung. u tin l bc lm quen to kinh nghim thng mi in t cho khch hng. Ngay lc c th bt u theo di v to profile cho khch hng ny. Da vo thng tin c th nhm n cc mt hng m khch hng ny quan tm nhiu nht. y l bc bt u ca TMT
Xem sn phm
Ngi xem bt u duyt nhng mt hng trn website Cc mt hng c b tr theo cc gian hng, chng loi a dng, d tm kim Khi mt khch hng tim nng thc hin iu ny, khch hng c th b thu ht vo cc mt hng ang by bn, s khuyn mi, cc mt hng lin quan hay nng cp.
Np gi hng
Ngi mua t hng vo gi mua sm ca mnh. Gi mua sm ch n gin l mt danh sch cc mt hng m ngi mua chn, s lng, gi c,thuc tnh(mu sc, kch c,...) v bt k thng tin khc lin quan n n t hng tim nng. Cc gi mua sm thng cung cp cc ty chn dn sch gi, xa cc mt hng,v cp nht s lng.
Tnh ph vn chuyn
Ph vn chuyn c th n gin nh l vic tnh ph ton b hay phc tp nh l vic tnh ph cho mi mt hng muav tng quan vi on ng m hng phi c vn chuyn n C th kh khn hn khi x l vic t hng quc t. Khi c th lin kt vi mt nh vn chuyn(provider), theo di hng ha trong qu trnh vn chuyn.
X l n t hng
Nu khng t ng x l th tn dng, th u tin phi x l giao dch ti chnh Cc quy tc kinh doanh chun iu khin bc ny nh th vic t hng c thc hin qua in thoi hay qua th C th cung cp ty chn cho khch hng bit v tnh trng t hng C th cung cp tnh trng hng tn kho, tnh trng cung cp mt hng.
Vn chuyn hng
Bc cui cng trong quy trnh thng mi in t l vn chuyn hng cho khch hng C th cung cp tnh trng t hng cho khch hng. Trong trng hp ny, n c th bao gm s vn chuyn UPS hay FedEx khch hng theo di s vn chuyn hng ca h
Chc nng i vi nhn vin bn hng Chc nng ng nhp h thng Chc nng thot khi h thng Chc nng cp nht loi hng Chc nng cp nht hng Chc nng x l n hng
Thit k C s d liu
Ni dung Khi nim chung M hnh thc th - quan h S thc th quan h
S thc th - quan h
Bng sn phm
M sn phm Tn sn phm M t Gi nh M loi Ghi ch Ni bt
Bng n hng
M n hng M khch hng Ngy H / Tn a ch 1/a ch 2 Thnh ph / M vng Tnh / Quc gia Kiu th S th Ngy ht hn th
Cng c TMT
Ni dung Khi nim chung Gi khuyn mi S thc th quan h
Gi khuyn mi
C s d liu l tp hp nhng d liu c lin quan vi nhau, cng phc v cc nhu cu ca nhiu ngi s dng. C s d liu l tp hp ca nhiu loi bng khc nhau v c lin quan vi nhau H qun tr CSDL (DBMS) l mt h thng phn mm phc v thao tc CSDL. H CSDL quan h l mt loi h CSDL vi nhng cu trc u vit cho php mc c lp d liu cao hn cc h qun tr CSDL phn cp v mng
Cng c TMT
Ni dung Khi nim chung Gi khuyn mi S thc th quan h
Ci t webserver
Vi cc h iu hnh Win2K web server l phn mm IIS (Internet Information Service) c ci bn trong (nu thiu, c th ci thm bng Add/Remove Software) Mc nh, IIS qun l vng a cng C:\Inetpub\wwwroot\
Xut bn website
Xut bn website l thao tc chuyn tt c cc tp tin t local site ln remote site (upload). Thao tc ngc li chuyn tp tin t remote site xung local site gi l download
Khi to gi hng
If IsArray(Session("cart")) = false Then Dim acart(19,1) acart(1,0)=productid acart(1,1)=qty Session("cart") = acart end if
S dng gi hng
If IsArray(Session("cart")) = true Then acart=session("cart") productid=acart(i,0) qty=acart(i,1) end if
Thm vo gi hng
Bin logic incart dng kim tra xem gi hng y hay cha. -Ban u trng thi cha thm phn t no vo gi hng: incart=false -Mi khi thm mt phn t, trng thi thay i incart=true -Nu duyt ht c bng m khng th thm c phn t mi th c ngha gi y. Khi bin incart vn nguyn gi tr false
S dng gi hng
If IsArray(Session("cart")) = true Then acart=session("cart") incart=false for i=lbound(acart) to ubound(acart) if acart(i,0)="" and acart(i,1)="" and not(incart) then acart(i,0)=productid acart(i,1)=request.form("qty") incart=true end if next session("cart")=acart end if
S dng gi hng
<% if incart then %> <%= request.form("qty") %> chic c thm vo gi hng ca bn. ... <% else %> <b>Sn phm ny KHNG c thm vo gi ca bn.</b> Gi hng ca bn y
Bi tp Thc hnh Thng mi in t Bi tp thc hnh s 3 + Tng s bui thc hnh l 1 bui, mi bui 2 tit + Hnh thc bo co sau cc bui thc hnh: Sinh vin lm bi trn my v np cho gio vin hng dn bui th 2, trong th mc mang tn sinh vin + Nghim cm mi sao chp bi lm ca nhau, nu b pht hin s c KHNG c thi Bi s 1. n tp: - Ci t webserver v kim tra IIS. - Truyn d liu t form - Truyn d liu t CSDL - To tp tin danh mc sn phm To CSDL c tn db.mdb vi bng Categories v cc trng nh sau: catcode Catdes catname catimage 1 2 3 Nokia Mobile Samsung Mobile Motorola Mobile Nokia Samsung Motorola <img src="anh/nokia.gif"> <img src="anh/samsung.gif"> <img src="anh/motorola.gif">
4 Sony Mobile Sony <img src="anh/sony.gif"> To lin kt vi CSDL nh sau: To tp tin "db.inc" nh sau <% dim db dim strConn strConn="Driver={Microsoft Access Driver (*.mdb)}; DBQ="&Server.MapPath("db.mdb") Set db = Server.CreateObject("ADODB.Connection") db.open strConn %> Hin th CSDL trn trang web: <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <% dim rs set rs=db.execute("select * from categories") %> <table border="1" width="100%"> <tr> <%for each x in rs.Fields%> <th><%Response.Write(x.name)%></th> <%next%> </tr> <%do until rs.EOF%> <tr> <%for each x in rs.Fields%> <td><%Response.Write(x.value)%></td> <%next rs.MoveNext%> </tr> <%loop rs.close db.close
Bi tp Thc hnh Thng mi in t %> </table> Bi s 2. Hin th Danh mc trn trang web vi dng nh: <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <% dim rs set rs=db.execute("select * from categories") %> <table width="15%"> <tr> <th>PRODUCT CATEGORY</th> </tr> <%do until rs.EOF%> <tr> <td><%Response.Write(rs("catimage"))%></td> <% rs.MoveNext%> </tr> <%loop rs.close db.close %> </table> Bi s 3 Trong CSDL db.mdb to bng Products v cc trng nh sau: Productid name description price image catcode notes featured
1 2 3 4 5 Nokia 7250i Nokia 6820 Samsung X600 Motorola V690 SonyEricson P800 <img src="anh/n7250i.jpg"> 1 <img src="anh/n6820.jpg"> 1 <img src="anh/ssx600.gif"> 2 <img src="anh/v690.gif"> <img src="anh/p800.gif"> 3 4 yes no no yes yes
To lin kt vi CSDL Hin th bng Products trn trang web (t lm) Bi s 4 M rng bi s 2: vi mi danh mc, to mt lin kt n danh sch sn phm thuc danh mc . Mi sn phm lin kt n trang product.asp Tp tin c tn l category.asp <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <% dim catcode catcode=request.querystring("catcode") %> <html> <body> <% if len(catcode)=0 then
Bi tp Thc hnh Thng mi in t dim rs set rs=db.execute("select * from categories") %> <table width="15%"> <tr> <th>PRODUCT CATEGORY</th> </tr> <%do until rs.EOF%> <tr> <td> <a href='category.asp?catcode=<%= rs("catcode") %>' style="textdecoration:none;"><%=rs("catimage") %> </td> <% rs.MoveNext%> </tr> <%loop rs.close db.close %> </table> <%else set rscat=db.execute("select * from categories where catcode=" & catcode) set rscatlist=db.execute("select name,productid from products where catcode=" & catcode & " order by name") %> <font face="helvetica" size="3" ><B><%= rscat("catname") %></B></font><br> <% if not rscatlist.eof then rscatlist.movefirst while not rscatlist.eof %> <font size="1" face="helvetica" > <a href='product.asp?productid=<%= rscatlist("productid")%>'><%=rscatlist("name")%></a> <br> <% rscatlist.movenext wend end if end if %> </body> </html>
Bi tp Thc hnh Thng mi in t Bi tp thc hnh s 4 + Tng s bui thc hnh l 1 bui, mi bui 2 tit + Hnh thc bo co sau cc bui thc hnh: Sinh vin lm bi trn my v np cho gio vin hng dn bui th 2, trong th mc mang tn sinh vin + Nghim cm mi sao chp bi lm ca nhau, nu b pht hin s c KHNG c thi Bi s 1. n tp: - Ci t webserver v kim tra IIS. - Truyn d liu t form - Truyn d liu t CSDL - To tp tin danh mc sn phm - To tp tin sn phm Bi s 2. To tp tin cu hnh config.inc a ra cc bin thit lp trang web,c dng nh sau: <% cursymbol="$" storename="EShop" fontface="arial" bgcolor="#FFFFFF" text="#000000" vlink="#999999" %> Vi mi sn phm, to mt lin kt n trang chi tit sn phm product.asp. Mi khi ngi mua mun a sn phm vo gi hng (add item to Cart) h s chuyn n addprod.asp Tp tin c tn l product.asp Hin th sn phm trn trang web vi cc chi tit: <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <% dim productid productid=request.querystring("productid") %> <html> <body> <% set rsprod=db.execute("SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE productid = " & productid) 'get names and codes of all products in that category set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name") %> <table> <td valign=top align=right> <font face="helvetica" size="3" ><B><%= rsprod("catname") %></B></font><br> <% if not rscatlist.eof then rscatlist.movefirst while not rscatlist.eof %>
Bi tp Thc hnh Thng mi in t <font size="1" face="helvetica" > <a href='product.asp?productid=<%= rscatlist("productid")%>'> <%=rscatlist("name")%></a><br> <% rscatlist.movenext wend end if %> </td> <td> <% = rsprod("image") %> </td> <td width=180 align="left"> <font size="3" face="helvetica" > <b><%= rsprod("name") %></b> <br> <table width=180 border=0> <td align="left"> <font size="2" face="helvetica" > <b>Price:</b> </td> <td align="right"> <font size="2" face="helvetica" > <%= cursymbol & formatnumber(rsprod("price")) %> </td> </table> <br> <font size="1"> <%= rsprod("description") %> <br><br> <center> <a href="addprod.asp?productid=<%= rsprod("productid")%>"><img src="anh/purchase.gif" border=0></a> </td> </table> </body> </html> Bi s 3 To phn header v footer cho trang web Quay tr li bi 1, to trang functions.inc m t cc chc nng c bn ca trang web. To cc subroutine (chng trnh con) thc hin chc nng header (tiu trang) v footer (chn trang) Trang c tn functions.inc c dng sau: <% sub header %> <table width="100%" cellpadding="2" cellspacing="0" border="0" bgcolor="<%= bgcolor %>"> <tr> <td valign="middle" align="left"><a href="index.asp"><img src="anh/logo.gif" alt="<%= storename %> Home" border="0" vspace=5 hspace=5></a> </td> </tr> </table>
Bi tp Thc hnh Thng mi in t <% end sub sub footer %> <table border="0" cellpadding="0" cellspacing="6" width="100%"> <tr> <td colspan="2" align="right" valign="TOP"><a href="http://www.eshop.net/"><img src="anh/powered.gif" alt="Powered by A-CART" border=0></a> </tr> </table> <% end sub %> Chn cc cu lnh gi header v footer vo cc trang web vit. V d: To trang Category.asp mi vi cc dng nh sau <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% dim catcode catcode=request.querystring("catcode") %> <html> <head> <title> <%= storename %> </title> </head> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>"> <% header if len(catcode)=0 then dim rs set rs=db.execute("select * from categories") %> <table width="15%"> <tr> <th>PRODUCT CATEGORY</th> </tr> <%do until rs.EOF%> <tr> <td> <a href='category.asp?catcode=<%= rs("catcode") %>' style="textdecoration:none;"><%=rs("catimage") %> </td> <% rs.MoveNext%> </tr> <%loop rs.close db.close
Bi tp Thc hnh Thng mi in t %> </table> <%else set rscat=db.execute("select * from categories where catcode=" & catcode) set rscatlist=db.execute("select name,productid from products where catcode=" & catcode & " order by name") %> <font face="helvetica" size="3" ><B><%= rscat("catname") %></B></font><br> <% if not rscatlist.eof then rscatlist.movefirst while not rscatlist.eof %> <font size="1" face="helvetica" > <a href='product.asp?productid=<%= rscatlist("productid")%>'><%=rscatlist("name")%></a> <br> <% rscatlist.movenext wend end if end if footer %> </body> </html> Bi s 4 T to phn header v footer cho trang web ca bn
Bi tp Thc hnh Thng mi in t Bi tp thc hnh s 5 + Tng s bui thc hnh l 1 bui, mi bui 2 tit + Hnh thc bo co sau cc bui thc hnh: Sinh vin lm bi trn my v np cho gio vin hng dn bui th 2, trong th mc mang tn sinh vin + Nghim cm mi sao chp bi lm ca nhau, nu b pht hin s c KHNG c thi Bi s 1. n tp: - Ci t webserver v kim tra IIS. - Truyn d liu t form - Truyn d liu t CSDL - To tp tin danh mc sn phm - To tp tin sn phm Bi s 2. Mi khi ngi mua mun a sn phm vo gi hng (add item to Cart) h s chuyn n addprod.asp Tp tin addprod.asp Thm sn phm vo gi hng: <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% productid=request.querystring("productid") stage=request.form("stage") if stage="" or stage=null then else 'thm vo gi hng 'khi to gi hng If IsArray(Session("cart")) = false Then Dim acart(19,1) acart(1,0)=productid acart(1,1)=request.form("qty") Session("cart") = acart else acart=session("cart") incart=false for i=lbound(acart) to ubound(acart) if acart(i,0)="" and acart(i,1)="" and not(incart) then acart(i,0)=productid acart(i,1)=request.form("qty") incart=true end if next session("cart")=acart end if end if 'ly chi tit sn phm set rsprod=db.execute("SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE productid = " & productid)
'ly tn v m ca tt c sn phm trong loi catcode set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name") %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> <%= storename %> </title> </head> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>" > <font face="arial"> <% header %> <table> <td valign=top align=right> <font face="helvetica" size="3" ><B><%= rsprod("catname") %></B></font> <br> <% 'Hin th danh sch cc sn phm trong loi if not rscatlist.eof then rscatlist.movefirst while not rscatlist.eof %> <font size="1" face="helvetica" > <a href="product.asp?productid=<%= rscatlist("productid")%>"><%=rscatlist("name")%></a> <br> <% rscatlist.movenext wend end if %> </td> <td> <% = rsprod("image") %> </td> <% if stage="" or stage=null then %> <td width=180 align="left"> <font size="3" face="helvetica" color="<%= text %>"> <b><%= rsprod("name") %></b> <br> <table width=180 border=0> <td align="left"> <font size="2" face="helvetica" > <b>Price:</b> </td> <td align="right"> <font size="2" face="helvetica" color="<%= text %>">
Bi tp Thc hnh Thng mi in t <%= cursymbol & formatnumber(rsprod("price")) %> </td> </table> <br> <font size="1"> Bn mun mua bao nhiu chic ? <form action="addprod.asp?productid=<%= productid %>" method="post"> S lng: <SELECT NAME="qty"> <OPTION SELECTED VALUE="1">1 <OPTION VALUE="2">2 <OPTION VALUE="3">3 <OPTION VALUE="4">4 <OPTION VALUE="5">5 <OPTION VALUE="6">6 <OPTION VALUE="7">7 <OPTION VALUE="8">8 </SELECT> <input type="hidden" name="stage" value="2"> <br><br> <input type=image src="anh/purchase.gif" border=0 alt="Purchase"> </form> </td> <% else %> <td width=180 align="left"> <font size="3" face="helvetica" color="<%= text %>"> <b><%= rsprod("name") %></b> <br> <table width=180 border=0> <td align="left"> <font size="2" face="helvetica" > <b>Price:</b> </td> <td align="right"> <font size="2" face="helvetica" color="<%= text %>"> <%= cursymbol & formatnumber(rsprod("price")) %> </td> </table> <br> <% if incart then %> <font size="1"> <%= request.form("qty") %> chic c thm vo gi hng ca bn. Nu mun mua thm sn phm ny <a href="addprod.asp?productid=<%=productid%>">hy bm vo y</a>. <br><br> tip tc mua sm, hy chn danh mc pha tri hoc pha trn. <br><br> t hng <a href="deliver.asp">hy bm vo y</a>. <% else %> <font size="1" > <b>Sn phm ny KHNG c thm vo gi ca bn.</b> Gi hng ca bn y
Bi tp Thc hnh Thng mi in t <font size="1" color="<%= text%>"> <br><br> xem hng ha trong gi hng ca bn <a href="review.asp">hy bm vo y</a>.<br><br> t hng <a href="deliver.asp">hy bm vo y</a>. <% end if %> </td> <% end if %> </table> <% footer %> </body> </html> <% db.close set db=nothing %> Bi s 3 Hy to thm cho gi hng c tng tin (tng tin = gi x s lng). Bi s 4 Hy to thm phm bm xa gi hng cho gi hng. Nu bm phm xa gi hng th gi hng s tr thnh rng Hy to thm phm bm cp nht gi hng cho trng hp khch hng thay i s lng hng.
Bi tp Thc hnh Thng mi in t Bi tp thc hnh s 6 + Tng s bui thc hnh l 1 bui, mi bui 2 tit + Hnh thc bo co sau cc bui thc hnh: Sinh vin lm bi trn my v np cho gio vin hng dn bui th 2, trong th mc mang tn sinh vin + Nghim cm mi sao chp bi lm ca nhau, nu b pht hin s c KHNG c thi Bi s 1. n tp: - Ci t webserver v kim tra IIS. - Truyn d liu t form - Truyn d liu t CSDL - To tp tin danh mc sn phm category.asp - To tp tin sn phm product.asp - Thm gi hng addprod.asp Bi s 2. M rng tiu trang bng cch thm menu thanh ngang nh sau:
Trong trng hp gi hng khng rng, trn thanh menu s xut hin thng bo s lng sn phm ...items in shopping cart v lin kt My Cart xem ni dung gi hng:
Khi bm phm My Cart lin kt s c chuyn n trang review.asp hin th ni dung gi hng. Cp nht tp tin functions.inc : <% sub categorymenu showcart=false 'ly ni dung gi hng nu c numitems=0 If IsArray(Session("cart")) = false Then Dim acart(19,1) Session("cart") = acart showcart=false else acart=Session("cart") for i=lbound(acart) to ubound(acart) if acart(i,0)<>"" and acart(i,1)<>"" then numitems=numitems+acart(i,1) showcart=true end if next end if %> <table width="100%" cellpadding="5" cellspacing="0" border="0" bgcolor="<%= bgcolor %>">
Bi tp Thc hnh Thng mi in t <tr> <% if showcart then %> <td bgcolor="<%= COLlight %>" align="center" valign="MIDDLE" nowrap> <font color="<%= textlight %>" face="Verdana, Arial" size="1"><b> <%= numitems %> sn phm trong gi hng </td> <% end if %> <td bgcolor="<%= COLlight %>" align="right" valign="MIDDLE" nowrap height="20"> <font color="<%= textlight %>" face="Verdana, Arial" size="1"><b> <a href="index.asp" style="color:<%= textlight %>;textdecoration:none;">Home</a> | <a href="mailto:support@eshop.com" style="color:<%= textlight %>;textdecoration:none;">Support</a> <% if showcart then %> | <a href="review.asp" style="color:<%= textlight %>;textdecoration:none;">My Cart</a> <% end if 'Kim tra xem khch hng ng nhp cha if session("custid")<>"" then %> | <a href="signout.asp" style="color:<%= textlight %>;textdecoration:none;">Sign Out</a> <% else %> | <a href="signin.asp" style="color:<%= textlight %>;textdecoration:none;">Sign In</a> <% end if %> </td> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="<%= bgcolor %>"> <tr> <td bgcolor="<%= COLdark %>" height="20" align="center" valign="MIDDLE" nowrap colspan="4"> <font color="<%= textdark %>" face="Verdana, Arial" size="1"><b> <% 'Hin th danh sch th loi dim rscat set rscat=db.execute("select * from categories") if not rscat.eof then while not rscat.eof %> <a href="category.asp?catcode=<%= rscat("catcode") %>" style="color:<%= textdark %>;text-decoration:none;"> <%= rscat("catname") %></a> <% rscat.movenext if not rscat.eof then %> | <% end if wend end if
Bi tp Thc hnh Thng mi in t %> </tr> </table> <% end sub%> Cp nht tp tin category.asp : <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% dim catcode catcode=request.querystring("catcode") %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> <%= storename %> </title> </head> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>"> <% header categorymenu if len(catcode)=0 then dim rs set rs=db.execute("select * from categories") %> <table width="15%"> <tr> <th>PRODUCT CATEGORY</th> </tr> <%do until rs.EOF%> <tr> <td> <a href='category.asp?catcode=<%= rs("catcode") %>' style="textdecoration:none;"><%=rs("catimage") %> </td> <% rs.MoveNext%> </tr> <%loop rs.close db.close %> </table> <%else set rscat=db.execute("select * from categories where catcode=" & catcode) set rscatlist=db.execute("select name,productid from products where catcode=" & catcode & " order by name") %> <font face="helvetica" size="3" ><B><%= rscat("catname") %></B></font><br> <% if not rscatlist.eof then
Bi tp Thc hnh Thng mi in t rscatlist.movefirst while not rscatlist.eof %> <font size="1" face="helvetica" > <a href='product.asp?productid=<%= rscatlist("productid")%>'><%=rscatlist("name")%></a> <br> <% rscatlist.movenext wend end if end if footer %> </body> </html> Bi s 3 Tng t nh trn cp nht tp tin product.asp nh sau: <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% dim productid productid=request.querystring("productid") %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> <%= storename %> </title> </head> <body> <% header categorymenu set rsprod=db.execute("SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE productid = " & productid) 'get names and codes of all products in that category set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name") %> <table> <td valign=top align=right> <font face="helvetica" size="3" ><B><%= rsprod("catname") %></B></font><br> <% if not rscatlist.eof then rscatlist.movefirst while not rscatlist.eof %> <font size="1" face="helvetica" >
Bi tp Thc hnh Thng mi in t <a href='product.asp?productid=<%= rscatlist("productid")%>'><%=rscatlist("name")%></a><br> <% rscatlist.movenext wend end if %> </td> <td> <% = rsprod("image") %> </td> <td width=180 align="left"> <font size="3" face="helvetica" > <b><%= rsprod("name") %></b> <br> <table width=180 border=0> <td align="left"> <font size="2" face="helvetica" > <b>Price:</b> </td> <td align="right"> <font size="2" face="helvetica" > <%= cursymbol & formatnumber(rsprod("price")) %> </td> </table> <br> <font size="1"> <%= rsprod("description") %> <br><br> <center> <a href="addprod.asp?productid=<%= rsprod("productid")%>"><img src="anh/purchase.gif" border=0></a> </td> </table> <%footer%> </body> </html> Bi s 4 Tng t nh trn cp nht tp tin addprod.asp nh sau: <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% productid=request.querystring("productid") stage=request.form("stage") if stage="" or stage=null then else 'thm vo gi hng 'khi to gi hng If IsArray(Session("cart")) = false Then Dim acart(19,1) acart(1,0)=productid
Bi tp Thc hnh Thng mi in t acart(1,1)=request.form("qty") Session("cart") = acart else acart=session("cart") incart=false for i=lbound(acart) to ubound(acart) if acart(i,0)="" and acart(i,1)="" and not(incart) then acart(i,0)=productid acart(i,1)=request.form("qty") incart=true end if next session("cart")=acart end if end if 'ly chi tit sn phm set rsprod=db.execute("SELECT * FROM products INNER JOIN categories ON products.catcode = categories.catcode WHERE productid = " & productid) 'ly tn v m ca tt c sn phm trong loi catcode set rscatlist=db.execute("select name,productid from products where catcode=" & rsprod("catcode") & " order by name") %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> <%= storename %> </title> </head> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>" > <font face="arial"> <% header categorymenu %> <table> <td valign=top align=right> <font face="helvetica" size="3" ><B><%= rsprod("catname") %></B></font> <br> <% 'Hin th danh sch cc sn phm trong loi if not rscatlist.eof then rscatlist.movefirst while not rscatlist.eof %> <font size="1" face="helvetica" > <a href="product.asp?productid=<%= rscatlist("productid")%>"><%=rscatlist("name")%></a> <br> <% rscatlist.movenext wend end if %>
Bi tp Thc hnh Thng mi in t </td> <td> <% = rsprod("image") %> </td> <% if stage="" or stage=null then %> <td width=180 align="left"> <font size="3" face="helvetica" color="<%= text %>"> <b><%= rsprod("name") %></b> <br> <table width=180 border=0> <td align="left"> <font size="2" face="helvetica" > <b>Price:</b> </td> <td align="right"> <font size="2" face="helvetica" color="<%= text %>"> <%= cursymbol & formatnumber(rsprod("price")) %> </td> </table> <br> <font size="1"> Bn mun mua bao nhiu chic ? <form action="addprod.asp?productid=<%= productid %>" method="post"> S lng: <SELECT NAME="qty"> <OPTION SELECTED VALUE="1">1 <OPTION VALUE="2">2 <OPTION VALUE="3">3 <OPTION VALUE="4">4 <OPTION VALUE="5">5 <OPTION VALUE="6">6 <OPTION VALUE="7">7 <OPTION VALUE="8">8 </SELECT> <input type="hidden" name="stage" value="2"> <br><br> <input type=image src="anh/purchase.gif" border=0 alt="Purchase"> </form> </td> <% else %> <td width=180 align="left"> <font size="3" face="helvetica" color="<%= text %>"> <b><%= rsprod("name") %></b> <br> <table width=180 border=0> <td align="left"> <font size="2" face="helvetica" > <b>Price:</b> </td> <td align="right">
Bi tp Thc hnh Thng mi in t <font size="2" face="helvetica" color="<%= text %>"> <%= cursymbol & formatnumber(rsprod("price")) %> </td> </table> <br> <% if incart then %> <font size="1"> <%= request.form("qty") %> chic c thm vo gi hng ca bn. Nu mun mua thm sn phm ny <a href="addprod.asp?productid=<%=productid%>">hy bm vo y</a>. <br><br> tip tc mua sm, hy chn danh mc pha tri hoc pha trn. <br><br> t hng <a href="deliver.asp">hy bm vo y</a>. <% else %> <font size="1" > <b>Sn phm ny KHNG c thm vo gi ca bn.</b> Gi hng ca bn y <font size="1" color="<%= text%>"> <br><br> xem hng ha trong gi hng ca bn <a href="review.asp">hy bm vo y</a>.<br><br> t hng <a href="deliver.asp">hy bm vo y</a>. <% end if %> </td> <% end if %> </table> <% footer %> </body> </html> <% db.close set db=nothing %> Bi s 5 To tp tin review.asp xem ni dung gi hng nh sau: <%@ LANGUAGE = "VBScript" %> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% 'Kim tra gi hng rng ? If IsArray(Session("cart")) = false Then Dim acart(19,1) Session("cart") = acart else acart=session("cart") end if cempty=true for i=lbound(acart) to ubound(acart) if acart(i,0)<>"" and acart(i,1)<>"" then cempty=false end if
Bi tp Thc hnh Thng mi in t next %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> <%= storename %> </title> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>" > <font face="arial"> <% header categorymenu %> <center> <table> <td valign=top align=right> <font face="helvetica" size="3" > <br> <% 'Thm vo gi hng 'To gi hng If cempty Then %> <font face="helvetica" size="6" > <p align="left"> empty cart <br><br> <font face="helvetica" size="4" color="<%= text %>"> · <b>Ch ! gi hng ca bn rng!</b><p><p><p> <br> <% else %> <font face="helvetica" size="6" > <p align="left"> Gi hng ca bn <br> <font face="helvetica" size="2" color="<%= text %>"> · <b>Xem mt hng</b> bng cch bm vo tn mt hng pha di.<br> · <b>Xa mt hng</b> bng cch bm vo phm "delete item" pha tri.<br> · <b>Tip tc mua hng</b> bng cch chn gian hng pha trn. <br> <table cellspacing=5 width=500> <tr> <td align="center"><font face=helvetica size=2><b>Xa </b></td> <td align="left"><font face=helvetica size=2><b>Mt hng </b></td> <td align="center"><font face=helvetica size=2><b>S lng </b></td> <td align="right"><font face=helvetica size=2><b>n gi </b></td> <td align="right"><font face=helvetica size=2><b>Gi thnh </b></td> </tr> <% 'Hin th ni dung gi hng acart=session("cart")
Bi tp Thc hnh Thng mi in t subtotal=0 for i=lbound(acart) to ubound(acart) if acart(i,0)<>"" and acart(i,1)<>"" then set rscart=db.execute("select name,productid,price from products where productid=" & acart(i,0)) %> <tr> <td align="center"><a href="alter.asp?item=<%=i %>&action=delete"><img src="anh/delete.gif" border=0></a></td> <td align="left"><font face=helvetica size=2> <a href="product.asp?productid=<%=rscart("productid") %>"><%= rscart("name") %></a><br> </td> <td align="center"><font face=helvetica size=2><%= acart(i,1) %></td> <td align="right"><font face=helvetica size=2><%= cursymbol & formatnumber(rscart("price"))%></td> <td align="right"><font face=helvetica size=2><%= cursymbol & formatnumber(rscart("price") * acart(i,1)) %></td> </tr> <% subtotal=subtotal+(rscart("price") * acart(i,1)) end if next %> <tr> <td colspan=5><hr></td> </tr> <tr> <td colspan=3></td> <td colspan=2 align=right valign="top"> <font face=helvetica size=2><b>Tng cng: </b><%= cursymbol & formatnumber(subtotal) %></td> </tr> </table> <p><center> <a href="alter.asp?action=clear"><img src="anh/empty.gif" border=0></a> <a href="signin.asp"><img src="anh/checkout.gif" border=0></a> <% end if %> </td> </table> <% footer %> </body> </html> <% db.close set db=nothing %>
Bi tp Thc hnh Thng mi in t Bi tp thc hnh s 7 + Tng s bui thc hnh l 1 bui, mi bui 2 tit + Hnh thc bo co sau cc bui thc hnh: Sinh vin lm bi trn my v np cho gio vin hng dn bui th 2, trong th mc mang tn sinh vin + Nghim cm mi sao chp bi lm ca nhau, nu b pht hin s c KHNG c thi Bi s 1. n tp: - Ci t webserver v kim tra IIS. - Truyn d liu t form - Truyn d liu t CSDL - To tp tin danh mc sn phm category.asp - To tp tin sn phm product.asp - Thm gi hng addprod.asp - Hin th gi hng review.asp Bi s 2. Xa ni dung gi hng v mt mt hng trong gi hng bng cch dng trang alter.asp C 3 trng hp s dng trang alter.asp, nh sau: Khi xem gi hng (trang review.asp; xem xong tr v review.asp), c th - Xa mt mt hng (v d mt hng 2) alter.asp?item=2&action=delete - Xa ht gi hng alter.asp?action=clear Khi tr tin (trang payment.asp; xem xong tr v payment.asp), c th - Xa mt mt hng (v d mt hng 2) alter.asp?item=2&action=delete&redir=payment Do trang alter.asp c ni dung nh sau: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% db.close set db=nothing if request.querystring("redir")="payment" then redir="payment.asp" else redir="review.asp" end if item=request.querystring("item") action=request.querystring("action") if item<0 or item>19 then response.redirect(redir) end if if action="delete" then If IsArray(Session("cart")) = false Then Dim acart(19,1) Session("cart") = acart else acart=session("cart") acart(item,0)="" acart(item,1)="" session("cart")=acart
Bi tp Thc hnh Thng mi in t end if end if if action="clear" then Session("cart")=null end if response.redirect(redir) %> Bi s 3 To tp tin signin.asp ng nhp mua hng nh sau: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% stage=request.querystring("stage") ' Kim tra xem khch hng ng nhp trc hay cha (dng bin session) ' nu c th b qua bc ng nhp if session("custid")<>"" then response.redirect("deliver.asp") end if %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> <%= storename %> </title> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>" alink="<%= COLlight %>" link="<%= COLlight %>" vlink="<%= vlink %>"> <font face="arial"> <% header categorymenu %> <center> <table> <td valign=top align=right> <font face="helvetica" size="6" color="<%= COLdark %>"> <br> <p align="left"> ng nhp mua hng <br><font face="helvetica, arial" size="2" color="<%= text %>"> · mua hng, bn phi ng nhp.<br> · Bn hy n mt trong cc ty chn sau.<br> <font face="helvetica" size="2" color="<%= COLerror %>"> <b><%= request.querystring("msg") %></b><br> <font face="helvetica" size="2" color="<%= text %>">
Bi tp Thc hnh Thng mi in t <form action="verify.asp" method="post"> <table width=500 border=0> <tr> <td align="left" colspan=2> <font face="helvetica" size="2" color="<%= text %>"> <input type="radio" value="signin" name="action" checked> <b>Bn ng k t trc.</b> <br>Nu bn ng k ti <%= storename %> t trc, bn hy vit email v mt khu ca mnh ng nhp mua hng. </tr> <tr> <td align="right"><font face="helvetica" size="2" color="<%= text %>"> <b>E-Mail:</b> </td> <td align="left"><font face="helvetica" size="2" color="<%= text %>"> <input type="text" name="email" value="" size="12"> </td> </tr> <tr> <td align="right"><font face="helvetica" size="2" color="<%= text %>"> <b>Mt khu:</b> </td> <td align="left"><font face="helvetica" size="2" color="<%= text %>"> <input type="password" name="pass" value="" size="12"> </td> <tr> <td align="left" colspan=2> <font face="helvetica" size="2" color="<%= text %>"> </tr> <tr> <td align="left" colspan=2> <font face="helvetica" size="2" color="<%= text %>"> <input type="radio" value="register" name="action"> <b>Bn l khch hng mi.</b> <br>Nu bn <b>cha tng</b> ng k trc y, bn hy vo y. </td> </tr> </table> <input type="image" src="anh/signin.gif"> </form> </td> </table> <br><br> <% footer %> </body> </html> <% db.close set db=nothing %>
Bi tp Thc hnh Thng mi in t Bi s 4 To tp tin verify.asp x l trang signing.asp nh sau: - Trng hp ng k: action=signing - Trng hp cha ng k: action=register <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% email=valid_sql(request.form("email")) pass=valid_sql(request.form("pass")) action=request.form("action") ' Kim tra xem khch hng ng nhp trc hay cha (dng bin session) ' nu c th b qua bc ng nhp if session("custid")<>"" and session("custid")<>null then response.redirect("deliver.asp") end if if action="signin" then set rsverify=db.execute("select * from customers where email='" & email & "'") if rsverify.eof then db.close set db=nothing response.redirect("signin.asp?msg=" & Server.URLEncode("Chng ti khng c email m bn nhp.<br>Xin bn xem li thng tin nhp khi bn ng k ln u.")) end if if lcase(trim(rsverify("pass")))<>lcase(trim(request.form("pass"))) then db.close set db=nothing response.redirect("signin.asp?msg=" & Server.URLEncode("Bn nhp sai mt khu.<br>Xin bn nhp li thm ln na, hoc ng k nh l khch hng mi.")) end if set rsdate=db.execute("update customers set lastvisit=#" & date() & " " & time() & "# where custid=" & rsverify("custid")) session("custid")=rsverify("custid") db.close set db=nothing response.redirect("deliver.asp") else response.redirect("register.asp") end if %> Bi s 5 To tp tin register.asp ng k khch hng mi nh sau: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <% stage=request.querystring("stage")
Bi tp Thc hnh Thng mi in t ' y l chi tit khch hng... cfname=request.form("cfname") clname=request.form("clname") caddress1=request.form("caddress1") caddress2=request.form("caddress2") ccity=request.form("ccity") cstate=request.form("cstate") czip=request.form("czip") ccountry=request.form("ccountry") cphone=request.form("cphone") cfax=request.form("cfax") cemail=request.form("cemail") cpass1=request.form("cpass1") cpass2=request.form("cpass2") ' Kim tra xem khch hng ng nhp trc hay cha (dng bin session) ' nu c th b qua bc ng nhp if session("custid")<>"" then response.redirect("deliver.asp") end if ' Kim tra gi hng if stage="register" then msg="" if trim(cfname)="" then msg=msg & "Bn phi nhp h v tn." end if if trim(clname)="" then msg=msg & "<br>Bn phi nhp h v tn." end if if trim(caddress1)="" then msg=msg & "<br>Bn phi nhp a ch." end if if trim(ccity)="" then msg=msg & "<br>Bn phi nhp thnh ph." end if if trim(cstate)="" then msg=msg & "<br>Bn phi nhp tnh/khu vc." end if 'if trim(czip)="" then ' msg=msg & "<br>Bn phi nhp m vng." 'end if if trim(ccountry)="" then msg=msg & "<br>Bn phi nhp tn nc." end if 'if trim(cphone)="" then ' msg=msg & "<br>Bn phi nhp s in thoi." 'end if if trim(cpass1)="" or trim(cpass2)="" then msg=msg & "<br>Bn phi nhp mt khu hai ln." elseif trim(lcase(cpass1))<>trim(lcase(cpass2)) then msg=msg & "<br>Hai mt khu phi trng nhau." end if
Bi tp Thc hnh Thng mi in t if trim(cemail)="" then msg=msg & "<br>Bn phi nhp a ch email." else 'Kim tra xem c trong CSDL khng set rsmail=db.execute("select * from customers where email='" & valid_sql(cemail) & "'") if not(rsmail.eof) then msg= msg & "<br>a ch email c ngi ng k" end if set rsmail=nothing end if if msg<>"" then response.redirect("register.asp?msg=" & Server.URLEncode(msg)) end if ' thm mi mt khch hng, thm record ri sau update Set rscust = Server.CreateObject("ADODB.RecordSet") ' M bng rscust.Open "customers", strConn, adOpenKeySet, adLockPessimistic, adCmdTable ' Thm record mi rscust.AddNew rscust("fname") = cfname rscust("lname") = clname rscust("address1") = caddress1 rscust("address2") = caddress2 rscust("city") = ccity rscust("state") = cstate rscust("zip") = czip rscust("country") = ccountry rscust("phone") = cphone if cfax<>"" then rscust("fax") = cfax end if rscust("email") = cemail rscust("pass") = cpass1 ' Cp nht record rscust.update ' Ghi nh ID khch hng Session("custid") = rscust("custid") ' ng RecordSet rscust.Close Set rscust = Nothing response.redirect("deliver.asp") end if %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Bi tp Thc hnh Thng mi in t <title> <%= storename %> </title> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>" alink="<%= COLlight %>" link="<%= COLlight %>" vlink="<%= vlink %>"> <font face="arial"> <% header categorymenu %> <center> <table border=0> <td valign=top> <font face="helvetica" size="6" color="<%= COLdark %>"> <p align="left"> ng k khch hng <br><font face="helvetica, arial" size="2"> · Xin bn nhp d liu vo biu mu sau:<br> <font face="helvetica" size="2" color="<%= COLerror %>"> <b><%= request.querystring("msg") %></b><br> <font face="helvetica" size="2" color="<%= text %>"> <form action="register.asp?stage=register" method=post> <table cellspacing=0 cellpadding="0" border="0"> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> H: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="cfname" value="" maxlength=40> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Tn: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="clname" value="" maxlength=40> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> email: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="cemail" value="" maxlength=40>
Bi tp Thc hnh Thng mi in t </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> a ch 1: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=40 name="caddress1" value="" maxlength=80> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> a ch 2: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=40 name="caddress2" value="" maxlength=80> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Thnh ph: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=28 name="ccity" value="" maxlength=28> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Tnh/khu vc: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=28 name="cstate" value="" maxlength=28> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> M vng: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="czip" value="" maxlength=20> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Quc gia: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="ccountry" value="" maxlength=20> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> in thoi: </font><BR></td> <td align=left valign="top">
Bi tp Thc hnh Thng mi in t <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="cphone" value="" maxlength=20> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> fax: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="cfax" value="" maxlength=20> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Mt khu: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input type="password" size=20 name="cpass1" value="" maxlength=20> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Nhp li mt khu: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input type="password" size=20 name="cpass2" value="" maxlength=20> </td> </tr> </table> <center> <p> <input type=image src="images/continue.gif" border=0 alt="Continue"> </form> </td> </table> <br><br> <% footer %> </body> </html> <% db.close set db=nothing %> Bi s 6 To tp tin deliver.asp to ni nhn hng nh sau: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!-- #include file="db.inc" --> <!-- #include file="config.inc" --> <!-- #include file="functions.inc" --> <%
Bi tp Thc hnh Thng mi in t 'Check if user is signed in if session("custid")="" or session("custid")=null then response.redirect("signin.asp") end if ' Kim tra gi hng If IsArray(Session("cart")) = false Then Dim acart(19,1) Session("cart") = acart response.redirect("error.asp?msg=" & Server.URLEncode("Gi hng ca bn rng.")) end if acart=Session("cart") ' Chi tit ni nhn c trc if not(session("fname")="" or session("lname")="" or session("address1")="" or session("address2")="" or session("city")="" or session("state")="" or session("zip")="" or session("country")="") then response.redirect("payment.asp") end if ' Chi tit ni nhn cha y if session("fname")<>"" or session("lname")<>"" or session("address1")<>"" or session("address2")<>"" or session("city")<>"" or session("state")<>"" or session("zip")<>"" or session("country")<>"" then delivertome="" delivertother="checked" else delivertome="checked" delivertother="" end if %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> <%= storename %> </title> <body bgcolor="<%= bgcolor %>" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="<%= text %>" alink="<%= COLlight %>" link="<%= COLlight %>" vlink="<%= vlink %>"> <font face="arial"> <% header categorymenu %> <center> <table border=0> <td valign=top> <font face="helvetica" size="6" color="<%= COLdark %>"> <p align="left"> Thng tin nhn hng
Bi tp Thc hnh Thng mi in t <br><font face="helvetica, arial" size="2"> · Xin cho bit n hng s chuyn n u.<br> <font face="helvetica" size="2" color="<%= COLerror %>"> <b><%= request.querystring("msg") %></b><br> <font face="helvetica" size="2" color="<%= text %>"> <form action="payment.asp" method=post> <input type="radio" value="me" name="deliverto" <%= delivertome %>> <b>Ti mun n hng ny chuyn n a ch ca ti.</b> <br><br> <input type="radio" value="other" name="deliverto" <% =delivertother %>> <b>Xin chuyn n hng ny n ngi c a ch di y.</b> <br><br> <table cellspacing=0 cellpadding="0" border="0"> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> H: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="fname" value="<% =session("fname") %>" maxlength=40> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Tn: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="lname" value="<% =session("lname") %>" maxlength=40> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> a ch 1: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=40 name="address1" value="<% =session("address1") %>" maxlength=80> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> a ch 2: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=40 name="address2" value="<% =session("address2") %>" maxlength=80> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Thnh ph: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=28 name="city" value="<% =session("city") %>" maxlength=28> </td> </tr>
Bi tp Thc hnh Thng mi in t <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Tnh/khu vc: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=28 name="state" value="<% =session("state") %>" maxlength=28> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> M vng: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="zip" value="<% =session("zip") %>" maxlength=20> </td> </tr> <tr> <td align=right valign="top"><font face="helvetica" size="1" color="<%= COLdark %>"> Quc gia: </font><BR></td> <td align=left valign="top"> <font face="helvetica" size="1" color="<%= text %>"> <input size=20 name="country" value="<% =session("country") %>" maxlength=20> </td> </tr> </table> <center> <p> <input type=image src="anh/continue.gif" border=0 alt="Continue"> </form> </td> </table> <br><br> <% footer %> </body> </html> <% db.close set db=nothing %>