PHP-MYSQL宾馆客房管理系统(附源码)
分为 前台用户和 后台管理员两个角色,功能完善,界面优美,运行良好。 (文末有获取源代码方式)
主要功能
用户:
-
查看客房信息
-
在线预订
-
订单查询
-
信息留言等
管理员:
- 入住管理:(大堂入住 订单入住 入住查询 入住统计)
- 退房管理:(退房清算)
- 房间管理:(新增房间 房间编辑)
- 房类管理:(新增房类 房类编辑)
- 相册管理:(新增相册 相册编辑)
- 留言管理:(留言查看)
- 系统管理:(人员添加 密码修改 退出系统)
主要语言
PHP MySQL JavaScript HTML JQuery
本系统采用phpstudy开发平台,采用PHP和MySQL数据库进行开发,开发工具为HBuilder。同时在Dw、PHPstorm、submit、Vscode等编辑器软件中均可正常运行。
phpStudy是一个PHP调试环境的程序集成最新的Apache+PHP+MySQL+phpMyAdmin,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。(其他开发平台均可)
部分界面
- 后台登录
require("../dbconnect.php");if($_POST['action'] == "test"){ function make_safe($variable) { $variable = addslashes(trim($variable)); return $variable; } $user=make_safe($_POST["username"]); $pass=make_safe($_POST["pwd"]); $sql="select * from admin where name='$user'"; $result=mysqli_query($db_link,$sql); $row = mysqli_fetch_assoc($result); if($row==false) { echo ""; exit; } else { if($row["passwd"]==$pass) { session_start(); $_SESSION['aname']=$row["name"]; // 重定向 header("location:admin_index.php"); exit; } else { echo ""; exit; } }}?>
- 在线预订
require("dbconnect.php"); $pagesize = 10; $sql = "select a.roomid,b.typeid,b.typename,b.area,b.hasNet,b.hasTV,b.price from room a,roomtype b where a.typeid=b.typeid and a.status='否' and b.leftnum>0 and a.roomid not in (select roomid from orders where ostatus='是')"; $rs=mysqli_query($db_link,$sql); if(!$rs) { echo "抱歉,房间已满"; exit; } $recordcount=mysqli_num_rows($rs); $pagecount=($recordcount-1)/$pagesize+1; $pagecount=(int)$pagecount; $pageno=@$_GET["pageno"]; if($pageno=="") { $pageno=1; } if($pageno>$pagecount) { $pageno=$pagecount; } $startno=($pageno-1)*$pagesize; $sql="select a.roomid,b.typeid,b.typename,b.area,b.hasNet,b.hasTV,b.price from room a,roomtype b where a.typeid=b.typeid and a.status='否' and b.leftnum>0 and a.roomid not in (select roomid from orders where ostatus='是') order by roomid asc limit $startno,$pagesize"; $rs=mysqli_query($db_link,$sql); if(!$rs) { echo "抱歉,房间已满"; exit; } while($rows=mysqli_fetch_assoc($rs)) { ?> <tr> <td class='tc'> echo $rows["roomid"] ?></td> <td class='tc'> echo $rows["typeid"] ?></td> <td class='tc'> echo $rows["typename"] ?></td> <td class='tc'> echo $rows["area"] ?></td> <td class='tc'> echo $rows["hasNet"] ?></td> <td class='tc'> echo $rows["hasTV"] ?></td> <td class='tc'> echo $rows["price"] ?></td> <td class='tc'> <a href='online_order.php?orid=' class='link-update'>在线预订</a> </td> </tr> } ?>
- 订单查询
require("dbconnect.php"); $sql="select a.roomid,b.typeid,b.typename,b.price from room a,roomtype b where a.typeid=b.typeid and a.roomid='".$_GET["orid"]."'"; $arr=mysqli_query($db_link,$sql); $rows=mysqli_fetch_row($arr); ?>
- 相册管理
require("../dbconnect.php"); $pagesize = 10; $sql = "select * from news"; $rs=mysqli_query($db_link,$sql); if(!$rs) { echo "无相册信息!"; exit; } $recordcount=mysqli_num_rows($rs); $pagecount=($recordcount-1)/$pagesize+1; $pagecount=(int)$pagecount; $pageno=@$_GET["pageno"]; if($pageno=="") { $pageno=1; } if($pageno>$pagecount) { $pageno=$pagecount; } $startno=($pageno-1)*$pagesize; $sql="select * from news order by id asc limit $startno,$pagesize"; $rs=mysqli_query($db_link,$sql); if(!$rs) { echo "无相册信息"; exit; } while($rows=mysqli_fetch_assoc($rs)) { ?> <tr> <td class='tc'> echo $rows["id"] ?></td> <td class='tc'> echo $rows["title"] ?></td> <td class='tc'> <img height='auto' width="60px" src='../images/'> </td> <td class='tc'> <img height='auto' width="60px" src='../images/'> </td> <td class='tc'> echo $rows["describes"] ?></td> <td class='tc'> <a href='admin_photomod.php?pid=' class='link-update'>修改</a> <a href='delete.php?pid=' class='link-del''>删除</a> </td> </tr> } ?>
- 大堂入住
require("../dbconnect.php"); $pagesize = 10; $sql = "select a.roomid,b.typeid,b.typename,b.area,b.hasNet,b.hasTV,b.price from room a,roomtype b where a.typeid=b.typeid and a.status='否' and b.leftnum>0 and a.roomid not in (select roomid from orders where ostatus='是')"; $rs=mysqli_query($db_link,$sql); if(!$rs) { echo "抱歉,房间已满!"; exit; } $recordcount=mysqli_num_rows($rs); $pagecount=($recordcount-1)/$pagesize+1; $pagecount=(int)$pagecount; $pageno=@$_GET["pageno"]; if($pageno=="") { $pageno=1; } if($pageno>$pagecount) { $pageno=$pagecount; } $startno=($pageno-1)*$pagesize; $sql="select a.roomid,b.typeid,b.typename,b.area,b.hasNet,b.hasTV,b.price from room a,roomtype b where a.typeid=b.typeid and a.status='否' and b.leftnum>0 and a.roomid not in (select roomid from orders where ostatus='是') order by a.roomid asc limit $startno,$pagesize"; $rs=mysqli_query($db_link,$sql); if(!$rs) { echo "抱歉,房间已满"; exit; } while($rows=mysqli_fetch_assoc($rs)) { ?> <tr> <td class='tc'> echo $rows["roomid"] ?></td> <td class='tc'> echo $rows["typeid"] ?></td> <td class='tc'> echo $rows["typename"] ?></td> <td class='tc'> echo $rows["area"] ?></td> <td class='tc'> echo $rows["hasNet"] ?></td> <td class='tc'> echo $rows["hasTV"] ?></td> <td class='tc'> echo $rows["price"] ?></td> <td class='tc'> <a href='admin_order.php?orid=' class='link-update'>办理入住</a> </td> </tr> } ?>
- 人员添加
require("../dbconnect.php"); $pagesize = 10; $sql = "select * from admin"; $rs=mysqli_query($db_link,$sql); $recordcount=mysqli_num_rows($rs); $pagecount=($recordcount-1)/$pagesize+1; $pagecount=(int)$pagecount; $pageno=@$_GET["pageno"]; if($pageno=="") { $pageno=1; } if($pageno>$pagecount) { $pageno=$pagecount; } $startno=($pageno-1)*$pagesize; $sql="select * from admin order by id asc limit $startno,$pagesize"; $rs=mysqli_query($db_link,$sql); while($rows=mysqli_fetch_assoc($rs)) { ?> <tr> <td class='tc'> echo $rows["id"] ?></td> <td class='tc'> echo $rows["name"] ?></td> <td class='tc'> echo $rows["passwd"] ?></td> <td class='tc'> <a href='delete.php?id=' class='link-update'>删除</a> </td> </tr> } ?>
获取方式
方式一:跳转获取源代码
方式二:公众号搜索“麻了秃头”回复“宾馆客房”
其他系统
来源地址:https://blog.csdn.net/qq_57161040/article/details/129683829