-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwomen_provider_bookings.html
185 lines (179 loc) · 5.91 KB
/
women_provider_bookings.html
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Women Provider Bookings</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Varela&display=swap');
html, body {
height: 100%;
margin: 0;
padding: 0;
}
body {
font-family: 'Varela', sans-serif;
font-size: 14px;
line-height: 1.5;
color: #fff;
background: radial-gradient(ellipse at center, rgba(230, 200, 250, 1) 0%, rgba(180, 140, 200, 1) 100%);
display: flex;
flex-direction: column;
min-height: 100vh;
}
nav {
background-color: rgba(180, 140, 200, 0.8);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 10px 0;
z-index: 2;
}
nav ul {
list-style-type: none;
padding: 0;
margin: 0;
display: flex;
justify-content: center;
gap: 20px;
}
nav ul li {
display: inline;
}
nav ul li a {
text-decoration: none;
color: #fff;
padding: 10px 20px;
background-color: transparent;
border: 1px solid #f0c6e2;
transition: background-color 0.3s, color 0.3s;
}
nav ul li a:hover {
background-color: #f0c6e2;
color: #890ba5;
}
header {
text-align: center;
margin: 40px 0 20px;
z-index: 2;
}
header h1 {
color: #890ba5;
font-size: 36px;
margin: 0;
}
main {
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
z-index: 2;
}
.container {
background-color: rgba(230, 200, 250, 0.8);
padding: 40px;
box-shadow: 1px 1px 10px 1px #b37aaf, 8px 8px 0px 0px #c48ec6, 12px 12px 10px 0px #b37aaf;
width: 80%;
max-width: 800px;
text-align: center;
border-radius: 10px;
}
.booking {
background-color: rgba(255, 255, 255, 0.8);
padding: 20px;
border-radius: 10px;
margin-bottom: 20px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
transition: transform 0.3s ease-in-out;
border-left: 4px solid #890ba5;
}
.booking:hover {
transform: translateY(-10px);
}
.booking h3 {
margin: 0;
font-size: 24px;
color: #890ba5;
}
.booking p {
margin: 5px 0;
font-size: 18px;
color: #b37aaf;
}
footer {
margin-top: 20px;
text-align: center;
color: #890ba5;
z-index: 2;
padding: 10px 0;
background-color: rgba(255, 255, 255, 0.8);
}
footer p {
margin: 0;
}
#loading-indicator {
display: none;
color: #890ba5;
font-size: 18px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<nav>
<ul>
<li><a href="/women-home">Home</a></li>
<li><a href="/women-provider-profile">Profile</a></li>
</ul>
</nav>
<header>
<h1>Your Bookings</h1>
</header>
<main>
<div class="container" id="bookings-container">
<h2>Manage Your Appointments</h2>
<div id="loading-indicator">Loading your bookings...</div>
<div id="bookings-list"></div>
</div>
</main>
<footer>
<p>© 2024 GrihaSeva. All rights reserved.</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function() {
const loadingIndicator = document.getElementById('loading-indicator');
const bookingsList = document.getElementById('bookings-list');
loadingIndicator.style.display = 'block';
bookingsList.style.display = 'none';
fetch('/api/women-provider-bookings')
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
})
.then(data => {
if (data.bookings && data.bookings.length > 0) {
const bookingsHTML = data.bookings.map(booking => `
<div class="booking">
<h3>${booking.service || 'Unknown Service'}</h3>
<p>Date: ${booking.date || 'No Date'}</p>
<p>Time: ${booking.time || 'No Time'}</p>
</div>
`).join('');
bookingsList.innerHTML = bookingsHTML;
} else {
bookingsList.innerHTML = '<p>No bookings found.</p>';
}
})
.catch(error => {
console.error('Error fetching bookings:', error);
bookingsList.innerHTML = `<p>Error loading bookings: ${error.message}</p>`;
})
.finally(() => {
loadingIndicator.style.display = 'none';
bookingsList.style.display = 'block';
});
});
</script>
</body>
</html>