tushuguan.zip

2401_82852880ZIPtushuguan.zip  2.4MB

资源文件列表:

ZIP tushuguan.zip 大约有37个文件
  1. tushuguan/
  2. tushuguan/add_books.php 3.6KB
  3. tushuguan/add_book_process.php 1.94KB
  4. tushuguan/conn.php 520B
  5. tushuguan/css/
  6. tushuguan/css/bootstrap.min.css 215.61KB
  7. tushuguan/css/bootstrap.min.css.map 555.09KB
  8. tushuguan/css/reg.css 230B
  9. tushuguan/delete_book.php 1KB
  10. tushuguan/edit_book.php 3.61KB
  11. tushuguan/edit_book_process.php 2.3KB
  12. tushuguan/header.php 2.16KB
  13. tushuguan/images/
  14. tushuguan/images/1.jpg 348.52KB
  15. tushuguan/images/10.jpg 379.17KB
  16. tushuguan/images/2.jpg 297.59KB
  17. tushuguan/images/3.jpg 326.62KB
  18. tushuguan/images/4.jpg 251.15KB
  19. tushuguan/images/5.jpg 141.69KB
  20. tushuguan/images/6.jpg 115.96KB
  21. tushuguan/images/7.jpg 155.98KB
  22. tushuguan/images/8.jpg 125.82KB
  23. tushuguan/images/9.jpg 113.04KB
  24. tushuguan/index.php 3.86KB
  25. tushuguan/js/
  26. tushuguan/js/bootstrap.bundle.min.js 78.71KB
  27. tushuguan/js/bootstrap.bundle.min.js.map 326.15KB
  28. tushuguan/js/bootstrap.min.js 59.13KB
  29. tushuguan/js/bootstrap.min.js.map 212.78KB
  30. tushuguan/js/jquery.min.js 90.92KB
  31. tushuguan/login.php 1.51KB
  32. tushuguan/login_do.php 825B
  33. tushuguan/logout.php 486B
  34. tushuguan/register.php 1.47KB
  35. tushuguan/register_do.php 1.51KB
  36. tushuguan/数据库/
  37. tushuguan/数据库/tushuguan.sql 4.29KB

资源介绍:

tushuguan.zip

<?php include('./conn.php'); // 获取搜索关键词 $search_keyword = ''; if (!empty($_POST['search'])) { $search_keyword = $_POST['search']; } // 查询书籍信息 $query = "SELECT * FROM books WHERE title LIKE '%$search_keyword%' OR author LIKE '%$search_keyword%'"; $result = $conn->query($query); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="./css/bootstrap.min.css"> <title>书籍管理</title> <style> body { background-color: #f8f9fa; } .container { margin-top: 50px; background-color: #ffffff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .table th, .table td { vertical-align: middle; } .table img { display: block; margin: 0 auto; } .table-hover tbody tr:hover { background-color: #f1f1f1; } </style> </head> <body> <?php include "header.php"; // 检查用户角色是否为管理员 if (!$_SESSION['username']) { echo "<script>alert('请先登录管理员账号'); window.location.href='login.php';</script>"; exit; } ?> <div class="container"> <!-- 搜索框 --> <form method="POST" class="mb-4"> <div class="input-group"> <input type="text" class="form-control" placeholder="搜索书名或作者" name="search" value="<?php echo $search_keyword; ?>"> <div class="input-group-append"> <button class="btn btn-primary" type="submit">搜索</button> </div> </div> </form> <!-- 书籍表格 --> <div class="table-responsive"> <table class="table table-bordered table-hover"> <thead class="thead-dark"> <tr> <th>序号</th> <th>书名</th> <th>作者</th> <th>描述</th> <th>价格</th> <th style="width: 5%;">分类</th> <th>图片</th> <th>创建时间</th> <th style="width: 10%;">操作</th> </tr> </thead> <tbody> <?php if ($result->num_rows > 0) { $index = 1; while ($row = $result->fetch_assoc()) { echo "<tr>"; echo "<td>" . $index++ . "</td>"; echo "<td>" . $row['title'] . "</td>"; echo "<td>" . $row['author'] . "</td>"; echo "<td>" . $row['description'] . "</td>"; echo "<td>" . $row['price'] . "</td>"; echo "<td>" . $row['category'] . "</td>"; echo "<td><img src='./" . $row['image_path'] . "' alt='书籍图片' style='width: 100px;'></td>"; echo "<td>" . $row['created_at'] . "</td>"; echo "<td>"; echo "<a href='edit_book.php?book_id=" . $row['book_id'] . "' class='btn btn-warning btn-sm'>编辑</a> "; echo "<a href='delete_book.php?book_id=" . $row['book_id'] . "' class='btn btn-danger btn-sm' onclick='return confirm(\"确定要删除这本书吗?\");'>删除</a>"; echo "</td>"; echo "</tr>"; } } else { echo "<tr><td colspan='9' class='text-center'>没有找到书籍信息</td></tr>"; } ?> </tbody> </table> </div> </div> <script src="./js/jquery.min.js"></script> <script src="./js/bootstrap.min.js"></script> </body> </html> <?php $conn->close(); ?>
100+评论
captcha