-
Notifications
You must be signed in to change notification settings - Fork 0
/
reserve.html
246 lines (204 loc) · 8.78 KB
/
reserve.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!doctype html>
<html lang="jp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Hugo 0.84.0">
<title>Carousel Template · Bootstrap v5.0</title>
<link rel="canonical" href="https://getbootstrap.com/docs/5.0/examples/carousel/">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Beau+Rivage&display=swap" rel="stylesheet">
<!-- Bootstrap core CSS -->
<link href="./assets/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="./assets/dist/css/bootstrap.min.js">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<!-- Custom styles for this template -->
<link href="carousel.css" rel="stylesheet">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="container-fluid">
<a class="navbar-brand font-shoplogo" href="#">Makana a Anela</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="./index.html">ホーム</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="./therapist.html">セラピスト</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="./price.html">コース</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="./reserve.html">予約</a>
<!--<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>-->
</li>
</ul>
<form class="d-flex">
<a class="navbar-brand">連絡先:000-0000-000</a>
<!--<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>-->
</form>
</div>
</div>
</nav>
</header>
<main>
<div class="container px-1 py-2" id="featured-3">
<h2 align="center" class="pb-1 border-bottom">予約</h2>
</div>
<div align="center" style="max-width:1200px;"class="container">
<input style="margin-top:4px;" type="button" align="center" class="btn btn-active btn-lg btn-primary" value="xx/xx(月)" id="0" onclick="test1(this.id)"></input>
<input style="margin-top:4px;" type="button" align="center" class="btn btn-passive btn-lg btn-primary" value="xx/xx(火)" id="1" onclick="test1(this.id)"></input>
<input style="margin-top:4px;" type="button" align="center" class="btn btn-passive btn-lg btn-primary" value="xx/xx(水)" id="2" onclick="test1(this.id)"></input>
<input style="margin-top:4px;" type="button" align="center" class="btn btn-passive btn-lg btn-primary" value="xx/xx(木)" id="3" onclick="test1(this.id)"></input>
<input style="margin-top:4px;" type="button" align="center" class="btn btn-passive btn-lg btn-primary" value="xx/xx(金)" id="4" onclick="test1(this.id)"></input>
<input style="margin-top:4px;" type="button" align="center" class="btn btn-passive btn-lg btn-primary" value="xx/xx(土)" id="5" onclick="test1(this.id)"></input>
<input style="margin-top:4px;" type="button" align="center" class="btn btn-passive btn-lg btn-primary" value="xx/xx(日)" id="6" onclick="test1(this.id)"></input>
</div><!-- /.row -->
<div class="container">
<!-- Three columns of text below the carousel -->
<div class="row" id="mainDiv">
<div align="center" class="col-lg-3">
<a href="./therapistDetail.html">
<img src="./img/sampleA.png" width="200px"height="266px" alt="Responsive image" class="img-fluidhref">
</a>
<h4>高橋 花子(20歳)</h4>
<p>予約満員</p>
<p>22:00 ~ 26:00</p>
</div><!-- /.col-lg-4 -->
<div align="center" class="col-lg-3">
<img src="./img/S__343465988.jpg" width="200px"height="266px" alt="Responsive image" class="img-fluid">
<h3>高橋 花子(20歳)</h3>
<p>22:00~23:00</p>
<p>予約可</p>
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
<!-- /END THE FEATURETTES -->
</div><!-- /.container -->
<!-- FOOTER -->
<footer class="container">
<p class="float-end"><a href="#">Back to top</a></p>
<p>© 2021 Company, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p>
</footer>
</main>
<script src="./assets/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
<script>
window.onload = function(){
test1(0);
for(let j=0;j<7;j++){
var now = new Date();
now.setDate(now.getDate() + j);
var dayOfWeek = now.getDay() ; // 曜日(数値)
var dayOfWeekStr = [ "日", "月", "火", "水", "木", "金", "土" ][dayOfWeek] ; // 曜日(日本語表記)
var Day = ("0"+now.getDate()).slice(-2);
var Month = ("0"+(now.getMonth() + 1)).slice(-2);
let btnElement = document.getElementById(j);
btnElement.value=Month+"/"+Day+"("+dayOfWeekStr+")";
}
}
function test1(e){
var now = new Date();
now.setDate(now.getDate() + parseInt(e));
var Hour = now.getHours();
var Day = ("0"+now.getDate()).slice(-2);
var Month = ("0"+(now.getMonth() + 1)).slice(-2);
const reader = new FileReader();
getTxtData( Month+""+Day+".txt");
for(let j=0;j<7;j++){
if (j != e){
let btnElement = document.getElementById(j);
btnElement.style.backgroundColor = '#ddd';
btnElement.style.color = '#5a5a5a';
btnElement.style.borderColor = '#5a5a5a';
}
else
{
let btnElement = document.getElementById(j);
btnElement.style.backgroundColor = '#0d6efd';
btnElement.style.color = '#fff';
btnElement.style.borderColor = '#0d6efd';
}
}
}
function getTxtData(filePath){
const xhr = new XMLHttpRequest();
xhr.open('get', "./day/"+filePath);
xhr.send();
xhr.onreadystatechange = function() {
// (4) 通信が正常に完了したか確認
if( xhr.readyState === 4 && xhr.status === 200) {
// (5) 取得したレスポンスをページに表示
const words = this.responseText.split("\n");
console.log(words)
let cnt = 0;
//要素削除
var mainElement = document.getElementById('mainDiv');
while( mainElement.firstChild ){
mainElement.removeChild( mainElement.firstChild );
}
// 好きなように処理します。
for (let i = 0; i < words.length; i++) {
if(words.length >= (i+3))
{
getTherapistData( words[i]+".txt" , words[i+1],words[i+2]);
}
i+=3;
cnt++;
}
}
}
}
function getTherapistData(filePath2 , timezone,reserve){
let nameElement = '';
const xhr2 = new XMLHttpRequest();
xhr2.open('get', "./member/"+filePath2);
xhr2.send();
xhr2.onreadystatechange = function() {
// (4) 通信が正常に完了したか確認
if( xhr2.readyState === 4 && xhr2.status === 200) {
// (5) 取得したレスポンスをページに表示
const therapist = this.responseText.split("\n");
console.log(therapist)
if(therapist[2]=="新人"){
nameElement = '<div><img src="./icon/new.png" width="20px"height="20px" alt="Responsive image" class="img-fluid" style="display:inline-block;"/><h4 style="display:inline-block;">'+therapist[0]+'('+therapist[1]+'歳)</h4></div>'
}else{
nameElement = '<h4>'+therapist[0]+'('+therapist[1]+'歳)</h4>'
}
var mainElement = document.getElementById('mainDiv');
mainElement.insertAdjacentHTML('beforeend',
'<div align="center" class="col-lg-3">' +
'<a>' +
'<img src="./img/sampleA.png" width="200px"height="266px" alt="Responsive image" class="img-fluidhref">'+
'</a>'+
nameElement+
'<div>'+reserve+'</div>'+
'<div style="font-size:20px">'+timezone+'</div>'+
'</div>');
}
}
}
</script>