質問編集履歴
5
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -198,9 +198,173 @@
|
|
198
198
|
|
199
199
|
var_dump($plan);*/
|
200
200
|
|
201
|
+
var_dump($_POST);
|
202
|
+
|
203
|
+
?>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<!DOCTYPE html>
|
208
|
+
|
209
|
+
<html lang="ja">
|
210
|
+
|
211
|
+
<head>
|
212
|
+
|
213
|
+
<meta charset="UTF8">
|
214
|
+
|
215
|
+
<title>宿泊予約</title>
|
216
|
+
|
217
|
+
<!-- 全画面共通のcssファイル読み込み -->
|
218
|
+
|
219
|
+
<link rel="stylesheet" type="text/css" href="../css_odai/common.css">
|
220
|
+
|
221
|
+
<!-- メニュー詳細用のcssファイル読み込み -->
|
222
|
+
|
223
|
+
<link rel="stylesheet" type="text/css" href="../css_odai/complete.css">
|
224
|
+
|
225
|
+
<script type="text/javascript">
|
226
|
+
|
227
|
+
function keisan(){ //関数宣言
|
228
|
+
|
229
|
+
var hoge = document.getElementById('a_1').value; //テキストエリアの値を取得
|
230
|
+
|
231
|
+
var a = <?php print $plan["price"] ; ?>;
|
232
|
+
|
233
|
+
var price1 = hoge * a; //金額を人数にかける
|
234
|
+
|
235
|
+
document.getElementById('total').value = price1;
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
</script>
|
240
|
+
|
241
|
+
</head>
|
242
|
+
|
243
|
+
<body>
|
244
|
+
|
245
|
+
<div>
|
246
|
+
|
247
|
+
<!-- 任意のページに画面遷移するやり方で一番オーソドックスな方法 -->
|
248
|
+
|
249
|
+
<a href="./chart.php">????浦島観光ホテル</a>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<h1>宿泊予約</h1>
|
254
|
+
|
255
|
+
<p class="text"><?php print $plan["plan_name"];?></p>
|
256
|
+
|
257
|
+
<?php print $plan["detail"]; ?>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
<p>予約フォーム</p>
|
262
|
+
|
263
|
+
<form action="./confirmation.php" method="post">
|
264
|
+
|
265
|
+
<div class="form-row">
|
266
|
+
|
267
|
+
<div class="tab1">
|
268
|
+
|
269
|
+
<label for="name">氏名*<br>
|
270
|
+
|
271
|
+
<!-- required="required"またはrequiredをつけると必須入力項目指定になって入力していないとエラーを返すようだ -->
|
272
|
+
|
273
|
+
<input type="text" name="name" style="width: 300px; height: 30px;" placeholder="予約 太郎" required value="<?php if(isset($_SESSION['name'])){print $_SESSION['name'];} ?>">
|
274
|
+
|
275
|
+
</label>
|
276
|
+
|
277
|
+
</div>
|
278
|
+
|
279
|
+
<div class="tab2">
|
280
|
+
|
281
|
+
<label for="syukuhaku">宿泊人数*<br>
|
282
|
+
|
283
|
+
<input type="number" id="a_1" name="a_1" style="width: 120px; height: 30px;" min="0" placeholder="人数" onChange="keisan()" required value="<?php if(isset($_SESSION['a_1'])){print $_SESSION['a_1'];} ?>">
|
284
|
+
|
285
|
+
</label>
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
<div>
|
290
|
+
|
291
|
+
合計金額<br><span>
|
292
|
+
|
293
|
+
<input type="text" id="total" name="total" style="width: 100px; height: 30px;" placeholder="0" readonly value="<?php if(isset($_SESSION['total'])){print $_SESSION['total'];} ?>">
|
294
|
+
|
295
|
+
</span>
|
296
|
+
|
297
|
+
</div>
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div class="form-row">
|
302
|
+
|
303
|
+
<div class="tab3">
|
304
|
+
|
305
|
+
<label for="email">メールアドレス*<br>
|
306
|
+
|
307
|
+
<input type="email" id="email" name="email" style="width: 300px; height: 30px;" placeholder="teberst@mailbox.com" required value="<?php if(isset($_SESSION['email'])){print $_SESSION['email'];} ?>">
|
308
|
+
|
309
|
+
</label>
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div>
|
314
|
+
|
315
|
+
<label for="tel">電話番号*<br>
|
316
|
+
|
317
|
+
<input type="tel" id="phone" name="phone" pattern="[\d]*" maxlength="11" style="width: 250px; height: 30px;" placeholder="090XXXXXXXX" required value="<?php if(isset($_SESSION['phone'])){print $_SESSION['phone'];} ?>">
|
318
|
+
|
319
|
+
</label>
|
320
|
+
|
321
|
+
</div>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div class="spase">
|
326
|
+
|
327
|
+
<label for="time">到着予定時刻<br>
|
328
|
+
|
329
|
+
<input type="time" id="yotei" name="yotei" style="width: 200px; height: 30px;" value="<?php if(isset($_SESSION['yotei'])){print $_SESSION['yotei'];} ?>">
|
330
|
+
|
331
|
+
</label>
|
332
|
+
|
333
|
+
<div class="spase">
|
334
|
+
|
335
|
+
<label for="message">備考<br>
|
336
|
+
|
337
|
+
<!--テキストエリアはvalue使えない。-->
|
338
|
+
|
339
|
+
<textarea id="mess" name="mess" placeholder="チェックアウトの時間を遅らせたい" ><?php if(isset($_SESSION['mess'])){print $_SESSION['mess'];} ?></textarea>
|
340
|
+
|
341
|
+
</label>
|
342
|
+
|
343
|
+
</div>
|
344
|
+
|
345
|
+
</div>
|
346
|
+
|
347
|
+
<input class="submit1" type="submit" value="確認">
|
348
|
+
|
349
|
+
<input class="button2" type="button" onclick="location.href='./chart.php'" value="戻る">
|
350
|
+
|
351
|
+
</form>
|
352
|
+
|
353
|
+
</body>
|
354
|
+
|
355
|
+
</html>
|
356
|
+
|
357
|
+
```
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
完了
|
362
|
+
|
363
|
+
```php
|
364
|
+
|
201
365
|
<?php
|
202
366
|
|
203
|
-
|
367
|
+
session_start();
|
204
368
|
|
205
369
|
?>
|
206
370
|
|
@@ -212,34 +376,14 @@
|
|
212
376
|
|
213
377
|
<head>
|
214
378
|
|
215
|
-
<meta charset="UTF8">
|
379
|
+
<meta charset="UTF-8">
|
216
|
-
|
380
|
+
|
217
|
-
<title>
|
381
|
+
<title>浦島観光ホテル</title>
|
218
382
|
|
219
383
|
<!-- 全画面共通のcssファイル読み込み -->
|
220
384
|
|
221
385
|
<link rel="stylesheet" type="text/css" href="../css_odai/common.css">
|
222
386
|
|
223
|
-
<!-- メニュー詳細用のcssファイル読み込み -->
|
224
|
-
|
225
|
-
<link rel="stylesheet" type="text/css" href="../css_odai/complete.css">
|
226
|
-
|
227
|
-
<script type="text/javascript">
|
228
|
-
|
229
|
-
function keisan(){ //関数宣言
|
230
|
-
|
231
|
-
var hoge = document.getElementById('a_1').value; //テキストエリアの値を取得
|
232
|
-
|
233
|
-
var a = <?php print $plan["price"] ; ?>;
|
234
|
-
|
235
|
-
var price1 = hoge * a; //金額を人数にかける
|
236
|
-
|
237
|
-
document.getElementById('total').value = price1;
|
238
|
-
|
239
|
-
}
|
240
|
-
|
241
|
-
</script>
|
242
|
-
|
243
387
|
</head>
|
244
388
|
|
245
389
|
<body>
|
@@ -252,160 +396,14 @@
|
|
252
396
|
|
253
397
|
</div>
|
254
398
|
|
255
|
-
<h1>
|
256
|
-
|
257
|
-
<p
|
258
|
-
|
259
|
-
<
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
<p>予約フォーム</p>
|
264
|
-
|
265
|
-
<form action="./confirmation.php" method="post">
|
266
|
-
|
267
|
-
<div class="form-row">
|
268
|
-
|
269
|
-
<div class="tab1">
|
270
|
-
|
271
|
-
<label for="name">氏名*<br>
|
272
|
-
|
273
|
-
<!-- required="required"またはrequiredをつけると必須入力項目指定になって入力していないとエラーを返すようだ -->
|
274
|
-
|
275
|
-
<input type="text" name="name" style="width: 300px; height: 30px;" placeholder="予約 太郎" required value="<?php if(isset($_SESSION['name'])){print $_SESSION['name'];} ?>">
|
276
|
-
|
277
|
-
</label>
|
278
|
-
|
279
|
-
</div>
|
280
|
-
|
281
|
-
<div class="tab2">
|
282
|
-
|
283
|
-
<label for="syukuhaku">宿泊人数*<br>
|
284
|
-
|
285
|
-
<input type="number" id="a_1" name="a_1" style="width: 120px; height: 30px;" min="0" placeholder="人数" onChange="keisan()" required value="<?php if(isset($_SESSION['a_1'])){print $_SESSION['a_1'];} ?>">
|
286
|
-
|
287
|
-
</label>
|
288
|
-
|
289
|
-
</div>
|
290
|
-
|
291
|
-
<div>
|
292
|
-
|
293
|
-
合計金額<br><span>
|
294
|
-
|
295
|
-
<input type="text" id="total" name="total" style="width: 100px; height: 30px;" placeholder="0" readonly value="<?php if(isset($_SESSION['total'])){print $_SESSION['total'];} ?>">
|
296
|
-
|
297
|
-
</span>
|
298
|
-
|
299
|
-
</div>
|
300
|
-
|
301
|
-
</div>
|
302
|
-
|
303
|
-
<div class="form-row">
|
304
|
-
|
305
|
-
<div class="tab3">
|
306
|
-
|
307
|
-
<label for="email">メールアドレス*<br>
|
308
|
-
|
309
|
-
<input type="email" id="email" name="email" style="width: 300px; height: 30px;" placeholder="teberst@mailbox.com" required value="<?php if(isset($_SESSION['email'])){print $_SESSION['email'];} ?>">
|
310
|
-
|
311
|
-
</label>
|
312
|
-
|
313
|
-
</div>
|
314
|
-
|
315
|
-
<div>
|
316
|
-
|
317
|
-
<label for="tel">電話番号*<br>
|
318
|
-
|
319
|
-
<input type="tel" id="phone" name="phone" pattern="[\d]*" maxlength="11" style="width: 250px; height: 30px;" placeholder="090XXXXXXXX" required value="<?php if(isset($_SESSION['phone'])){print $_SESSION['phone'];} ?>">
|
320
|
-
|
321
|
-
</label>
|
322
|
-
|
323
|
-
</div>
|
324
|
-
|
325
|
-
</div>
|
326
|
-
|
327
|
-
<div class="spase">
|
328
|
-
|
329
|
-
<label for="time">到着予定時刻<br>
|
330
|
-
|
331
|
-
<input type="time" id="yotei" name="yotei" style="width: 200px; height: 30px;" value="<?php if(isset($_SESSION['yotei'])){print $_SESSION['yotei'];} ?>">
|
332
|
-
|
333
|
-
</label>
|
334
|
-
|
335
|
-
<div class="spase">
|
336
|
-
|
337
|
-
<label for="message">備考<br>
|
338
|
-
|
339
|
-
<!--テキストエリアはvalue使えない。-->
|
340
|
-
|
341
|
-
<textarea id="mess" name="mess" placeholder="チェックアウトの時間を遅らせたい" ><?php if(isset($_SESSION['mess'])){print $_SESSION['mess'];} ?></textarea>
|
342
|
-
|
343
|
-
</label>
|
344
|
-
|
345
|
-
</div>
|
346
|
-
|
347
|
-
</div>
|
348
|
-
|
349
|
-
<input class="submit1" type="submit" value="確認">
|
350
|
-
|
351
|
-
<input class="button2" type="button" onclick="location.href='./chart.php'" value="戻る">
|
352
|
-
|
353
|
-
</form>
|
399
|
+
<h1>予約完了</h1>
|
400
|
+
|
401
|
+
<p>予約が完了しました。</p>
|
402
|
+
|
403
|
+
<a href="./chart.php">予約一覧に戻る</a>
|
354
404
|
|
355
405
|
</body>
|
356
406
|
|
357
|
-
</html>
|
407
|
+
</html>
|
358
408
|
|
359
409
|
```
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
完了
|
364
|
-
|
365
|
-
```php
|
366
|
-
|
367
|
-
<?php
|
368
|
-
|
369
|
-
session_start();
|
370
|
-
|
371
|
-
?>
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
<!DOCTYPE html>
|
376
|
-
|
377
|
-
<html lang="ja">
|
378
|
-
|
379
|
-
<head>
|
380
|
-
|
381
|
-
<meta charset="UTF-8">
|
382
|
-
|
383
|
-
<title>浦島観光ホテル</title>
|
384
|
-
|
385
|
-
<!-- 全画面共通のcssファイル読み込み -->
|
386
|
-
|
387
|
-
<link rel="stylesheet" type="text/css" href="../css_odai/common.css">
|
388
|
-
|
389
|
-
</head>
|
390
|
-
|
391
|
-
<body>
|
392
|
-
|
393
|
-
<div>
|
394
|
-
|
395
|
-
<!-- 任意のページに画面遷移するやり方で一番オーソドックスな方法 -->
|
396
|
-
|
397
|
-
<a href="./chart.php">????浦島観光ホテル</a>
|
398
|
-
|
399
|
-
</div>
|
400
|
-
|
401
|
-
<h1>予約完了</h1>
|
402
|
-
|
403
|
-
<p>予約が完了しました。</p>
|
404
|
-
|
405
|
-
<a href="./chart.php">予約一覧に戻る</a>
|
406
|
-
|
407
|
-
</body>
|
408
|
-
|
409
|
-
</html>
|
410
|
-
|
411
|
-
```
|
4
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -368,8 +368,6 @@
|
|
368
368
|
|
369
369
|
session_start();
|
370
370
|
|
371
|
-
//$_POSTで受け取る
|
372
|
-
|
373
371
|
?>
|
374
372
|
|
375
373
|
|
3
追加情報
test
CHANGED
File without changes
|
test
CHANGED
@@ -172,6 +172,192 @@
|
|
172
172
|
|
173
173
|
```
|
174
174
|
|
175
|
+
予約フォーム
|
176
|
+
|
177
|
+
```php
|
178
|
+
|
179
|
+
<?php
|
180
|
+
|
181
|
+
//セッション開始
|
182
|
+
|
183
|
+
session_start();
|
184
|
+
|
185
|
+
$plan = array(
|
186
|
+
|
187
|
+
"plan_id" => "1",
|
188
|
+
|
189
|
+
"plan_name" => "素泊まりプラン",
|
190
|
+
|
191
|
+
"detail" => "素泊まりプランの説明です。",
|
192
|
+
|
193
|
+
"price" => "6000");
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
/*print_r($plan);
|
198
|
+
|
199
|
+
var_dump($plan);*/
|
200
|
+
|
201
|
+
<?php
|
202
|
+
|
203
|
+
var_dump($_POST);
|
204
|
+
|
205
|
+
?>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<!DOCTYPE html>
|
210
|
+
|
211
|
+
<html lang="ja">
|
212
|
+
|
213
|
+
<head>
|
214
|
+
|
215
|
+
<meta charset="UTF8">
|
216
|
+
|
217
|
+
<title>宿泊予約</title>
|
218
|
+
|
219
|
+
<!-- 全画面共通のcssファイル読み込み -->
|
220
|
+
|
221
|
+
<link rel="stylesheet" type="text/css" href="../css_odai/common.css">
|
222
|
+
|
223
|
+
<!-- メニュー詳細用のcssファイル読み込み -->
|
224
|
+
|
225
|
+
<link rel="stylesheet" type="text/css" href="../css_odai/complete.css">
|
226
|
+
|
227
|
+
<script type="text/javascript">
|
228
|
+
|
229
|
+
function keisan(){ //関数宣言
|
230
|
+
|
231
|
+
var hoge = document.getElementById('a_1').value; //テキストエリアの値を取得
|
232
|
+
|
233
|
+
var a = <?php print $plan["price"] ; ?>;
|
234
|
+
|
235
|
+
var price1 = hoge * a; //金額を人数にかける
|
236
|
+
|
237
|
+
document.getElementById('total').value = price1;
|
238
|
+
|
239
|
+
}
|
240
|
+
|
241
|
+
</script>
|
242
|
+
|
243
|
+
</head>
|
244
|
+
|
245
|
+
<body>
|
246
|
+
|
247
|
+
<div>
|
248
|
+
|
249
|
+
<!-- 任意のページに画面遷移するやり方で一番オーソドックスな方法 -->
|
250
|
+
|
251
|
+
<a href="./chart.php">????浦島観光ホテル</a>
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
<h1>宿泊予約</h1>
|
256
|
+
|
257
|
+
<p class="text"><?php print $plan["plan_name"];?></p>
|
258
|
+
|
259
|
+
<?php print $plan["detail"]; ?>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<p>予約フォーム</p>
|
264
|
+
|
265
|
+
<form action="./confirmation.php" method="post">
|
266
|
+
|
267
|
+
<div class="form-row">
|
268
|
+
|
269
|
+
<div class="tab1">
|
270
|
+
|
271
|
+
<label for="name">氏名*<br>
|
272
|
+
|
273
|
+
<!-- required="required"またはrequiredをつけると必須入力項目指定になって入力していないとエラーを返すようだ -->
|
274
|
+
|
275
|
+
<input type="text" name="name" style="width: 300px; height: 30px;" placeholder="予約 太郎" required value="<?php if(isset($_SESSION['name'])){print $_SESSION['name'];} ?>">
|
276
|
+
|
277
|
+
</label>
|
278
|
+
|
279
|
+
</div>
|
280
|
+
|
281
|
+
<div class="tab2">
|
282
|
+
|
283
|
+
<label for="syukuhaku">宿泊人数*<br>
|
284
|
+
|
285
|
+
<input type="number" id="a_1" name="a_1" style="width: 120px; height: 30px;" min="0" placeholder="人数" onChange="keisan()" required value="<?php if(isset($_SESSION['a_1'])){print $_SESSION['a_1'];} ?>">
|
286
|
+
|
287
|
+
</label>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
<div>
|
292
|
+
|
293
|
+
合計金額<br><span>
|
294
|
+
|
295
|
+
<input type="text" id="total" name="total" style="width: 100px; height: 30px;" placeholder="0" readonly value="<?php if(isset($_SESSION['total'])){print $_SESSION['total'];} ?>">
|
296
|
+
|
297
|
+
</span>
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
</div>
|
302
|
+
|
303
|
+
<div class="form-row">
|
304
|
+
|
305
|
+
<div class="tab3">
|
306
|
+
|
307
|
+
<label for="email">メールアドレス*<br>
|
308
|
+
|
309
|
+
<input type="email" id="email" name="email" style="width: 300px; height: 30px;" placeholder="teberst@mailbox.com" required value="<?php if(isset($_SESSION['email'])){print $_SESSION['email'];} ?>">
|
310
|
+
|
311
|
+
</label>
|
312
|
+
|
313
|
+
</div>
|
314
|
+
|
315
|
+
<div>
|
316
|
+
|
317
|
+
<label for="tel">電話番号*<br>
|
318
|
+
|
319
|
+
<input type="tel" id="phone" name="phone" pattern="[\d]*" maxlength="11" style="width: 250px; height: 30px;" placeholder="090XXXXXXXX" required value="<?php if(isset($_SESSION['phone'])){print $_SESSION['phone'];} ?>">
|
320
|
+
|
321
|
+
</label>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
<div class="spase">
|
328
|
+
|
329
|
+
<label for="time">到着予定時刻<br>
|
330
|
+
|
331
|
+
<input type="time" id="yotei" name="yotei" style="width: 200px; height: 30px;" value="<?php if(isset($_SESSION['yotei'])){print $_SESSION['yotei'];} ?>">
|
332
|
+
|
333
|
+
</label>
|
334
|
+
|
335
|
+
<div class="spase">
|
336
|
+
|
337
|
+
<label for="message">備考<br>
|
338
|
+
|
339
|
+
<!--テキストエリアはvalue使えない。-->
|
340
|
+
|
341
|
+
<textarea id="mess" name="mess" placeholder="チェックアウトの時間を遅らせたい" ><?php if(isset($_SESSION['mess'])){print $_SESSION['mess'];} ?></textarea>
|
342
|
+
|
343
|
+
</label>
|
344
|
+
|
345
|
+
</div>
|
346
|
+
|
347
|
+
</div>
|
348
|
+
|
349
|
+
<input class="submit1" type="submit" value="確認">
|
350
|
+
|
351
|
+
<input class="button2" type="button" onclick="location.href='./chart.php'" value="戻る">
|
352
|
+
|
353
|
+
</form>
|
354
|
+
|
355
|
+
</body>
|
356
|
+
|
357
|
+
</html>
|
358
|
+
|
359
|
+
```
|
360
|
+
|
175
361
|
|
176
362
|
|
177
363
|
完了
|
2
誤字
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
任意のデータを送る方法 PHP
|
1
|
+
任意のデータを別ページへ送る方法 PHP
|
test
CHANGED
File without changes
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
ここでプラン選びのページで
|
12
12
|
|
13
|
-
プランと予約
|
13
|
+
「なんのプラン」と「予約日」を完了画面にデータを送りたいのですがどうしてもできなく、どこが間違えてるや何が足りないなどアドバイスをいただきたいです。
|
14
14
|
|
15
15
|
|
16
16
|
|