Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. <?php session_start(); ?>
  2.  
  3. <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/assets/include/header.php"; ?>
  4.  
  5.  
  6. <form action="edit.php" class="reserves" method="post">
  7. <lable>Destination/Hotel: *</lable><br>
  8. <div id="bookHotel"></div> <br>
  9. <div class="select_persen_and_room">
  10. <lable>Værelsestype: *</lable>
  11. <lable>Antal personer: *</lable>
  12.  
  13. <div id="bookHotelRoom"></div>
  14.  
  15. <select name="persons" required>
  16. <option value="0">0</option>
  17. <option value="1">1</option>
  18. <option value="2">2</option>
  19. <option value="3">3</option>
  20. </select>
  21. </div><br>
  22. <lable>Check-in dato: *</lable><br>
  23. <input type="date" name="checkin"required><br>
  24. <lable>Check-ud dato: *</lable><br>
  25. <input type="date" name="checkout" required><br>
  26. <button type="submit">send</button>
  27.  
  28.  
  29. <?php
  30. $username = $_SESSION["username"];
  31. $id = $_GET["id"];
  32. $stmt = $pdo->prepare("UPDATE `svendeproeve_reserver`
  33. set `checkin` = :checkin,
  34. `checkout` = :checkout,
  35. `hotel` = :hotel,
  36. `hotelRoom` = :hotelRoom,
  37. `persons` = :persons
  38. WHERE id = '$id' AND username = '$username'");
  39. $stmt->bindParam(":checkin", $checkin, PDO::PARAM_STR);
  40. $stmt->bindParam(":checkout", $checkout, PDO::PARAM_STR);
  41. $stmt->bindParam(":hotel", $hotel, PDO::PARAM_STR);
  42. $stmt->bindParam(":hotelRoom", $hotelRoom, PDO::PARAM_STR);
  43. $stmt->bindParam(":persons", $persons, PDO::PARAM_STR);
  44.  
  45.  
  46.  
  47.  
  48. // set parameters and execute
  49. $checkin = $_POST['checkin'];
  50. $checkout = $_POST['checkout'];
  51. $hotel = $_POST['hotel'];
  52. $hotelRoom = $_POST['hotelRoom'];
  53. $persons = $_POST['persons'];
  54.  
  55. $stmt->execute();
  56.  
  57.  
  58. ?>
  59. <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/assets/include/footer.php"; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement