質問編集履歴

4

確認画面のコードを忘れていたので記入しました。

2018/03/19 04:46

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -26,6 +26,8 @@
26
26
 
27
27
 
28
28
 
29
+ 入力画面↓
30
+
29
31
  ```php
30
32
 
31
33
  <head>
@@ -230,13 +232,229 @@
230
232
 
231
233
 
232
234
 
235
+ 確認画面↓
236
+
237
+ ```php
238
+
239
+ <body>
240
+
241
+ <h1>出張旅費確認画面</h1>
242
+
243
+ <table>
244
+
245
+ <?php
246
+
247
+ header('Content-Type: text/html; charset=UTF-8');
248
+
249
+ error_reporting(E_ALL & ~E_NOTICE);
250
+
251
+ for($i=1;$i<=3;$i++){
252
+
253
+ $tra[$i]=$_POST['transport'$i];
254
+
255
+ $pri[$i]a=$_POST['price'$i'a'];
256
+
257
+ $div[$i]=$_POST['division'$i];
258
+
259
+ $total[$i]a = $pri[$i]a;
260
+
261
+ }
262
+
263
+ if($_POST[Submit]){
264
+
265
+ for($i=0;$i<=5;$i++){
266
+
267
+ if($_POST["tra".$i]=="0" || $_POST["pri".$i."a"]=='' || $_POST["div".$i]=='0')){
268
+
269
+ $trim = trim($total1a);
270
+
271
+ }
272
+
273
+ else{
274
+
275
+ $_POST["total".$i."a"] = $_POST["pri".$i."a"];
276
+
277
+ print'<tr>';
278
+
279
+ print'<td>交通機関:';
280
+
281
+ print$_POST["tra".$i];
282
+
283
+ print'</td>';
284
+
285
+ print'<td>単価:';
286
+
287
+ print$_POST["pri".$i."a"];
288
+
289
+ print'</td>';
290
+
291
+ print'<td>区間:';
292
+
293
+ print$_POST["div".$i];
294
+
295
+ print'</td>';
296
+
297
+ print'<td>合計:';
298
+
299
+ print$_POST["total".$i."a"];
300
+
301
+ print'円</td>';
302
+
303
+ print'</tr>';
304
+
305
+ }
306
+
307
+ }
308
+
309
+ ?>
310
+
311
+ </table>
312
+
313
+ </body>
314
+
315
+ ```
316
+
317
+
318
+
319
+
320
+
233
321
  ### 試したこと
234
322
 
235
-
323
+ 確認画面を以下のようにすれば当然表示はされますが、
324
+
236
-
325
+ 冗長的になってしまっている部分をループを使って簡潔にしたいです。
326
+
327
+ ```php
328
+
329
+ <body>
330
+
331
+ <table>
332
+
333
+ <?php
334
+
335
+ header('Content-Type: text/html; charset=UTF-8');
336
+
337
+ error_reporting(E_ALL & ~E_NOTICE);
338
+
339
+ $tra1=$_POST['transport1'];
340
+
341
+ $tra2=$_POST['transport2'];
342
+
343
+ $tra3=$_POST['transport3'];
344
+
345
+ $pri1a=$_POST['price1a'];
346
+
347
+ $pri2a=$_POST['price2a'];
348
+
349
+ $pri3a=$_POST['price3a'];
350
+
351
+ $div1=$_POST['division1'];
352
+
353
+ $div2=$_POST['division2'];
354
+
355
+ $div3=$_POST['division3'];
356
+
357
+ $total1a = $pri1a;
358
+
359
+ $total2a = $pri2a;
360
+
361
+ $total3a = $pri3a;
362
+
237
- for文、While文、foreachなど調べてもいまいち理解できていません。
363
+ $totala = $total1a + $total2a + $total3a
364
+
365
+
366
+
238
-
367
+ if($tra1=='0' || $pri1a=='' || $div1=='0'){
368
+
239
-
369
+ $trim = trim($total1a);
370
+
371
+ }
372
+
373
+ else{
374
+
375
+ print'<tr><td>交通機関:';
376
+
377
+ print$tra1;
378
+
379
+ print'</td><td>単価:';
380
+
381
+ print$pri1a;
382
+
383
+ print'</td><td>区間:';
384
+
385
+ print$div1;
386
+
387
+ print'</td><td>合計:';
388
+
389
+ print$total1a;
390
+
391
+ print'円</td></tr>';
392
+
393
+ }
394
+
395
+ if($tra2=='0' || $pri2a=='' || $div2=='0'){
396
+
397
+ $trim = trim($total2a);
398
+
399
+ }
400
+
401
+ else{
402
+
403
+ print'<tr><td>交通機関:';
404
+
405
+ print$tra2;
406
+
407
+ print'</td><td>単価:';
408
+
409
+ print$pri2a;
410
+
411
+ print'</td><td>区間:';
412
+
413
+ print$div2;
414
+
415
+ print'</td><td>合計:';
416
+
417
+ print$total2a;
418
+
419
+ print'円</td></tr>';
420
+
421
+ }
422
+
423
+ if($tra3=='0' || $pri3a=='' || $div3=='0'){
424
+
425
+ $trim = trim($total3a);
426
+
427
+ }
428
+
429
+ else{
430
+
431
+ print'<tr><td>交通機関:';
432
+
433
+ print$tra3;
434
+
435
+ print'</td><td>単価:';
436
+
437
+ print$pri3a;
438
+
439
+ print'</td><td>区間:';
440
+
441
+ print$div3;
442
+
443
+ print'</td><td>合計:';
444
+
445
+ print$total3a;
446
+
447
+ print'円</td></tr>';
448
+
449
+ }
450
+
451
+ ?>
452
+
453
+ </table>
454
+
455
+ </body>
456
+
457
+ ```
240
458
 
241
459
  ### 補足情報(FW/ツールのバージョンなど)
242
460
 

3

HTMLをPHPに変換、問題の部分を抜き出してコードとして表示するようにしました。

2018/03/19 04:46

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- HTML,PHPのループ文の使い方
1
+ PHPのループ文の使い方
test CHANGED
@@ -1,28 +1,32 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
-
4
-
5
- 料金精算ツールの作成にて、
3
+ 入力画面と確認画面があります。
4
+
6
-
5
+ 入力はドロップダウンリストとテキストボックスが入り混じっています。
6
+
7
- HTMLとPHPのループの使い方いまいち理解できておらず苦戦しております。
7
+ テキストボックスには数値入れて、最終的に合計を確認画面確認でるようにしております。
8
+
9
+
10
+
8
-
11
+ その際
12
+
9
- 同じもの繰り返しのコードが延々と続てしまっているので、
13
+ ・入力行作成をループで作成、任意行数を入れた
10
-
11
- どのようにループを応用して短くすることが出来るのか教えていただけますでしょうか?
14
+
12
-
13
- その他指摘などあればぜひ指導いただきたいです。
14
-
15
-
16
-
17
- 今それぞれの変数に番号がついていたり、a,b,cとついていたりしますが、
18
-
19
- を連番につけて任意数をブルに追加できるようにしたいです
15
+ ・行そぞれ数を取得できるようにしたい。
16
+
20
-
17
+ ・確認画面でもPOST(又はGET)の取得をループで取得できるようにしたい。
18
+
19
+
20
+
21
-
21
+ という部分においてうまくいっておりません。
22
+
23
+
24
+
22
-
25
+ ご助力お願い致します。
26
+
27
+
28
+
23
- ```HTML
29
+ ```php
24
-
25
- <html>
26
30
 
27
31
  <head>
28
32
 
@@ -30,621 +34,199 @@
30
34
 
31
35
  </head>
32
36
 
37
+
38
+
33
39
  <body>
34
40
 
35
- <form action="check.php" name="form" method="post">
36
-
37
- <h1>出張旅費精算支援ツール</h1>
38
-
39
- <p>部署名:<select name="department">
40
-
41
- <option value="-">-</option>
42
-
43
- <option value="総務部">総務部</option>
44
-
45
- <option value="営業部">営業部</option>
46
-
47
- </select><span class="space1"></span>名前:<input type="text" name="name"></p>
48
-
49
- <fieldset>
50
-
51
- <legend><h3>交通費</h3></legend>
52
-
53
- <table>
54
-
55
- <thead>
56
-
57
- <tr>
58
-
59
- <th>交通機関</th>
60
-
61
- <th>単価</th>
62
-
63
- <th>利用区分</th>
64
-
65
- <th>合計</th>
66
-
67
- </tr>
68
-
69
- </thead>
70
-
71
- <tbody id="money1">
72
-
73
- <tr>
74
-
75
- <td><select name="transport1">
76
-
77
- <option value="0">-</option>
78
-
79
- <option value="地下鉄">地下鉄</option>
80
-
81
- <option value="JR在来線">JR在来線</option>
82
-
83
- <option value="JR新幹線">JR新幹線</option>
84
-
85
- <option value="阪急">阪急</option>
86
-
87
- <option value="京阪">京阪</option>
88
-
89
- </select></td>
90
-
91
- <td>
92
-
93
- <input type="text" name="price1a" onChange="keisan()"><!--onChange=""は入力即反映のタグ-->
94
-
95
- </td>
96
-
97
- <td><select name="division1">
98
-
99
- <option value="0">-</option>
100
-
101
- <option value="片道">片道</option>
102
-
103
- <option value="往復">往復</option>
104
-
105
- </select></td>
106
-
107
- <td>
108
-
109
- <input disabled type="text" name="total1a" value="0">
110
-
111
- </td>
112
-
113
- </tr>
114
-
115
- </tbody>
116
-
117
- <tr>
118
-
119
- <td align="right" colspan="3">
120
-
121
- <strong>合計</strong>
122
-
123
- </td>
124
-
125
- <td >
126
-
127
- <input type="text" name="totala" value="0">
128
-
129
- </td>
130
-
131
- </tr>
132
-
133
- </table>
134
-
135
-
136
-
137
- </fieldset>
138
-
139
- <fieldset>
140
-
141
- <legend><h3>宿泊費</h3></legend>
142
-
143
- <table>
144
-
145
- <tr>
146
-
147
- <th>宿泊等</th>
148
-
149
- <th>単価</th>
150
-
151
- <th>泊数(数量)</th>
152
-
153
- <th>合計</th>
154
-
155
- </tr>
156
-
157
- <tr>
158
-
159
- <td><select name="syukuhakunado1">
160
-
161
- <option value="0">-</option>
162
-
163
- <option value="宿泊">宿泊</option>
164
-
165
- <option value="飲食">飲食</option>
166
-
167
- </select></td>
168
-
169
- <td>
170
-
171
- <input type="text" name="price1b" onChange="keisan()">
172
-
173
- </td>
174
-
175
- <td>
176
-
177
- <select name="quantity1b" onChange="keisan()">
178
-
179
- <option value="0">-</option>
180
-
181
- <option value="1">1</option>
182
-
183
- <option value="2">2</option>
184
-
185
- <option value="3">3</option>
186
-
187
- <option value="4">4</option>
188
-
189
- <option value="5">5</option>
190
-
191
- <option value="6">6</option>
192
-
193
- <option value="7">7</option>
194
-
195
- <option value="8">8</option>
196
-
197
- <option value="9">9</option>
198
-
199
- <option value="10">10</option>
200
-
201
- </select>
202
-
203
- </td>
204
-
205
- <td>
206
-
207
- <input disabled type="text" name="total1b"value="0">
208
-
209
- </td>
210
-
211
- </tr>
212
-
213
- <tr>
214
-
215
- <td align="right" colspan="3">
216
-
217
- <strong>合計</strong>
218
-
219
- </td>
220
-
221
- <td >
222
-
223
- <input type="text" name="totalb" value="0">
224
-
225
- </td>
226
-
227
- </tr>
228
-
229
- </table>
230
-
231
- </fieldset>
232
-
233
- <fieldset>
234
-
235
- <legend><h3>その他</h3></legend>
236
-
237
- <table>
238
-
239
- <tr>
240
-
241
- <th>用途・商品名等</th>
242
-
243
- <th>単価</th>
244
-
245
- <th>数量</th>
246
-
247
- <th>合計</th>
248
-
249
- </tr>
250
-
251
- <tr>
252
-
253
- <td>
254
-
255
- <input type="text" name="other1">
256
-
257
- </td>
258
-
259
- <td>
260
-
261
- <input type="text" name="price1c" onChange="keisan()">
262
-
263
- </td>
264
-
265
- <td>
266
-
267
- <select name="quantity1c" onChange="keisan()">
268
-
269
- <option value="0">-</option>
270
-
271
- <option value="1">1</option>
272
-
273
- <option value="2">2</option>
274
-
275
- <option value="3">3</option>
276
-
277
- <option value="4">4</option>
278
-
279
- <option value="5">5</option>
280
-
281
- <option value="6">6</option>
282
-
283
- <option value="7">7</option>
284
-
285
- <option value="8">8</option>
286
-
287
- <option value="9">9</option>
288
-
289
- <option value="10">10</option>
290
-
291
- </td>
292
-
293
- <td>
294
-
295
- <input disabled type="text" name="total1c" value="0">
296
-
297
- </td>
298
-
299
- </tr>
300
-
301
- <tr>
302
-
303
- <td align="right" colspan="3">
304
-
305
- <strong>合計</strong>
306
-
307
- </td>
308
-
309
- <td >
310
-
311
- <input type="text" name="totalc" value="0">
312
-
313
- </td>
314
-
315
- </tr>
316
-
317
- </table>
318
-
319
-
320
-
321
- </fieldset>
322
-
323
- <div id="container">
324
-
325
- <p class="goukei"><strong class="kankaku">総合計</strong><input type="text" name="sougoukei" value="0"><span class="space2"></span><input type="submit" onchange="keisan()" value="確認" class="btn"></p>
326
-
327
- </div>
41
+ <form action="kakunin.php" name="form" method="post">
42
+
43
+ <table>
44
+
45
+ <tr>
46
+
47
+ <td>
48
+
49
+ <select name="transport1">
50
+
51
+ <?php
52
+
53
+ $traline1 = array('-' => '0','地下鉄' => '地下鉄','JR在来線' => 'JR在来線','JR新幹線' => 'JR新幹線','阪急' => '阪急','京阪' => '京阪');
54
+
55
+ foreach($traline1 as $k => $v) {
56
+
57
+ print("<option value='$k'>$k</option>");
58
+
59
+ }
60
+
61
+ ?>
62
+
63
+ </select>
64
+
65
+ </td>
66
+
67
+ <td>
68
+
69
+ <input type="text" name="price1a">
70
+
71
+ </td>
72
+
73
+ <td>
74
+
75
+ <select name="division1">
76
+
77
+ <?php
78
+
79
+ $divline1 = array('-' => '0','片道' => '1','往復' => '2');
80
+
81
+ foreach($divline1 as $k => $v) {
82
+
83
+ // print sprintf("<option value='%s'>%s</option>\n", $k ,$v);//文字列表現
84
+
85
+ print("<option value='$k'>$k</option>");
86
+
87
+ }
88
+
89
+ ?>
90
+
91
+ </select>
92
+
93
+ </td>
94
+
95
+ <td>
96
+
97
+ <input disabled type="text" name="total1a" value="0">
98
+
99
+ </td>
100
+
101
+ </tr>
102
+
103
+ <tr>
104
+
105
+ <td>
106
+
107
+ <select name="transport2">
108
+
109
+ <?php
110
+
111
+ $traline2 = array('-' => '0','地下鉄' => '地下鉄','JR在来線' => 'JR在来線','JR新幹線' => 'JR新幹線','阪急' => '阪急','京阪' => '京阪');
112
+
113
+ foreach($traline2 as $k => $v) {
114
+
115
+ print("<option value='$k'>$k</option>");
116
+
117
+ }
118
+
119
+ ?>
120
+
121
+ </select>
122
+
123
+ </td>
124
+
125
+ <td>
126
+
127
+ <input type="text" name="price2a">
128
+
129
+ </td>
130
+
131
+ <td>
132
+
133
+ <select name="division2">
134
+
135
+ <?php
136
+
137
+ $divline2 = array('-' => '0','片道' => '1','往復' => '2');
138
+
139
+ foreach($divline2 as $k => $v) {
140
+
141
+ // print sprintf("<option value='%s'>%s</option>\n", $k ,$v);//文字列表現
142
+
143
+ print("<option value='$k'>$k</option>");
144
+
145
+ }
146
+
147
+ ?>
148
+
149
+ </select>
150
+
151
+ </td>
152
+
153
+ <td>
154
+
155
+ <input disabled type="text" name="total2a" value="0">
156
+
157
+ </td>
158
+
159
+ </tr>
160
+
161
+ <tr>
162
+
163
+ <td>
164
+
165
+ <select name="transport3">
166
+
167
+ <?php
168
+
169
+ $traline3 = array('-' => '0','地下鉄' => '地下鉄','JR在来線' => 'JR在来線','JR新幹線' => 'JR新幹線','阪急' => '阪急','京阪' => '京阪');
170
+
171
+ foreach($traline3 as $k => $v) {
172
+
173
+ print("<option value='$k'>$k</option>");
174
+
175
+ }
176
+
177
+ ?>
178
+
179
+ </select>
180
+
181
+ </td>
182
+
183
+ <td>
184
+
185
+ <input type="text" name="price3a">
186
+
187
+ </td>
188
+
189
+ <td>
190
+
191
+ <select name="division3">
192
+
193
+ <?php
194
+
195
+ $divline3 = array('-' => '0','片道' => '1','往復' => '2');
196
+
197
+ foreach($divline3 as $k => $v) {
198
+
199
+ // print sprintf("<option value='%s'>%s</option>\n", $k ,$v);//文字列表現
200
+
201
+ print("<option value='$k'>$k</option>");
202
+
203
+ }
204
+
205
+ ?>
206
+
207
+ </select>
208
+
209
+ </td>
210
+
211
+ <td>
212
+
213
+ <input disabled type="text" name="total3a" value="0">
214
+
215
+ </td>
216
+
217
+ </tr>
218
+
219
+ </table>
220
+
221
+ <input type="submit" value="確認" class="btn">
328
222
 
329
223
  </form>
330
224
 
331
225
  </body>
332
226
 
333
- <footer>
334
-
335
- </footer>
336
-
337
- </html>
338
-
339
227
  ```
