-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeeting_room_booking_bootstrap.html
More file actions
84 lines (72 loc) · 3.64 KB
/
Copy pathmeeting_room_booking_bootstrap.html
File metadata and controls
84 lines (72 loc) · 3.64 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Meeting Room Booking</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
<div class="card p-4 shadow">
<h2 class="mb-3">Book a Meeting Room</h2>
<label for="room" class="form-label">Select a Meeting Room:</label>
<select id="room" class="form-select mb-3">
<option value="Room A">Room A</option>
<option value="Room B">Room B</option>
<option value="Room C">Room C</option>
</select>
<label for="date" class="form-label">Select Date:</label>
<input type="date" id="date" class="form-control mb-3">
<label for="time" class="form-label">Select Time:</label>
<input type="time" id="time" class="form-control mb-3">
<label for="duration" class="form-label">Select Duration:</label>
<select id="duration" class="form-select mb-3">
<option value="30">30 mins</option>
<option value="60">1 hour</option>
<option value="90">1.5 hours</option>
<option value="120">2 hours</option>
<option value="150">2.5 hours</option>
<option value="180">3 hours</option>
<option value="240">4 hours</option>
</select>
<label for="title" class="form-label">Booking Title:</label>
<input type="text" id="title" class="form-control mb-3">
<label for="description" class="form-label">Description:</label>
<textarea id="description" class="form-control mb-3"></textarea>
<button class="btn btn-primary w-100" id="bookButton">Book Now</button>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const bookButton = document.getElementById("bookButton");
const roomField = document.getElementById('room');
const dateField = document.getElementById('date');
const timeField = document.getElementById('time');
const durationField = document.getElementById('duration');
const titleField = document.getElementById('title');
const descriptionField = document.getElementById('description');
bookButton.addEventListener("click", function() {
const room = roomField.value;
const date = dateField.value;
const time = timeField.value;
const duration = durationField.value;
const title = titleField.value;
const description = descriptionField.value;
if (!room || !date || !time || !duration || !title || !description) {
alert("Please fill in all required fields.");
return;
}
const currentDateTime = new Date();
const selectedDateTime = new Date(`${date}T${time}`);
if (selectedDateTime < currentDateTime) {
alert("You cannot book a meeting in the past.");
return;
}
alert(`Meeting Room: ${room}\nDate: ${date}\nTime: ${time}\nDuration: ${duration} mins\nTitle: ${title}\nDescription: ${description}`);
});
});
</script>
</body>
</html>