Design of tourism website based on Java web [source code + thesis] in software engineering


foreword

Today, seniors share with you a Java web graduation design project:

Tourism website design based on Java web

Project acquisition:
https://gitee.com/sinonfin/L-javaWebSha

1. Project design

1. Modular design

The functional design of the system is relatively comprehensive and can meet the needs of most users. However, it is impossible to meet the requirements of every customer. We can only strive to improve the website functions as much as possible to achieve better results. The tourism website of Saibei villages and towns mainly promotes the tourism of Saibei villages and towns through the introduction of various functional modules, including the home page, Saibei humanities, and Saibei stories. The specific implementation of each part of the front and back is shown in Figure 1, the front-end structure of the website, and Figure 2, the background structure of the website:
insert image description here
insert image description here

2. Realize the effect

insert image description here

insert image description here

insert image description here
insert image description here
insert image description here

insert image description here
insert image description here

There are many functions, so I won’t show them one by one here

2. Part of the source code

There are many source codes and the length of the article is limited, so I won’t post them here, and only show a small part of the key code

Some code examples:

该代码实现了塞北村镇旅游网站的主界面设计,现附录关键程序代码如下:
</style>
</head>
<script language="javascript">
function check()
{
    
    
	if(document.form1.yonghuming.value==""){
    
    alert("请输入用户名");document.form1.yonghuming.focus();return false;}if(document.form1.mima.value=="")
{
    
    alert("请输入密码");document.form1.mima.focus();return false;}if(document.form1.xingming.value=="")
{
    
    alert("请输入姓名");document.form1.xingming.focus();return false;}
}
functiongow()
{
    
    
document.location.href="yonghuzhuce_add.jsp?jihuabifffanhao="+document.form1.jihuabifffanhao.value;
}
</script>
对于景点信息界面,可以进行景点的选择与查看功能,管理员还可以在后台进行对该模块操作,实现对景点信息的添加删除和修改。实现该模块的核心代码如下所示:
<link rel="stylesheet" type="text/css" href="<%=path %>/css/base.css" />
curpage=1;
}
if (curpage==0)
{
    
    
curpage=1;
}
if(curpage>zys)
{
    
    
curpage=zys;
}
//out.print(curpage);
	
String sql="select top "+page_record+" * from shangpinxinxi where id not in (select top "+((curpage-1)*page_record)+" id from shangpinxinxi order by id desc) ";				
if(sc.equals(""))
{
    
    }
else
{
    
    
sql=sql+" and "+ltt+" like '%"+qd+"%'";
}
sql=sql+" order by id desc";				
ResultSetRS_result=connDbBean.executeQuery(sql);
while(RS_result.next()){
    
    
i=i+1;
j=j+1;
id=RS_result.getString("id");
bianhao=RS_result.getString("bianhao");
mingcheng=RS_result.getString("mingcheng");
tupian=RS_result.getString("tupian"); %>
实现酒店预订的核心代码如下所示:
<%
String jiudianmingcheng=request.getParameter("jiudianmingcheng");String kefangbianhao=request.getParameter("kefangbianhao");String jiage=request.getParameter("jiage");String yudingshijian=request.getParameter("yudingshijian");String yudingtianshu=request.getParameter("yudingtianshu");String nindexingming=request.getParameter("nindexingming");String nindedianhua=request.getParameter("nindedianhua");String nindeshenfenzheng=request.getParameter("nindeshenfenzheng");String beizhu=request.getParameter("beizhu");String yonghuming=request.getParameter("yonghuming");
String id=request.getParameter("id");
String sql="update jiudianyuding set jiudianmingcheng='"+jiudianmingcheng+"',kefangbianhao='"+kefangbianhao+"',jiage='"+jiage+"',yudingshijian='"+yudingshijian+"',yudingtianshu='"+yudingtianshu+"',nindexingming='"+nindexingming+"',nindedianhua='"+nindedianhua+"',nindeshenfenzheng='"+nindeshenfenzheng+"',beizhu='"+beizhu+"',yonghuming='"+yonghuming+"' where id= "+id;
connDbBean.executeUpdate(sql);
out.print("<script>alert('修改成功!!');
location.href='jiudianyuding_updt.jsp?id="+id+"';</script>"); %>
在后台登录模块中,权限为管理员的用户方可登录成功,进行一系列的后台管理操作,核心程序代码如下:
String uid=request.getParameter("username");
String pwd=request.getParameter("pwd");
String cx=new String(request.getParameter("cx").getBytes("8859_1"));
String sql="";
if(cx.equals("员工"))
{
    
    
sql="select * from [yuangongxinxi] where yonghuming='"+uid+"' and mima='"+pwd+"'";
}
else
{
    
    
sql="select * from [allusers] where username='"+uid+"' and pwd='"+pwd+"'";
}
ResultSetRS_result=connDbBean.executeQuery(sql);
if(!RS_result.next())
{
    
    
out.print("<script>alert('你输入的用户不存在或密码错误,请重新登录!');
window.history.go(-1);</script>");
}
else{
    
    
session.setAttribute("username",uid);
if(cx.equals("员工"))
{
    
    
session.setAttribute("cx","员工");
}
else
{
    
    
session.setAttribute("cx",RS_result.getString("cx"));
}
response.sendRedirect("main.jsp");
}
RS_result.close();
%>
景点后台管理可以对景点信息进行添加和查询修改操作,实现其关键程序代码如下所示:
String sql="insert into xinwentongzhi(biaoti,leibie,neirong,tianjiaren,shouyetupian,dianjilv) values('"+biaoti+"','"+leibie+"','"+neirong+"','"+tianjiaren+"','"+shouyetupian+"','"+dianjilv+"') ";
connDbBean.executeUpdate(sql);
out.print("<script>alert('添加成功!!')
;location.href='xinwentongzhi_add.jsp?lb="+leibie+"';</script>");
在实现自驾游路线管理模块中,管理员可以对路线进行实时修改和更新,以方便广大用户进行路线的选择。实现该功能的核心代码如下:
<%
intcurpage=1;//当前页
intpage_record=10;//每页显示的记录数
intzgs=0;
intzys=0;
//用下面的方法(sql查询完成,速度快)
String hsgnpage=request.getParameter("page");
String fysql="select count(id) as ss from shangpinxinxi";
ResultSetRS_resultfy=connDbBean.executeQuery(fysql);
while(RS_resultfy.next()){
    
    
zgs=Integer.parseInt(RS_resultfy.getString("ss"));
zys=zgs/page_record+1;
}
if (hsgnpage!=null)
{
    
    
curpage=Integer.parseInt(request.getParameter("page"));//获取传递的值,需要显示的页
}
else
{
    
    
curpage=1;
}

Project source code

Project acquisition:
https://gitee.com/sinonfin/L-javaWebSha

Guess you like

Origin blog.csdn.net/mojikopi/article/details/131992255