340
228
 
341
- ```php
229
+
342
-
343
- <html>
344
-
345
- <head>
346
-
347
- </head>
348
-
349
- <body>
350
-
351
- <?php
352
-
353
- header('Content-Type: text/html; charset=UTF-8');
354
-
355
- error_reporting(E_ALL & ~E_NOTICE);
356
-
357
- $dep=$_POST['department'];
358
-
359
- $name=$_POST['name'];
360
-
361
- $tra1=$_POST['transport1'];
362
-
363
- $pri1a=$_POST['price1a'];
364
-
365
- $div1=$_POST['division1'];
366
-
367
- $total1a = $pri1a;
368
-
369
- $totala = $total1a;
370
-
371
- $syu1=$_POST['syukuhakunado1'];
372
-
373
- $pri1b=$_POST['price1b'];
374
-
375
- $qua1b=$_POST['quantity1b'];
376
-
377
- $total1b = $pri1b * $qua1b;
378
-
379
- $totalb = $total1b;
380
-
381
- $oth1=$_POST['other1'];
382
-
383
- $pri1c=$_POST['price1c'];
384
-
385
- $qua1c=$_POST['quantity1c'];
386
-
387
- $total1c = $pri1c * $qua1c;
388
-
389
- $totalc = $total1c;
390
-
391
- $total = $totala + $totalb + $totalc;
392
-
393
- if($dep=='-'){
394
-
395
- print'部署未記入';
396
-
397
- }
398
-
399
- else{
400
-
401
- print'部署:';
402
-
403
- print$dep;
404
-
405
- print'<br />';
406
-
407
- }
408
-
409
- if($name==''){
410
-
411
- print'名前未記入<br />';
412
-
413
- }
414
-
415
- else{
416
-
417
- print'名前:';
418
-
419
- print$name;
420
-
421
- print'<br />';
422
-
423
- }
424
-
425
- if($tra1=='0'){
426
-
427
- print'';
428
-
429
- }
430
-
431
- else{
432
-
433
- print'交通機関:';
434
-
435
- print$tra1;
436
-
437
- }
438
-
439
- if($pri1a==''){
440
-
441
- print'';
442
-
443
- }
444
-
445
- else{
446
-
447
- print'/単価:';
448
-
449
- print$pri1a;
450
-
451
- }
452
-
453
- if($div1=='0'){
454
-
455
- print'';
456
-
457
- }
458
-
459
- else{
460
-
461
- print'/区間:';
462
-
463
- print$div1;
464
-
465
- }
466
-
467
- if($total1a==''){
468
-
469
- print'<br />';
470
-
471
- }
472
-
473
- else{
474
-
475
- print'/合計:';
476
-
477
- print$total1a;
478
-
479
- print'円<br />';
480
-
481
- }
482
-
483
- print'交通費:';
484
-
485
- print$totala;
486
-
487
- print'円<br />';
488
-
489
- if($syu1=='0'){
490
-
491
- print'';
492
-
493
- }
494
-
495
- else{
496
-
497
- print'宿泊など:';
498
-
499
- print$syu1;
500
-
501
- }
502
-
503
- if($pri1b==''){
504
-
505
- print'';
506
-
507
- }
508
-
509
- else{
510
-
511
- print'/単価:';
512
-
513
- print$pri1b;
514
-
515
- }
516
-
517
- if($qua1b=='0'){
518
-
519
- print'';
520
-
521
- }
522
-
523
- else{
524
-
525
- print'/数量:';
526
-
527
- print$qua1b;
528
-
529
- }
530
-
531
- if($total1b==''){
532
-
533
- print'<br />';
534
-
535
- }
536
-
537
- else{
538
-
539
- print'/合計:';
540
-
541
- print$total1b;
542
-
543
- print'円<br />';
544
-
545
- }
546
-
547
- if($total5b==''){
548
-
549
- print'<br />';
550
-
551
- }
552
-
553
- else{
554
-
555
- print'/合計:';
556
-
557
- print$total5b;
558
-
559
- print'円<br />';
560
-
561
- }
562
-
563
- print'宿泊・飲食費:';
564
-
565
- print$totalb;
566
-
567
- print'円<br />';
568
-
569
- if($oth1==''){
570
-
571
- print'';
572
-
573
- }
574
-
575
- else{
576
-
577
- print'名称:';
578
-
579
- print$oth1;
580
-
581
- }
582
-
583
- if($pri1c==''){
584
-
585
- print'';
586
-
587
- }
588
-
589
- else{
590
-
591
- print'/単価:';
592
-
593
- print$pri1c;
594
-
595
- }
596
-
597
- if($qua1c=='0'){
598
-
599
- print'';
600
-
601
- }
602
-
603
- else{
604
-
605
- print'/数量:';
606
-
607
- print$qua1c;
608
-
609
- }
610
-
611
- if($total1c==''){
612
-
613
- print'<br />';
614
-
615
- }
616
-
617
- else{
618
-
619
- print'/合計:';
620
-
621
- print$total1c;
622
-
623
- print'円<br />';
624
-
625
- }
626
-
627
- print'その他:';
628
-
629
- print$totalc;
630
-
631
- print'円<br />';
632
-
633
- print'総合計:';
634
-
635
- print$total;
636
-
637
- print'円<br />';
638
-
639
- print'<input type="button" onclick="history.back()" value="戻る">';
640
-
641
- ?>
642
-
643
- </body>
644
-
645
- </html>
646
-
647
- ```
648
230
 
