本系统采用phpstudy开发平台,采用PHP和MySQL数据库进行开发,开发工具为HBuilder。phpStudy是一个PHP调试环境的程序集成最新的
Apache+PHP+MySQL+phpMyAdmin,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。(其他平台均可)@@@文末有获取方式
功能:
图书部分:
图书录入 图书下架 图书信息修改 查询图书
用户部分:
增添用户 注销用户 重置用户 修改信息
借阅部分:
图书借阅 图书归还 逾期图书 图书催还
操作日志记录 个人信息
php7版本 layui框架
- 用户登录
<?php
session_start();
if($_SESSION['yzm']==$_POST['yzm']){
$yzm="yes";
}
else{
$yzm="no";
}
include('../install/conn.php');
$mima=md5(md5($_POST['password']));
$sql="select * from admins where wno='".$_POST['wno']."' and wps='".$mima."'";
$conn=mysqli_connect($servername,$username,$password,$database);
if(!$conn){
die("连接失败:".mysqli_connect_error());
exit();
}
$str=mysqli_query($conn,$sql);
$num=mysqli_num_rows($str);
$row=mysqli_fetch_object($str);
if($num==0){
$yh="no";
}
else{
$yh='yes';
$_SESSION['username']=$row->wname;
$_SESSION['wno']=$row->wno;
// $a=$row->usno;
}
$arr=array('yonghu'=>$yh,'yzm'=>$yzm,'sql'=>$_SESSION['wno']);
echo json_encode($arr);
?>
- 后台首页
div id="nav">
ul>
li>a href="muser.php">用户基本信息管理/a>
ol>
li >a href="muser.php" style="color: white;">用户录入/a>/li>
li >a href="muser.php" style="color: white;">注销用户/a>/li>
li >a href="muser.php" style="color: white;">重置密码/a>/li>
li >a href="muser.php" style="color: white;">修改信息/a>/li>
/ol>
/li>
li>a href="mbook.php">图书基本信息管理/a>
ol>
li>a href="mbook.php" style="color: white;">图书录入/a>/li>
li >a href="mbook.php" style="color: white;">图书销毁/a>/li>
li >a href="mbook.php" style="color: white;">修改信息/a>/li>
li >a href="mbook.php" style="color: white;">查询图书/a>/li>
/ol>
/li>
li>a href="mborrow.php">图书借阅管理/a>
ol>
li>a href="mborrow.php" style="color: white;">图书借阅/a>/li>
li >a href="mborrow.php" style="color: white;">图书归还/a>/li>
!-- li >a href="mborrow.php" style="color: white;">新用户录入/a>/li>
li >a href="mborrow.php" style="color: white;">新用户录入/a>/li> -->
/ol>
/li>
li>a href="">库存图书管理/a>
ol>
li>a href="" style="color: white;">新用户录入/a>/li>
li >a href="" style="color: white;">新用户录入/a>/li>
li >a href="" style="color: white;">新用户录入/a>/li>
li >a href="" style="color: white;">新用户录入/a>/li>
/ol>
/li>
li>a href="">个人中心/a>
ol>
li>a title="编辑" style="color: white;" onclick="xadmin.open('编辑','self.php? idd=<?php echo $row->bno;?>',600,550)" href="javascript:;">个人信息/a>/li>
li>a href="mloginout.php" style="color: white;">退出/a>/li>
/ol>
/li>
/ul>
/div>
- 用户信息
?php
//
include('../install/conn.php');
$conn=mysqli_connect($servername,$username,$password,$database);
$per_page=10;
$sql="select * from users";
//分页
$str=mysqli_query($conn,$sql);
$total=mysqli_num_rows($str);
$total_page=ceil($total/$per_page);
if($_GET['next_page']==''){
$dq_page=1;
$begin=0;
}
else{
$dq_page=$_GET['next_page'];
$begin=($dq_page-1)*$per_page;
}
$sql="select * from users limit $begin,$per_page";
$str=mysqli_query($conn,$sql);
while($row=mysqli_fetch_object($str)){
?>
tr>
td>?php echo $row->usno?>/td>
td>?php echo $row->usname?>/td>
td>?php echo $row->ussex?>/td>
td>?php echo $row->usem?>/td>
td>?php echo $row->usnum?>/td>
td class="td-manage">
a title="编辑" onclick="xadmin.open('编辑','member-edit.php? idd=<?php echo $row->usno;?>',600,500)" href="javascript:;">
i class="layui-icon">
/a>
a onclick="xadmin.open('重置密码','memberpsw.php? idd=<?php echo $row->usno;?>',600,400)" title="重置密码" href="javascript:;">
i class="layui-icon">
/a>
a title="删除" onclick="member_del(this,<?php echo $row->usno?>)" href="javascript:;">
i class="layui-icon">
/a>
/td>
/tr>
?php
}
?>
- 添加用户
<?php
session_start();
include('../install/conn.php');
$conn=mysqli_connect($servername,$username,$password,$database);
$mima=md5(md5($_POST['pass']));
$sql1="select * from admins where wno=".$_SESSION['wno'];
$str=mysqli_query($conn,$sql1);
$row=mysqli_fetch_object($str);
$w_ps=$row->wps;
$sql4="select * from users where usno=".$_POST['usno'];
$str4=mysqli_query($conn,$sql4);
$row4=mysqli_fetch_object($str4);
$usno=$row4->usno;
if($w_ps!=$mima){
$pw=0;
}
else{
$pw=1;
if($usno==$_POST['usno']){
$c=0;
}
else{
$c=1;
$sql="insert into `users` (`usno`,`usname`, `usps`, `usem`,`usnum`,`ussex`) values ('".$_POST['usno']."','".$_POST['username']."','".$mima."', '".$_POST['email']."', '".$_POST['mobile']."', '".$_POST['sex']."');";
$str=mysqli_query($conn,$sql);
if($str){
$code=1;
}
else{
$code=0;
};
}
}
$arr=array('code'=>$code,'sql'=>$sql,'pw'=>$pw,'c'=>$c);
echo json_encode($arr);
?>
- 添加图书
<?php
session_start();
include('../install/conn.php');
$conn=mysqli_connect($servername,$username,$password,$database);
$mima=md5(md5($_POST['pass']));
//检验图书
$sql4="select * from books where bno=".$_POST['bno'];
$str4=mysqli_query($conn,$sql4);
$row4=mysqli_fetch_object($str4);
$b_no=$row4->bno;
//检验管理员密码
$sql8="select * from admins where wno=".$_SESSION['wno'];
$str=mysqli_query($conn,$sql8);
$row=mysqli_fetch_object($str);
$w_ps=$row->wps;
if($w_ps!=$mima){
$pw=0;
}
else{
if($b_no==$_POST['bno']){
$c=0;
}
else{
$c=1;
$sql="insert into `books` (`bno`,`bname`, `writer`, `press`) values ('".$_POST['bno']."','".$_POST['bname']."','".$_POST['writer']."','".$_POST['press']."');";
$str1=mysqli_query($conn,$sql);
$now=date('Y-m-d H:i:s');
$sql2="insert into `massage` (`bno`, `bstatus`,`wno`,`mtime`) values ('".$_POST['bno']."','在馆','".$_SESSION['wno']."','".$now."');";
$str2=mysqli_query($conn,$sql2);
$sql3="insert into `belong` (`bno`,`cno`) values ('".$_POST['bno']."','".$_POST['cno']."');";
$str3=mysqli_query($conn,$sql3);
}
if($str1==true and $str2==true and $str3==true){
$code=1;
}
else{
$code=0;
}
$pw=1;
}
$arr=array('code'=>$code,'c'=>$c,'pw'=>$pw,'sql'=>[$sql3,$sql2,$sql],'str'=>[$str1,$str2,$str3]);
echo json_encode($arr);
?>
- 导航栏
跳转获取源代码
演示视频