forked from MarcusHNBRN/KOOPERATIV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfirmation.php
28 lines (24 loc) · 949 Bytes
/
confirmation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
declare(strict_types=1);
include 'db.php';
if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['start_date']) && isset($_GET['end_date']) && isset($_GET['room_type']) && isset($_GET['guest_name'])) {
$start_date = $_GET['start_date'];
$end_date = $_GET['end_date'];
$room_type = $_GET['room_type'];
$guest_name = $_GET['guest_name'];
$stmt = $pdo->prepare("INSERT INTO bookings (start_date, end_date, room_type, guest_name) VALUES (?, ?, ?, ?)");
$stmt->execute([$start_date, $end_date, $room_type, $guest_name]);
echo "<h1>Booking Confirmed</h1>";
echo "<p>Thank you for your booking, $guest_name!</p>";
echo "<p>Details:</p>";
echo "<ul>";
echo "<li>Start Date: $start_date</li>";
echo "<li>End Date: $end_date</li>";
echo "<li>Room Type: $room_type</li>";
echo "<li>Guest Name: $guest_name</li>";
echo "</ul>";
} else {
header("Location: index.php");
exit();
}
?>