649
231
 
650
232
 

2

2018/03/19 04:36

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
File without changes

1

PHPのインデントを追加しました。

2018/03/15 06:13

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -392,250 +392,250 @@
392
392
 
393
393
  if($dep=='-'){
394
394
 
395
- print'部署未記入';
395
+ print'部署未記入';
396
-
396
+
397
- }
397
+ }
398
-
398
+
399
- else{
399
+ else{
400
-
400
+
401
- print'部署:';
401
+ print'部署:';
402
-
402
+
403
- print$dep;
403
+ print$dep;
404
-
404
+
405
- print'<br />';
405
+ print'<br />';
406
406
 
407
407
  }
408
408
 
409
409
  if($name==''){
410
410
 
411
- print'名前未記入<br />';
411
+ print'名前未記入<br />';
412
-
412
+
413
- }
413
+ }
414
-
414
+
415
- else{
415
+ else{
416
-
416
+
417
- print'名前:';
417
+ print'名前:';
418
-
418
+
419
- print$name;
419
+ print$name;
420
-
420
+
421
- print'<br />';
421
+ print'<br />';
422
422
 
423
423
  }
424
424
 
425
425
  if($tra1=='0'){
426
426
 
427
+ print'';
428
+
429
+ }
430
+
431
+ else{
432
+
433
+ print'交通機関:';
434
+
435
+ print$tra1;
436
+
437
+ }
438
+
439
+ if($pri1a==''){
440
+
441
+ print'';
442
+
443
+ }
444
+
445
+ else{
446
+
447
+ print'/単価:';
448
+
449
+ print$pri1a;
450
+
451
+ }
452
+
453
+ if($div1=='0'){
454
+
455
+ print'';
456
+
457
+ }
458
+
459
+ else{
460
+
461
+ print'/区間:';
462
+
463
+ print$div1;
464
+
465
+ }
466
+
467
+ if($total1a==''){
468
+
469
+ print'<br />';
470
+
471
+ }
472
+
473
+ else{
474
+
475
+ print'/合計:';
476
+
477
+ print$total1a;
478
+
479
+ print'円<br />';
480
+
481
+ }
482
+
483
+ print'交通費:';
484
+
485
+ print$totala;
486
+
487
+ print'円<br />';
488
+
489
+ if($syu1=='0'){
490
+
491
+ print'';
492
+
493
+ }
494
+
495
+ else{
496
+
497
+ print'宿泊など:';
498
+
499
+ print$syu1;
500
+
501
+ }
502
+
503
+ if($pri1b==''){
504
+
427
505
  print'';
428
506
 
429
507
  }
430
508
 
431
509
  else{
432
510
 
433
- print'交通機関:';
511
+ print'/単価:';
434
-
512
+
435
- print$tra1;
513
+ print$pri1b;
436
-
514
+
437
- }
515
+ }
438
-
516
+
439
- if($pri1a==''){
517
+ if($qua1b=='0'){
440
-
518
+
441
- print'';
519
+ print'';
442
-
520
+
443
- }
521
+ }
444
-
522
+
445
- else{
523
+ else{
446
-
524
+
447
- print'/単価:';
525
+ print'/数量:';
448
-
526
+
449
- print$pri1a;
527
+ print$qua1b;
450
-
528
+
451
- }
529
+ }
452
-
530
+
453
- if($div1=='0'){
531
+ if($total1b==''){
454
-
532
+
455
- print'';
533
+ print'<br />';
456
-
534
+
457
- }
535
+ }
458
-
536
+
459
- else{
537
+ else{
460
-
538
+
461
- print'/区間:';
539
+ print'/合計:';
462
-
540
+
463
- print$div1;
541
+ print$total1b;
542
+
464
-
543
+ print'円<br />';
544
+
465
- }
545
+ }
466
-
546
+
467
- if($total1a==''){
547
+ if($total5b==''){
468
-
548
+
469
- print'<br />';
549
+ print'<br />';
470
-
550
+
471
- }
551
+ }
472
-
552
+
473
- else{
553
+ else{
474
-
554
+
475
- print'/合計:';
555
+ print'/合計:';
476
-
556
+
477
- print$total1a;
557
+ print$total5b;
558
+
559
+ print'円<br />';
560
+
561
+ }
562
+
563
+ print'宿泊・飲食費:';
564
+
565
+ print$totalb;
478
566
 
479
567
  print'円<br />';
480
568
 
569
+ if($oth1==''){
570
+
571
+ print'';
572
+
481
- }
573
+ }
574
+
482
-
575
+ else{
576
+
577
+ print'名称:';
578
+
579
+ print$oth1;
580
+
581
+ }
582
+
583
+ if($pri1c==''){
584
+
585
+ print'';
586
+
587
+ }
588
+
589
+ else{
590
+
591
+ print'/単価:';
592
+
593
+ print$pri1c;
594
+
595
+ }
596
+
597
+ if($qua1c=='0'){
598
+
599
+ print'';
600
+
601
+ }
602
+
603
+ else{
604
+
605
+ print'/数量:';
606
+
607
+ print$qua1c;
608
+
609
+ }
610
+
611
+ if($total1c==''){
612
+
613
+ print'<br />';
614
+
615
+ }
616
+
617
+ else{
618
+
619
+ print'/合計:';
620
+
621
+ print$total1c;
622
+
623
+ print'円<br />';
624
+
625
+ }
626
+
483
- print'交通費:';
627
+ print'その他:';
484
-
628
+
485
- print$totala;
629
+ print$totalc;
486
630
 
