PHP-MySQL图书管理系统(附源代码)

本系统采用phpstudy开发平台,采用PHP和MySQL数据库进行开发,开发工具为HBuilder。phpStudy是一个PHP调试环境的程序集成最新的

Apache+PHP+MySQL+phpMyAdmin,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。(其他平台均可)@@@文末有获取方式

功能:

图书部分:

图书录入 图书下架 图书信息修改 查询图书

用户部分:

增添用户 注销用户 重置用户 修改信息

借阅部分:

图书借阅 图书归还 逾期图书 图书催还

操作日志记录 个人信息

php7版本 layui框架

  • 用户登录

登录界面


		$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);
?>
  • 后台首页

管理系统首页

					
  • 用户基本信息管理
    1. 用户录入
    2. 注销用户
    3. 重置密码
    4. 修改信息
  • 图书基本信息管理
    1. 图书录入
    2. 图书销毁
    3. 修改信息
    4. 查询图书
  • 图书借阅管理
    1. 图书借阅
    2. 图书归还
  • 库存图书管理
    1. 新用户录入
    2. 新用户录入
    3. 新用户录入
    4. 新用户录入
  • 个人中心
    1. bno;?>',600,550)" href="javascript:;">个人信息
    2. 退出
  • 用户信息

用户信息界面

	
									$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)){
								?>			
											
											
				                          
				                            
				                            usno?>
				                            usname?> 
											ussex?>
											 usem?>
											usnum?> 
				                            
				                              
				                              usno;?>',600,500)" href="javascript:;">
				                                
				                              
				                              usno;?>',600,400)" title="重置密码" href="javascript:;">
				                                
				                              
				                              usno?>)" href="javascript:;">
				                                
				                              
				                            
				                          
										  
							
  • 添加用户

添加用户

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);
?>
  • 添加图书

添加图书

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);
?>
  • 导航栏

导航栏

跳转获取源代码

演示视频

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/5f00394002.html