-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndex.html
More file actions
76 lines (71 loc) · 3.46 KB
/
Index.html
File metadata and controls
76 lines (71 loc) · 3.46 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Coffee Shop</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="custom.css">
</head>
<body>
<div id="app" class="container mt-5">
<h2>Coffee Shops</h2>
<div class="row">
<div v-for="shop in coffeeShops" :key="shop.id" class="col-md-4">
<div class="card mb-4">
<div class="card-body text-black border-info ">
<h4>{{ shop.name }}</h4>
<img :src="shop.image" alt="Coffee Shop Image" class="card-img-top img-fluid">
<button @click="currentShop = shop" data-bs-toggle="modal" data-bs-target="#bookingModal" class="btn btn-primary">Book a table</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="bookingModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Book a table at {{ currentShop.name }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form @submit.prevent="bookTable">
<div class="mb-3">
<label class="form-label">Name</label>
<input type="text" v-model="booking.name" class="form-control">
</div>
<div class="mb-3">
<label class="form-label">Phone</label>
<input type="text" v-model="booking.phone" class="form-control">
</div>
<div class="mb-3">
<label class="form-label">Date</label>
<input type="date" v-model="booking.date" class="form-control">
</div>
<div class="mb-3">
<label class="form-label">Time</label>
<input type="time" v-model="booking.time" class="form-control">
</div>
<div class="mb-3">
<label class="form-label">Number of tables</label>
<input type="number" v-model="booking.tables" class="form-control">
</div>
<button type="submit" class="btn btn-primary">Book</button>
</form>
</div>
</div>
</div>
</div>
<h3 class="mt-5">Bookings</h3>
<ul>
<li v-for="book in bookings" :key="book.id">
{{ book.name }} จอง {{ book.shopName }} วันที่ {{ book.date }} เวลา {{ book.time }} สำหรับ {{ book.tables }} table(s).
<button @click="deleteBooking(book.id)" class="btn btn-danger btn-sm">Delete</button>
</li>
</ul>
</div>
<script src="https://unpkg.com/vue@3.2.6/dist/vue.global.prod.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="app.js"></script>
</body>
</html>