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.

66 lines
2.6 KiB

  1. <?php
  2. session_start();
  3. header('Content-Type: text/html; charset=UTF-8');
  4. $db = include("config.php");
  5. $textt = "Вы успешно отправили заявку! Ожидайте звонка.";
  6. if (!isset($_SESSION["cart"])) {
  7. $textt = "Корзина пуста!";
  8. } else if (isset($_POST["name"]) && isset($_POST["adress"]) && isset($_POST["contacts"])) {
  9. $query = "INSERT INTO req(name, adress, contacts, cart) VALUES (";
  10. $query .= "'" . $_POST["name"] . "'" . ", ";
  11. $query .= "'" . $_POST["adress"] . "'" . ", ";
  12. $query .= "'" . $_POST["contacts"] . "'" . ", ";
  13. $query .= "'" . json_encode($_SESSION["cart"], JSON_UNESCAPED_UNICODE) . "')";
  14. mysqli_query($db, $query);
  15. session_destroy();
  16. } else {
  17. $textt = "Произошла ошибка. Ваш заявка не обработана.";
  18. }
  19. ?>
  20. <html>
  21. <head>
  22. <meta charset="utf-8">
  23. <meta name="viewport" content="width=device-width, initial-scale=1">
  24. <title>FutureBuilding Shop</title>
  25. <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
  26. <script src="js/bootstrap.js"></script>
  27. <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
  28. <link rel="stylesheet" type="text/css" href="css/style.css">
  29. </head>
  30. <body>
  31. <nav class="navbar fixed-top navbar-light bg-light navbar-expand border">
  32. <a class="navbar-brand" href="index.php">FutureBuilding</a>
  33. <ul class="navbar-nav">
  34. <li class="nav-item dropdown">
  35. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  36. Меню
  37. </a>
  38. <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
  39. <a class="nav-link" href="shop.php">Каталог товаров</a>
  40. <a class="nav-link" href="projects.php">Наши проекты</a>
  41. <a class="nav-link" href="brigade.php">Строительная бригада</a>
  42. </div>
  43. </li>
  44. <li class="nav-item">
  45. <a class="nav-link" href="cart.php">Корзина</a>
  46. </li>
  47. </ul>
  48. </nav>
  49. <div class="container">
  50. <div class="row" style="text-align: center">
  51. <div class="col-12">
  52. <span><?php echo $textt ?></span>
  53. </div>
  54. </div>
  55. </div>
  56. <footer class="page-footer font-small blue border">
  57. <div class="footer-copyright text-center py-3">
  58. ©FutureBuilding
  59. </div>
  60. </footer>
  61. </body>
  62. </html>