質問編集履歴

3

input にname="staff"を追記しました

2022/09/22 07:03

投稿

emi_ono
emi_ono

スコア83

test CHANGED
File without changes
test CHANGED
@@ -41,7 +41,7 @@
41
41
  <?php foreach($files as $file):?>
42
42
  <ul class="radio-select">
43
43
  <li>
44
- <input type="radio" id="radio-01" value="<?php echo $file['image_id']?>">
44
+ <input type="radio" id="radio-01" value="<?php echo $file['image_id']?>" name="staff">
45
45
  <label for="radio-01"><?php echo $file['staff_name'];?></label>
46
46
  </li>
47
47
  </ul>

2

誤字

2022/09/22 06:55

投稿

emi_ono
emi_ono

スコア83

test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
 
26
26
  ### 該当のソースコード
27
- 全体(DB接続など削除しています
27
+ 全体(一部抜粋
28
28
  ```PHP
29
29
  <?php
30
30
  $files = getAllFile( $shop_id );

1

全体のコードを追加しました

2022/09/22 06:54

投稿

emi_ono
emi_ono

スコア83

test CHANGED
File without changes
test CHANGED
@@ -24,8 +24,20 @@
24
24
 
25
25
 
26
26
  ### 該当のソースコード
27
-
27
+ 全体(DB接続など削除しています)
28
28
  ```PHP
29
+ <?php
30
+ $files = getAllFile( $shop_id );
31
+ ?>
32
+ <main>
33
+ <form method="POST" action="../common/3.0.1/check.php">
34
+ <!-- ↓↓スタッフ選択↓↓ -->
35
+ <section class="area staff cf">
36
+ <div class="title">
37
+ <h3><span>Step1</span>スタッフを選ぶ</h3>
38
+ </div>
39
+ <div class="contentWrap">
40
+ <div class="staffitem">
29
41
  <?php foreach($files as $file):?>
30
42
  <ul class="radio-select">
31
43
  <li>
@@ -34,7 +46,265 @@
34
46
  </li>
35
47
  </ul>
36
48
  <?php endforeach;?>
49
+ </div>
50
+ </div>
51
+ </section>
52
+ <!-- ↑↑スタッフ選択↑↑ -->
53
+ <!-- ↓↓料金選択↓↓ -->
54
+ <section class="area rate-plan cf">
55
+ <div class="title">
56
+ <h3><span>Step2</span>料金を選ぶ</h3>
57
+ </div>
58
+ <div class="contentWrap">
59
+ <table>
60
+ <tbody>
61
+ <!--料金<tr>開始-->
62
+ <?php
63
+ for ( $i = 0; $i < count( $arry ); $i++ ) {
64
+ $menuName = $arry[ $i ][ 'menuName' ];
65
+ $menuUrl = $arry[ $i ][ 'menuUrl' ];
66
+ ?>
67
+ <tr>
68
+ <th scope="row" class="cf"><img src="../../img/photo/common<?php echo $menuUrl; ?>" alt=""/><?php echo $menuName; ?></th>
69
+ <?php
70
+ for ( $j = 0; $j < count( $arry[ $i ][ 'menuContents' ] ); $j++ ) {
71
+ $send = $arry[ $i ][ 'menuContents' ][ $j ][ 'send' ];
72
+ $id = $arry[ $i ][ 'menuContents' ][ $j ][ 'ID' ];
73
+ $text = $arry[ $i ][ 'menuContents' ][ $j ][ 'text' ];
74
+ $time = $arry[ $i ][ 'menuContents' ][ $j ][ 'time' ];
75
+ ?>
76
+ <td><input type="radio" name="menu" value="<?php echo $send; ?>" id="radio<?php echo $id;?>" class="<?php echo $time; ?>" <?php if (isset($menu) && $menu == "$send") echo "checked";?>/>
77
+ <label for="radio<?php echo $id;?>" class="radio"><?php echo $text; ?></label></td>
78
+ <?php }?>
79
+ </tr>
80
+ <?php }?>
81
+ <!--料金<tr>終了-->
82
+ </tbody>
83
+ </table>
84
+ <p class="note"><?php echo $menuNote; ?></p>
85
+ </div>
86
+ </section>
87
+ <!-- ↑↑料金選択↑↑ -->
88
+ <!-- ↓↓日時選択↓↓-->
89
+ <section class="area dayTime cf">
90
+ <div class="title">
91
+ <h3><span>Step3</span>日時を選ぶ</h3>
92
+ </div>
93
+ <div class="contentWrap">
94
+ <div class="dayForm">
95
+ <table>
96
+ <th class="no">時間</th>
97
+ <th> <?php echo $todayFmt1; ?>(<?php echo $week[ $todayWeek ];?>)<br>
98
+ <?php
99
+ if ( in_array( $week[ $todayWeek ], $closed ) ) {
100
+ echo "<span>定休日</span>";
101
+ } elseif ( in_array( $today, $closedDay ) ) {
102
+ echo "<span>休業日</span>";
103
+ } else {
104
+ echo "&nbsp;";
105
+ }
106
+ ?></th>
107
+ <th> <?php echo $tomorrowFmt1; ?>(<?php echo $week[ $tomorrowWeek ];?>)<br>
108
+ <?php
109
+ if ( in_array( $week[ $tomorrowWeek ], $closed ) ) {
110
+ echo "<span>定休日</span>";
111
+ } elseif ( in_array( $tomorrow, $closedDay ) ) {
112
+ echo "<span>休業日</span>";
113
+ } else {
114
+ echo "&nbsp;";
115
+ }
116
+ ?></th>
117
+ <th> <?php echo $inTwoDaysFmt1; ?>(<?php echo $week[ $inTwoDaysWeek ];?>)<br>
118
+ <?php
119
+ if ( in_array( $week[ $inTwoDaysWeek ], $closed ) ) {
120
+ echo "<span>【定休日】</span>";
121
+ } elseif ( in_array( $inTwoDays, $closedDay ) ) {
122
+ echo "<span>休業日</span>";
123
+ } else {
124
+ echo "&nbsp;";
125
+ }
126
+ ?></th>
127
+ <?php
128
+ foreach ( $daterange as $date ) {
129
+ $time = $date->format( "H:i:s" );
130
+ $timeMin = $date->format( "H:i" );
131
+ //日時(今日)
132
+ $variable = $today . ' ' . $time;
133
+ $endTime = date( "H:i:s", strtotime( $time . "+15 minute" ) );
134
+ $variableEnd = $today . ' ' . $endTime;
135
+ //echo "今日".$variable."/".$endTime."/".$variableEnd;
136
+ //日時(明日)
137
+ $variable2 = $tomorrow . ' ' . $time;
138
+ $endTime2 = date( "H:i:s", strtotime( $time . "+15 minute" ) );
139
+ $variableEnd2 = $tomorrow . ' ' . $endTime2;
140
+ //echo "明日".$variable2."/".$endTime2."/".$variableEnd2;
141
+ //日時(明後日)
142
+ $variable3 = $inTwoDays . ' ' . $time;
143
+ $endTime3 = date( "H:i:s", strtotime( $time . "+15 minute" ) );
144
+ $variableEnd3 = $inTwoDays . ' ' . $endTime3;
145
+ //echo "明後日".$variable3."/".$endTime3."/".$variableEnd3;
146
+ ?>
147
+ <tr class='day_table'>
148
+ <td class="time"><?php echo $timeMin; ?></td>
149
+ <!--今日-->
150
+ <td><input type='radio' name='day' id='<?php echo $variable; ?>' value='<?php echo $variable; ?>'
151
+ <?php
152
+ //データーベースから呼び出す
153
+ $sql = "SELECT
154
+ count(*)
155
+ FROM
156
+ customer3
157
+ WHERE
158
+ shop_id = ".$shop_id."
159
+ AND
160
+ reserve_day = '".$today."'
161
+ AND (start_time < '".$variableEnd."' AND end_time >= '".$variable."')";
162
+
163
+ $stmt = $dbh->query($sql);
164
+ $num = $stmt->fetchColumn();
165
+
166
+ if ( in_array( $week[ $todayWeek ], $closed ) || in_array( $today, $closedDay )) {
167
+ echo 'disabled';
168
+ }elseif ( in_array( $today." ".$timeMin, (array)$breakTime ) ) {
169
+ echo 'disabled';
170
+ }elseif ( strtotime( date( 'H:i' ) ) > strtotime( $time ) ) {
171
+ echo 'disabled';
172
+ }elseif($time <= $HalfAnHour ){
173
+ echo 'disabled';
174
+ }elseif($num >= $reservFrame){
175
+ echo 'disabled class="first-disabled"';
176
+ }
177
+ ?>>
178
+ <label for='<?php echo $variable;?>'>
179
+ <?php
180
+ if ( in_array( $week[ $todayWeek ], $closed ) || in_array( $today, $closedDay ) ) {
181
+ echo "<i class='fas fa-minus'></i>";
182
+ } elseif ( strtotime( date( 'H:i' ) ) > strtotime( $timeMin ) ) {
183
+ echo "<i class='fas fa-minus'></i>";
184
+ } elseif ( in_array( $today . " " . $timeMin, ( array )$breakTime ) ) {
185
+ echo "<i class='fas fa-minus'></i>";
186
+ } elseif ( $num >= $reservFrame ) {
187
+ /*echo "予約済";*/
188
+ echo "<span class='mark'>×</span>"; //×
189
+ } elseif ( $time <= $HalfAnHour ) {
190
+ echo "TEL";
191
+ } else {
192
+ echo "<span class='result1'></span>";
193
+ /*echo '<span class="mark2">●</span>';*/
194
+ }
195
+ ?>
196
+ </label></td>
197
+ <!--明日-->
198
+ <td><input type='radio' name='day' id='<?php echo $variable2; ?>' value='<?php echo $variable2; ?>'
199
+ <?php
200
+ //データーベースから呼び出す
201
+ $sql = "
202
+ SELECT
203
+ count(*)
204
+ FROM
205
+ customer3
206
+ WHERE
207
+ shop_id = ".$shop_id."
208
+ AND
209
+ reserve_day = '".$tomorrow."'
210
+ AND
211
+ (start_time <'".$variableEnd2."' AND end_time >= '".$variable2."')
212
+ ";
213
+
214
+ $stmt = $dbh->query($sql);
215
+ $num2 = $stmt->fetchColumn();
216
+
217
+ if (in_array( $week[ $tomorrowWeek ], $closed ) || in_array( $tomorrow, $closedDay )) {
218
+ echo 'disabled';
219
+ }elseif($num2 >= $reservFrame){
220
+ echo 'disabled class="first-disabled"';
221
+ }elseif ( in_array( $tomorrow." ".$timeMin, (array)$breakTime ) ) {
222
+ echo 'disabled';
223
+ }
224
+ ?>>
225
+ <label for='<?php echo $variable2;?>'>
226
+ <?php
227
+ if ( in_array( $week[ $tomorrowWeek ], $closed ) || in_array( $tomorrow, $closedDay ) ) {
228
+ echo "<i class='fas fa-minus'></i>";
229
+ } elseif ( $num2 >= $reservFrame ) {
230
+ /*echo "予約済";*/
231
+ echo "<span class='mark'>×</span>"; //×
232
+ } elseif ( in_array( $tomorrow . " " . $timeMin, ( array )$breakTime ) ) {
233
+ echo "<i class='fas fa-minus'></i>";
234
+ } else {
235
+ echo "<span class='result1'></span>";
236
+ /*echo '<span class="mark2">●</span>';*/
237
+ }
238
+ ?>
239
+ </label></td>
240
+ <!--明後日-->
241
+ <td><input type='radio' name='day' id='<?php echo $variable3; ?>' value='<?php echo $variable3; ?>'
242
+ <?php
243
+ //データーベースから呼び出す
244
+ $sql = "
245
+ SELECT
246
+ count(*)
247
+ FROM
248
+ customer3
249
+ WHERE
250
+ shop_id = ".$shop_id."
251
+ AND
252
+ reserve_day = '".$inTwoDays."'
253
+ AND
254
+ (start_time <'".$variableEnd3."' AND end_time >= '".$variable3."')
255
+ ";
256
+
257
+ $stmt = $dbh->query($sql);
258
+ $num3 = $stmt->fetchColumn();
259
+
260
+ if (in_array( $week[ $inTwoDaysWeek ], $closed) || in_array( $inTwoDays, $closedDay)) {
261
+ echo 'disabled';
262
+ }elseif($num3 >= $reservFrame){
263
+ echo 'disabled class="first-disabled"';
264
+ }elseif ( in_array( $inTwoDays." ".$timeMin, (array)$breakTime ) ) {
265
+ echo 'disabled';
266
+ }
267
+ ?>>
268
+ <label for='<?php echo $variable3;?>'>
269
+ <?php
270
+ if ( in_array( $week[ $inTwoDaysWeek ], $closed ) || in_array( $inTwoDays, $closedDay ) ) {
271
+ echo "<i class='fas fa-minus'></i>";
272
+ } elseif ( $num3 >= $reservFrame ) {
273
+ /*echo "予約済";*/
274
+ echo "<span class='mark'>×</span>"; //×
275
+ } elseif ( in_array( $inTwoDays . " " . $timeMin, ( array )$breakTime ) ) {
276
+ echo "<i class='fas fa-minus'></i>";
277
+ } else {
278
+ echo "<span class='result1'></span>";
279
+ /*echo '<span class="mark2">●</span>';*/
280
+ }
281
+ ?>
282
+ </label></td>
283
+ </tr>
284
+ <?php }?>
285
+ </table>
286
+ </div>
287
+ </div>
288
+ </section>
289
+ <!-- ↑↑日時選択↑↑-->
290
+ <!-- ↓↓送信ボタン↓↓-->
291
+ <div class="cp_submit">
292
+ <input type="hidden" name="shop_id" value="<?php echo $shop_id; ?>">
293
+ <input type="hidden" name="shop_name" value="<?php echo $shop_name; ?>">
294
+ <input type="hidden" name="shop_url" value="<?php echo $shop_url; ?>">
295
+ <input type="hidden" name="shop_tel" value="<?php echo $shop_tel; ?>">
296
+ <input type="hidden" name="shop_mail" value="<?php echo $shop_mail; ?>">
297
+ <input type="hidden" name="temporary" value="<?php echo $temporary; ?>">
298
+ <input type="hidden" name="bg" value="<?php echo $bg; ?>">
299
+ <input type="submit" value="確認画面へ" class="submit_a1"/>
300
+ </div>
301
+ <!-- ↑↑送信ボタン↑↑-->
302
+ </form>
303
+
304
+
305
+
37
306
  ```
307
+
38
308
 
39
309
  ### 試したこと
40
310
  最初は