Thiết kế chi tiết cho từng Modul

Một phần của tài liệu Xây dựng website du lịch Angkor (Trang 76)

b. Kết nối với CSDL

3.7.3Thiết kế chi tiết cho từng Modul

a). Thiết kế cho trang chủ (default.htm)

1) Nội dung

Trang này sẽ tự động chạy sau khi đợc tải về máy ngời sử dụng. Trang này giới thiệu toàn bộ chức năng chính của hệ thống, cho phép ngời dùng nhảy tới các trang khác nh trang Văn hoá, Lịch sử Angkor,...

Trang chủ đợc thể hiện nh hình sau:

2) Viết mã lệnh cho trang chủ

<HTML> <HEAD>

<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">

<TITLE> AngKor Tourism </TITLE> </HEAD>

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

<frameset rows="70,*" framespacing="0"> <frame marginwidth=0 name="Header"

src="htm/TopHome.htm"framespacing="0" frameborder="0" scrolling="no" target="contents">

<frameset cols="190,*">

<frame marginwidth=0 name="contents" src=Htm/LeftHome.htm frameborder="0" noresize target="main">

<frameset rows="56,*">

<frame marginwidth=0 name="search" src="htm/Search.htm" frameborder=No scrolling="no" noresize>

<frame marginwidth=0 name="Body" src="htm/Body.htm" target="main" frameborder=No> </frameset> <noframes> <BODY> </BODY> </noframes> </frameset> </frameset> </HTML>

Đồ án tốt nghiệp

1) Nội dung

Trang này sẽ giới thiệu về Angkor, nền văn hoá Angkor, lịch sử, quá trình xây dựng, diện tích,vị trí địa lý, địa hình và một số đền ở trong Angkor khác đặc biệt trình bày về điêu khắc của Angkor.

Trang Lịch Sử Angkor hiện nh hình sau:

2). Viết mă lệnh

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows- 1252">

<meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>Content of Angkor History</title>

<base target="_top">

<meta http-equiv="Page-Enter"

content="revealTrans(Duration=1.0,Transition=4)"> <META content="Microsoft FrontPage 4.0"

name=GENERATOR><STYLE> #slidemenubar {

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

BACKGROUND-COLOR: lightyellow; BORDER-BOTTOM: blue 1px solid; BORDER-LEFT: blue 1px solid; BORDER-RIGHT: blue 1px solid; BORDER-TOP: blue 1px solid; FONT: bold 11px/25px Verdana; LEFT: 155px; POSITION: absolute; TOP: 0px; WIDTH: 158px

}

#slidemenubar2 {

BACKGROUND-COLOR: lightGreen; BORDER-BOTTOM: blue 1px solid; BORDER-LEFT: blue 1px solid; BORDER-RIGHT: blue 1px solid; BORDER-TOP: blue 1px solid; FONT: bold 11px/25px Verdana; LEFT: 155px; POSITION: absolute; TOP: 0px; WIDTH: 158px

} </STYLE> </head> <body background="../images/lighttealbg.gif"> <SCRIPT language=JavaScript1.2> if (document.all)

document.write('<div id="slidemenubar2" style="left:-150" onMouseover="pull()" onMouseout="draw()">')

</SCRIPT>

<LAYER id=slidemenubar onmouseout=draw() onmouseover=pull()> <SCRIPT language=JavaScript1.2>

var sitems=new Array() var sitemlinks=new Array()

//extent or short the list sitems[1]="Ve trang chu" sitems[2]="Ve Campuchia" sitems[3]="Van Hoa Campichia" sitems[4]="Thu Tuc Visa"

sitems[5]="Dai su Quan Campuchia" sitems[6]="Thong Tin Du Lich"

Đồ án tốt nghiệp

//These are the links pertaining to the above text. sitemlinks[1]="../Default.htm" sitemlinks[2]="VeCampuchia.htm" sitemlinks[3]="VH.htm" sitemlinks[4]="ThuTucViSa.htm" sitemlinks[5]="CambodiaEmbass.htm" for(i=1;i<=sitems.length-1;i++) document.write('<a href='+sitemlinks[i]+'>'+sitems[i]+'</a><br>') </SCRIPT> </LAYER> <SCRIPT language=JavaScript1.2> function regenerate(){ window.location.reload() } function regenerate2(){ if (document.layers) setTimeout("window.onresize=regenerate" ,400) } window.onload=regenerate2 if (document.all){ document.write('</div>') themenu=document.all.slidemenubar2.style rightboundary=0 leftboundary=-150 } else{ themenu=document.layers.slidemenubar rightboundary=150 leftboundary=10 } function pull(){ if (window.drawit)

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

clearInterval(drawit) pullit=setInterval("pullengine()",50) } function draw(){ clearInterval(pullit) drawit=setInterval("drawengine()",50) } function pullengine(){ if (document.all&&themenu.pixelLeft<rightboundary) themenu.pixelLeft+=30 else if(document.layers&&themenu.left<rightboundary) themenu.left+=30 else if (window.pullit) clearInterval(pullit) } function drawengine(){ if (document.all&&themenu.pixelLeft>leftboundary) themenu.pixelLeft-=30 else if(document.layers&&themenu.left>leftboundary) themenu.left-=30 else if (window.drawit) clearInterval(drawit) } </SCRIPT> </head> <body background="../images/lighttealbg.gif">

