質問編集履歴

2

code編集

2021/06/01 01:44

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -28,8 +28,6 @@
28
28
 
29
29
 
30
30
 
31
- ![イメージ説明](87022634e996c4ee41ac7e631afe7613.png)
32
-
33
31
 
34
32
 
35
33
  ### 発生している問題・エラーメッセージ
@@ -48,363 +46,7 @@
48
46
 
49
47
 
50
48
 
51
- ```php
52
-
53
- <!DOCTYPE html>
54
-
55
- <html class=center lang="ja">
56
-
57
- <head>
58
-
59
- <meta charset="UTF-8">
60
-
61
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
62
-
63
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
64
-
65
- <link rel="stylesheet" href='http://ojt.local/wp-content/themes/jang-child/style.css' type='text/css' media='all'/>
66
-
67
- <title>A</title>
68
-
69
- </head>
70
-
71
- <body>
72
-
73
- <div class="container" align="center">
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
- <?php
86
-
87
-
88
-
89
- global $wpdb;
90
-
91
-
92
-
93
- $result = $wpdb->get_results('select * from wp_m_cookai');
94
-
95
-
96
-
97
- //配列
98
-
99
- $id_array = [];//一度配列に入れる
100
-
101
- $sta_array = [];
102
-
103
- $dat_array = [];
104
-
105
- $num_array = [];
106
-
107
-
108
-
109
- $res;
110
-
111
- foreach($result as $row){
112
-
113
- $res = $row->m_id;
114
-
115
- $id_array[] = $res;
116
-
117
-
118
-
119
- $res = $row->m_sta;
120
-
121
- $sta_array[] = $res;
122
-
123
-
124
-
125
- $res = $row->m_dat;
126
-
127
- $dat_array[] = $res;
128
-
129
-
130
-
131
- $res = $row->m_num;
132
-
133
- $num_array[] = $res;
134
-
135
-
136
-
137
- };
138
-
139
-
140
-
141
- //jsコード文字列変換
142
-
143
-
144
-
145
- $m_id_array = json_encode($id_array);
146
-
147
- $m_sta_array = json_encode($sta_array);
148
-
149
- $m_dat_array = json_encode($dat_array);
150
-
151
- $m_num_array = json_encode($num_array);
152
-
153
-
154
-
155
- ?>
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
- <table class="border" border="1">
168
-
169
-
170
-
171
- <script>
172
-
173
-
174
-
175
- // var now_date = new Date();
176
-
177
- // function today(date){
178
-
179
-
180
-
181
- // var year = date.getFullYear() + '/';
182
-
183
- // var mon = date.getMonth()+1 + '/';
184
-
185
- // var dat = date.getDate();
186
-
187
-
188
-
189
- // document.write(year + mon + dat);
190
-
191
- // };
192
-
193
-
194
-
195
-
196
-
197
- let id_array = <?php echo $m_id_array; ?> //php配列js移動
198
-
199
-
200
-
201
- let sta_array = <?php echo $m_sta_array; ?>
202
-
203
-
204
-
205
- let dat_array = <?php echo $m_dat_array; ?>
206
-
207
-
208
-
209
- let num_array = <?php echo $m_num_array; ?>
210
-
211
-
212
-
213
- // document.write(id_array);
214
-
215
- // document.write(sta_array);
216
-
217
- //document.write(dat_array);
218
-
219
- // document.write(num_array);
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
- //日付の行
230
-
231
- document.write('<tr>');
232
-
233
- //何もないところ空白
234
-
235
- document.write('<th>ステ</th>');
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
- // var array = ['A','B','C','D'];
244
-
245
- // console.log(array);
246
-
247
- var now_date = new Date();
248
-
249
- var week = [];
250
-
251
-
252
-
253
- //document.write(now_date.getDate());
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
- now_date.setDate(now_date.getDate() + 7); //左からの埋めてる
262
-
263
-
264
-
265
- //日付の行ルーフ
266
-
267
- for(i=0; i<7; i++){
268
-
269
- //日付表示
270
-
271
- now_date.setDate(now_date.getDate() - 1); //1日増やす
272
-
273
-
274
-
275
- var year = now_date.getFullYear();
276
-
277
- var mon = now_date.getMonth()+1;
278
-
279
- var dat = now_date.getDate();
280
-
281
-
282
-
283
- var daytotal = year + '-' + mon + '-' + dat
284
-
285
-
286
-
287
-
288
-
289
- document.write('<th>' + daytotal + '</th>');
290
-
291
-
292
-
293
-
294
-
295
- }
296
-
297
-
298
-
299
- //日付終わり
300
-
301
- document.write('</tr>');
302
-
303
-   //商品名
304
-
305
- document.write('<tr>');
306
-
307
-
308
-
309
-
310
-
311
-
312
-
313
- now_date.setDate(now_date.getDate() + 7); //左からの埋めてる
314
-
315
-
316
-
317
- for(y=0; y<id_array.length; y++){
318
-
319
-
320
-
321
- document.write('<th>' + id_array[y] + '</th>');
322
-
323
-
324
-
325
- now_date.setDate(now_date.getDate() - 1); //1日増やす
326
-
327
-
328
-
329
- var year = now_date.getFullYear();
330
-
331
- var mon = now_date.getMonth()+1;
332
-
333
- var dat = now_date.getDate();
334
-
335
-
336
-
337
- var daytotal = year + '-' + mon + '-' + dat
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
- for(n=0; n <7; n++){
346
-
347
-
348
-
349
- // document.write(daytotal);
350
-
351
-
352
-
353
- // now_date.setDate(now_date.getDate() - 1); //1日増やす
354
-
355
-
356
-
357
- // document.write('<td>' + sta_array[n] + '</td>');
358
-
359
-
360
-
361
- if(daytotal == dat_array[n]){
362
-
363
-
364
-
365
- document.write('<td>' + sta_array[y] + '</td>');
366
-
367
-
368
-
369
- now_date.setDate(now_date.getDate() - 1);
370
-
371
-
372
-
373
- }
374
-
375
-
376
-
377
- document.write('<td>',"指定セル",'</td>');
378
-
379
-
380
-
381
- }
382
-
383
- document.write('</tr>');
384
-
385
- }
386
-
387
-
388
-
389
-
390
-
391
-
392
-
393
- </script>
394
-
395
-
396
-
397
-
398
-
399
- </table>
400
-
401
- </div>
402
-
403
- </body>
404
-
405
- </html>
406
-
407
- ```
49
+ ``
408
50
 
409
51
 
410
52
 

1

編集

2021/06/01 01:44

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -64,7 +64,7 @@
64
64
 
65
65
  <link rel="stylesheet" href='http://ojt.local/wp-content/themes/jang-child/style.css' type='text/css' media='all'/>
66
66
 
67
- <title>ステータスボード</title>
67
+ <title>A</title>
68
68
 
69
69
  </head>
70
70
 
@@ -78,7 +78,7 @@
78
78
 
79
79
 
80
80
 
81
- <h1>cookai</h1>
81
+
82
82
 
83
83
 
84
84
 
@@ -232,13 +232,13 @@
232
232
 
233
233
  //何もないところ空白
234
234
 
235
- document.write('<th>ステータス</th>');
235
+ document.write('<th>ステ</th>');
236
-
237
-
238
-
239
-
240
-
241
- // var array = ['m_bbs','m_cal','m_work','m_bulid'];
236
+
237
+
238
+
239
+
240
+
241
+
242
242
 
243
243
  // var array = ['A','B','C','D'];
244
244