基于PHP开发的响应式景点门票预订网站含源码论文
本系统代码简单,完整无BUB,完全开源,可二次开发修改并扩展。适合有志于PHP学习的同学参考学习使用,可修改为在线商城管理系统。可以写论文。
一、前端架构
前端基于bootstrap4.3框架,自适应移动端,是学习自适应移动端开发的优秀参考网站,代码干净整洁,无冗余。
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand wow fadeInLeftBig" href="index.html"><img src="images/logo.png" class="img-fluid"></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse wow fadeInRightBig" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">网站首页</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php?id=53" >普洱介绍</a>
</li>
<li class="nav-item">
<a class="nav-link" href="list.php?id=57" >普洱美食</a>
</li>
<li class="nav-item">
<a class="nav-link" href="list.php?id=58" >普洱特产</a>
</li>
<li class="nav-item">
<a class="nav-link" href="product.php?id=6" >风景名胜</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php?id=59" >民俗文化</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="home.php" id="navbarDropdownUser" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user-circle-o"></i>会员中心</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownUser">
<a class="dropdown-item" href="login.php">会员登录</a>
<a class="dropdown-item" href="reg.php">会员注册</a>
</div>
</li>
</ul>
</div>
</div>
</nav>
二、前端效果
首页效果
登录界面
景点展示介绍与下单界面
会员中心界面
三、后台管理功能
后台定单管理功能
后台分类管理功能
后台景点添加管理功能
四、后台部分核心代码
function Nav_next_back_html($filename, $id, $classid, $tablename){
$pdo = new PDO(DB_DSN,DB_USER,DB_PWD,
[PDO::ATTR_ERRMODE=>PDO::ERRMODE_WARNING]);
$Nav_next_back_html_str = '';
$sqlPrev = 'SELECT `id`,`title`,`class_id` FROM `'.$tablename.'` WHERE id<'.$id.' AND class_id='.$classid.' ORDER BY id DESC LIMIT 1';
$fstmt = $pdo->prepare($sqlPrev);
$fstmt->execute();
if (!empty($fstmt->rowCount())) {
$flist = $fstmt->fetchAll();
$Nav_next_back_html_str .= '<div class="prev">上一条:<a href="'.$filename.'.php?id='.$flist[0][0].'">'.$flist[0][1].'</a></div>';
} else {
$Nav_next_back_html_str .= '<div class="prev">上一条:<span>暂时没有上一条内容了!</span></div>';
}
$sqlNext = 'SELECT `id`,`title`,`class_id` FROM `'.$tablename.'` WHERE id>'.$id.' AND class_id='.$classid.' ORDER BY id ASC LIMIT 1';
$fstmt = $pdo->prepare($sqlNext);
$fstmt->execute();
if (!empty($fstmt->rowCount())) {
$flist = $fstmt->fetchAll();
$Nav_next_back_html_str .= '<div class="prev">下一条:<a href="'.$filename.'.php?id='.$flist[0][0].'">'.$flist[0][1].'</a></div>';
} else {
$Nav_next_back_html_str .= '<div class="prev">下一条:<span>暂时没有下一条内容了!</span></div>';
}
return $Nav_next_back_html_str;
}
// 获取IP函数
function GetIP(){
if(!empty($_SERVER["HTTP_CLIENT_IP"])){
$cip = $_SERVER["HTTP_CLIENT_IP"];
}
elseif(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){
$cip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
elseif(!empty($_SERVER["REMOTE_ADDR"])){
$cip = $_SERVER["REMOTE_ADDR"];
}
else{
$cip = "无法获取!";
}
return $cip;
}
//echo GetIP();
// 获取父ID函数
function getParentID($cate, $id) {
$arr = array();
foreach ($cate as $v) {
if ($v['id'] == $id) {
$arr[] = $v;
$arr = array_merge(getParentID($cate, $v['parent_id']), $arr);
}
}
return $arr;
}
原创文章,如需转载,请备注来源(比特网络服务,如需源码,关注公众号:比特网络服务),否则视为侵权。
上一篇: 程序员开发指南
下一篇: java开发一个视频