<p><a target="TopMain" href="../Htm/TrangGTVH.htm"><font face=".VnClarendon" color="#660000" size="2"><i>Lời

giới thiệu</i></font></a></p>

<p><a target="TopMain" href="../Htm/AngkorThom.htm"><font face=".VnClarendon" color="#660000" size="2"><i>AngKor Thom</i></font></a></p>

Đồ án tốt nghiệp

<p><a target="TopMain" href="../Htm/AngkorWat.htm"><font face=".VnClarendon" color="#660000"

size="2"><i>AngkorWat</i></font></a></p>

<p><a target="TopMain" href="../Htm/BakSeiChamKrong.htm"><font face=".VnClarendon" color="#660000" size="2"><i>Baksei

Chamkrong</i></font></a></p>

<p><a target="TopMain" href="../Htm/BanTeaySrey.htm"><font face=".VnClarendon" color="#660000" size="2"><i>Banteay Srei</i></font></a></p>

<p><a target="TopMain" href="../Htm/Bayon.htm"><font face=".VnClarendon" color="#660000"

size="2"><i>Bayon</i></font></a></p>

<p><a target="TopMain" href="../Htm/SrashSrang.htm"><font face=".VnClarendon" color="#660000" size="2"><i>Srash Srang</i></font></a></p>

<p><a target="TopMain" href="../HTM/TaProm.htm"><font face=".VnClarendon" color="#660000" size="2"><i>Ta Prom</i></font></a></p>

</body> </html>

c). Thiết kế trang tìm kiếm (Search.asp) 1). Thiết kế

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

82

Ng ời tìm kiếm Trang Web

Du Lịch Angkor Thông tin tìm kiếm

Thông tin trả về

Việc trao đổi dữ liệu xảy ra thông qua trang search.asp đợc kết nối với Server. Nếu ngời ta cần tìm kiếm, trong hộp search sẽ gửi thông tin cần tìm kiếm tới Server và sau đó dữ liệu đợc lấy ra từ kho và gửi lên Web browser khách hàng. Bảng cơ sở dữ liệu sau đợc lu nhiều trờng để trả về những thông tin mà từ đó có thể liên kết tới các trang mà mình đã tìm.

2) Viết mã lệnh

<%@ Language=VBScript %> <html>

<head>

<META content="Microsoft FrontPage 4.0"

name=GENERATOR><STYLE> #slidemenubar {

Ng ời tìm kiếm Tìm kiếm

Thông tin tìm kiếm

Thông tin trả về Các Trang Web Liên kết tới trang Web Dữ liệu Thông tin trả về

Đồ án tốt nghiệp

BACKGROUND-COLOR: lightyellow; BORDER-BOTTOM: blue 1px solid; BORDER-LEFT: blue 1px solid; BORDER-RIGHT: blue 1px solid; BORDER-TOP: blue 1px solid; FONT: bold 11px/25px Verdana; LEFT: 155px; POSITION: absolute; TOP: 0px; WIDTH: 158px

}

#slidemenubar2 {

BACKGROUND-COLOR: lightGreen; BORDER-BOTTOM: blue 1px solid; BORDER-LEFT: blue 1px solid; BORDER-RIGHT: blue 1px solid; BORDER-TOP: blue 1px solid; FONT: bold 11px/25px Verdana; LEFT: 155px; POSITION: absolute; TOP: 0px; WIDTH: 158px

} </STYLE> </head> <body background="../images/lighttealbg.gif"> <SCRIPT language=JavaScript1.2> if (document.all)

document.write('<div id="slidemenubar2" style="left:-150" onMouseover="pull()" onMouseout="draw()">')

</SCRIPT>

<LAYER id=slidemenubar onmouseout=draw() onmouseover=pull()> <SCRIPT language=JavaScript1.2>

var sitems=new Array() var sitemlinks=new Array() //extent or short the list sitems[1]="Ve trang chu" sitems[2]="Ve Campuchia" sitems[3]="Van Hoa Campichia" sitems[4]="Lich su Angkor" sitems[5]="Thu Tuc Visa"

sitems[6]="Dai su Quan Campuchia"

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

//These are the links pertaining to the above text. sitemlinks[1]="../Default.htm" sitemlinks[2]="../htm/VeCampuchia.htm" sitemlinks[3]="../htm/VH.htm" sitemlinks[4]="../htm/LichSuAngkor.htm" sitemlinks[5]="../htm/ThuTucViSa.htm" sitemlinks[6]="../htm/CambodiaEmbass.htm" for(i=1;i<=sitems.length-1;i++) document.write('<a href='+sitemlinks[i]+'>'+sitems[i]+'</a><br>') </SCRIPT> </LAYER> <SCRIPT language=JavaScript1.2> function regenerate(){ window.location.reload() } function regenerate2(){ if (document.layers) setTimeout("window.onresize=regenerate" ,400) } window.onload=regenerate2 if (document.all){ document.write('</div>') themenu=document.all.slidemenubar2.style rightboundary=0 leftboundary=-150 } else{ themenu=document.layers.slidemenubar rightboundary=150 leftboundary=10 } function pull(){