487
631
  print'円<br />';
488
632
 
489
- if($syu1=='0'){
490
-
491
- print'';
492
-
493
- }
494
-
495
- else{
496
-
497
- print'宿泊など:';
633
+ print'総合計:';
498
-
499
- print$syu1;
634
+
500
-
501
- }
502
-
503
- if($pri1b==''){
504
-
505
- print'';
506
-
507
- }
508
-
509
- else{
510
-
511
- print'/単価:';
512
-
513
- print$pri1b;
514
-
515
- }
516
-
517
- if($qua1b=='0'){
518
-
519
- print'';
520
-
521
- }
522
-
523
- else{
524
-
525
- print'/数量:';
526
-
527
- print$qua1b;
528
-
529
- }
530
-
531
- if($total1b==''){
532
-
533
- print'<br />';
534
-
535
- }
536
-
537
- else{
538
-
539
- print'/合計:';
540
-
541
- print$total1b;
635
+ print$total;
542
636
 
543
637
  print'円<br />';
544
638
 
545
- }
546
-
547
- if($total5b==''){
548
-
549
- print'<br />';
550
-
551
- }
552
-
553
- else{
554
-
555
- print'/合計:';
556
-
557
- print$total5b;
558
-
559
- print'円<br />';
560
-
561
- }
562
-
563
- print'宿泊・飲食費:';
564
-
565
- print$totalb;
566
-
567
- print'円<br />';
568
-
569
- if($oth1==''){
570
-
571
- print'';
572
-
573
- }
574
-
575
- else{
576
-
577
- print'名称:';
578
-
579
- print$oth1;
580
-
581
- }
582
-
583
- if($pri1c==''){
584
-
585
- print'';
586
-
587
- }
588
-
589
- else{
590
-
591
- print'/単価:';
592
-
593
- print$pri1c;
594
-
595
- }
596
-
597
- if($qua1c=='0'){
598
-
599
- print'';
600
-
601
- }
602
-
603
- else{
604
-
605
- print'/数量:';
606
-
607
- print$qua1c;
608
-
609
- }
610
-
611
- if($total1c==''){
612
-
613
- print'<br />';
614
-
615
- }
616
-
617
- else{
618
-
619
- print'/合計:';
620
-
621
- print$total1c;
622
-
623
- print'円<br />';
624
-
625
- }
626
-
627
- print'その他:';
628
-
629
- print$totalc;
630
-
631
- print'円<br />';
632
-
633
- print'総合計:';
634
-
635
- print$total;
636
-
637
- print'円<br />';
638
-
639
639
  print'<input type="button" onclick="history.back()" value="戻る">';
640
640
 
641
641
  ?>