You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.6 KiB

  1. <?php
  2. session_start();
  3. header('Content-Type: text/html; charset=UTF-8');
  4. $db = include("config.php");
  5. if (isset($_POST["del"])) {
  6. mysqli_query($db, "DELETE FROM req WHERE `id`='" . $_POST["del"] . "'");
  7. }
  8. ?>
  9. <html>
  10. <head>
  11. <meta charset="utf-8">
  12. <meta name="viewport" content="width=device-width, initial-scale=1">
  13. <title>FutureBuilding Shop - Заказы</title>
  14. <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
  15. <script src="js/bootstrap.js"></script>
  16. <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
  17. <link rel="stylesheet" type="text/css" href="css/style.css">
  18. </head>
  19. <body>
  20. <nav class="navbar fixed-top navbar-light bg-light navbar-expand border">
  21. <a class="navbar-brand" href="worker.php">Admin</a>
  22. <ul class="navbar-nav">
  23. <li class="nav-item dropdown">
  24. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  25. Меню
  26. </a>
  27. <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
  28. <a class="nav-link" href="view.php">Просмотр заказов</a>
  29. <a class="nav-link" href="add-item.php">Добавить товар в базу данных</a>
  30. <a class="nav-link" href="cons.php">Заявки на перезвон</a>
  31. </div>
  32. </li>
  33. </ul>
  34. </nav>
  35. <div class="container">
  36. <input class="form-control" id="myInput" type="text" placeholder="Поиск.."> <br>
  37. <div id="itemlist">
  38. <?php
  39. $result = mysqli_query($db, "SELECT * FROM req");
  40. while ($myrow = mysqli_fetch_array($result)) { ?>
  41. <div class="proj-info col-12">
  42. <div class="proj-name">
  43. <h3>ID заказа: <?php echo $myrow["id"] ?></h3>
  44. </div>
  45. <div class="proj-description">
  46. <span>ФИО: <?php echo $myrow["name"] ?></span><br>
  47. <span>Адрес: <?php echo $myrow["adress"] ?></span><br>
  48. <span>Контакты: <?php echo $myrow["contacts"] ?></span><br>
  49. <form style="display: inline-block" action="viewcart.php" method="get">
  50. <input type="hidden" name="id" value="<?php echo $myrow["id"] ?>">
  51. <input type="submit" class="btn btn-info" value="Перейти к заказу" />
  52. </form>
  53. <form style="display: inline-block" action="view.php" method="post">
  54. <input type="hidden" name="del" value="<?php echo $myrow["id"] ?>">
  55. <input type="submit" class="btn btn-danger" value="Выполнен/Удалить" />
  56. </form>
  57. </div>
  58. </div>
  59. <?php
  60. }
  61. ?>
  62. </div>
  63. </div>
  64. <script>
  65. $(document).ready(function() {
  66. $("#myInput").on("keyup", function() {
  67. var value = $(this).val().toLowerCase();
  68. $("#itemlist .proj-info").filter(function() {
  69. $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
  70. });
  71. });
  72. });
  73. </script>
  74. <footer class="page-footer font-small blue border">
  75. <div class="footer-copyright text-center py-3">
  76. ©FutureBuilding.
  77. </div>
  78. </footer>
  79. </body>
  80. </html>