Đồ án tốt nghiệp if (window.drawit) clearInterval(drawit) pullit=setInterval("pullengine()",50) } function draw(){ clearInterval(pullit) drawit=setInterval("drawengine()",50) } function pullengine(){ if (document.all&&themenu.pixelLeft<rightboundary) themenu.pixelLeft+=30 else if(document.layers&&themenu.left<rightboundary) themenu.left+=30 else if (window.pullit) clearInterval(pullit) } function drawengine(){ if (document.all&&themenu.pixelLeft>leftboundary) themenu.pixelLeft-=30 else if(document.layers&&themenu.left>leftboundary) themenu.left-=30 else if (window.drawit) clearInterval(drawit) } </SCRIPT>

<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </head>

<%

bien=Request.Form ("txtSearch")

set Conn=server.CreateObject ("ADODB.Connection") Conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\DataMain.mdb")

set Rs=server.CreateObject ("ADODB.Recordset")

Sql="SELECT*FROM Temple where name like '%" & bien & "%' "

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

rs.Open Sql,Conn

if (rs.BOF) and (rs.EOF) then

Response.Write "There no record!" else

rs.MoveFirst

%>

<%do until RS.EOF%> <tr>

<td><a href="<% =Rs("link")%>"><%=Rs("name")%> </a> </td> <td><%=Rs("Mota")%></td><BR><BR> </tr> <% RS.MoveNext loop End If RS.close Set RS = nothing %> </table> <%

set Conn=server.CreateObject ("ADODB.Connection")

Conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\DataMain.mdb")

set Rs=server.CreateObject ("ADODB.Recordset")

Sql="SELECT*FROM Vhoa where TenVH like '%" & bien & "%' "

rs.Open Sql,Conn

if (rs.BOF) and (rs.EOF) then

Đồ án tốt nghiệp

else

rs.MoveFirst

%> </tr>

<%do until RS.EOF%> <tr>

<td><a href="<% =Rs("link")%>"><%=Rs("TenVH")%> </a> </td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=Rs("Mota") %></td><BR><BR> </tr> <% RS.MoveNext loop End If RS.close Set RS = nothing %> </table> </body> </html>

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

Kết luận

Trong quá trình thực tập tốt nghiệp và làm đồ án, dới sự hớng dẫn của thầy giáo GS.TS. Nguyễn Thúc Hải cộng với sự cố gắng của bản thân mình, tôi đã thu đợc một số kết quả nh sau:

- Có đợc những kiến thức cơ bản về mạng máy tính, trong đó có những hiểu biết về mạng Internet và các dịch vụ thông tin trên Internet (Chơng I).

- Đặc biệt tìm hiểu sâu về dịch vụ thông tin diên rộng World Wide Web và các công nghệ cho nó. Đồng thời ngôn ngữ HTML là ngôn ngữ cơ sở để tạo trang Web, các công cụ tạo lập trang Web đợc nghiên cứu kỹ lỡng ( ChơngII ).

- Cuối cùng tôi đã có thể tự xây dựng đợc chơng trình thử nghiệm, qua đó minh hoạ đợc kết quả của đề tài (Chơng III).

Đồ án tốt nghiệp

Tài liệu tham khảo

1. Mạng máy tính và hệ thống mở Tác giả GS.TS. Nguyễn Thúc Hải 2. Internet Information Server’s Book Online

3. Active Server Page Online.Microsoft Personal Web Server 4. MSDN (Microsoft Developer Network)

5. VBScript in 21 Days

6. A guide to Angkor “An Introduction to the Temple” 7. Tìm hiểu Văn hoá nghệ thuật Cămpuchia

8. Angkor huyền thoại và sự thật 9. Mạng căn bản

Tác giả VN-GUIDE

10. Thiết kế và xuất bản trang Web 6 trong 1 với HTML Tác giả: Trơng Công Lộc

Mai Hồng Quý

11. Các tạp chí du lịch Angkor (Angkor The Inflight Magazine)

SV: Bou Chan Than Khoa: CNTT Lớp Tin 3 K41

Trang

Bảng chú giải các từ viết tắt Tiếng anh

Từ viết tắt Chú giải

WWW World Wide Web

ASP Active Sever Page

DSN Data Source Name

FTP File Tranfer Protocol

HTML Hypertext Markup Language HTTP Hypertext Tranmission Protocol IDC Internet Database Connector

LAN Local Area Network

RAM Read Access Memory

ODBC Open Data Base Connectivity SQL Structured Query Language URL Uniform Resource Locators

Một phần của tài liệu Xây dựng website du lịch Angkor (Trang 76)