質問編集履歴

1

ソースコードを見やすく編集しました。宜しくお願い致します。

2021/11/15 00:11

投稿

kaung0020
kaung0020

スコア4

test CHANGED
@@ -1 +1 @@
1
- Laravel Viewについてデータベーツテーブルからデータ表示問題
1
+ Laravel データベーツについてデータ表示問題
test CHANGED
@@ -198,188 +198,186 @@
198
198
 
199
199
  }
200
200
 
201
+
202
+
203
+ ``WorkTimeReferenceController.php
204
+
205
+ <?php
206
+
207
+
208
+
209
+ namespace App\Http\Controllers\Work_Time;
210
+
211
+
212
+
213
+ use App\Http\Controllers\Controller;
214
+
215
+ use Illuminate\Support\Facades\DB;
216
+
217
+ use Illuminate\Http\Request;
218
+
219
+ use App\Http\Requests\WorkTimeReferenceRequest;
220
+
221
+ use App\Repositories\Work_Time\WorkTimeReferenceRepository;
222
+
223
+ use App\Models\TR01Work;
224
+
225
+ use App\Models\MT99Msg;
226
+
227
+
228
+
229
+ class WorkTimeReferenceController extends Controller
230
+
231
+ {
232
+
233
+
234
+
235
+ /**
236
+
237
+ * $wtRef_Repositoryリポジトリの実装
238
+
239
+ *
240
+
241
+ * @var WorkTimeReferenceRepository
242
+
243
+ */
244
+
245
+ protected $wtRef_Repository;
246
+
247
+
248
+
249
+ /**
250
+
251
+ * 新しいコントローラインスタンスの生成
252
+
253
+ *
254
+
255
+ * @param WorkTimeReferenceRepository $wtRef_Repository
256
+
257
+ * @return void
258
+
259
+ */
260
+
261
+ public function __construct(WorkTimeReferenceRepository $wtRef_Repository)
262
+
263
+ {
264
+
265
+ $this->wtRef_Repository = $wtRef_Repository;
266
+
267
+ }
268
+
269
+
270
+
271
+ /**
272
+
273
+ * 勤務状況照会(個人用) 処理
274
+
275
+ *
276
+
277
+ * @return view
278
+
279
+ */
280
+
281
+ public function search(WorkTimeReferenceRequest $request)
282
+
283
+ {
284
+
285
+ $empWorkTimeResults = $this->wtRef_Repository->empInput($request);
286
+
287
+ // dd($empWorkTimeResults);
288
+
289
+
290
+
291
+ $errMsg_4029 = $this->wtRef_Repository->messages();
292
+
293
+ //dd($msg_4029);
294
+
295
+
296
+
297
+ $weekday = $this->wtRef_Repository->calHolidayDate();
298
+
299
+ // $nationalClsd = $this->wtRef_Repository->nationalClsday();
300
+
301
+ $officeClsds = $this->wtRef_Repository->officeClsd($request);
302
+
303
+ // $dateColor = $this->wtRef_Repository->officeClsd($request);
304
+
305
+ // dd($officeClsd);
306
+
307
+ return view('work_time.WorkTimeReference', compact('empWorkTimeResults', 'weekday', 'errMsg_4029','officeClsds'));
308
+
309
+ }
310
+
311
+ }
312
+
313
+
314
+
315
+ ``WorkTimeReference.blade.php
316
+
317
+ @foreach ($officeClsds as $officeClsd )
318
+
319
+
320
+
321
+ @foreach ($empWorkTimeResults as $empWorkTimeResult)
322
+
323
+ <tr>
324
+
325
+ @if ($officeClsd->HLD_DATE == $weekday[date('md',strtotime($empWorkTimeResult->CALD_DATE))] ||
326
+
327
+ $weekday[date('w',strtotime($empWorkTimeResult->CALD_DATE))] == '日' ||
328
+
329
+ $weekday[date('w',strtotime($empWorkTimeResult->CALD_DATE))] == '土')
330
+
331
+ <td style="width: 70px;">
332
+
333
+ <span id="lblCaldDate"
334
+
335
+ style="width: 70px; display: inline-block; color: red">
336
+
337
+ {{ date('Y/m/d', strtotime($empWorkTimeResult->CALD_DATE)) }}
338
+
339
+ </span>
340
+
341
+ </td>
342
+
343
+ <td style="width: 30px;">
344
+
345
+ <span id="lblCaldDate"
346
+
347
+ style="width: 30px; display: inline-block; color: red">
348
+
349
+ {{ $weekday[date('w', strtotime($empWorkTimeResult->CALD_DATE))] }}
350
+
351
+ </span>
352
+
353
+ </td>
354
+
355
+ @else
356
+
357
+ <td style="width: 70px;">
358
+
359
+ <span id="lblCaldDate" style="width: 70px; display: inline-block;">
360
+
361
+ {{ date('Y/m/d', strtotime($empWorkTimeResult->CALD_DATE)) }}
362
+
363
+ </span>
364
+
365
+ </td>
366
+
367
+ <td style="width: 30px;">
368
+
369
+ <span id="lblCaldDate" style="width: 30px; display: inline-block;">
370
+
371
+ {{ $weekday[date('w', strtotime($empWorkTimeResult->CALD_DATE))] }}
372
+
373
+ </span>
374
+
375
+ </td>
376
+
377
+ @endif
378
+
201
379
  ```
202
380
 
203
- WorkTimeReferenceController.php
204
-
205
- <?php
206
-
207
-
208
-
209
- namespace App\Http\Controllers\Work_Time;
210
-
211
-
212
-
213
- use App\Http\Controllers\Controller;
214
-
215
- use Illuminate\Support\Facades\DB;
216
-
217
- use Illuminate\Http\Request;
218
-
219
- use App\Http\Requests\WorkTimeReferenceRequest;
220
-
221
- use App\Repositories\Work_Time\WorkTimeReferenceRepository;
222
-
223
- use App\Models\TR01Work;
224
-
225
- use App\Models\MT99Msg;
226
-
227
-
228
-
229
- class WorkTimeReferenceController extends Controller
230
-
231
- {
232
-
233
-
234
-
235
- /**
236
-
237
- * $wtRef_Repositoryリポジトリの実装
238
-
239
- *
240
-
241
- * @var WorkTimeReferenceRepository
242
-
243
- */
244
-
245
- protected $wtRef_Repository;
246
-
247
-
248
-
249
- /**
250
-
251
- * 新しいコントローラインスタンスの生成
252
-
253
- *
254
-
255
- * @param WorkTimeReferenceRepository $wtRef_Repository
256
-
257
- * @return void
258
-
259
- */
260
-
261
- public function __construct(WorkTimeReferenceRepository $wtRef_Repository)
262
-
263
- {
264
-
265
- $this->wtRef_Repository = $wtRef_Repository;
266
-
267
- }
268
-
269
-
270
-
271
- /**
272
-
273
- * 勤務状況照会(個人用) 処理
274
-
275
- *
276
-
277
- * @return view
278
-
279
- */
280
-
281
- public function search(WorkTimeReferenceRequest $request)
282
-
283
- {
284
-
285
- $empWorkTimeResults = $this->wtRef_Repository->empInput($request);
286
-
287
- // dd($empWorkTimeResults);
288
-
289
-
290
-
291
- $errMsg_4029 = $this->wtRef_Repository->messages();
292
-
293
- //dd($msg_4029);
294
-
295
-
296
-
297
- $weekday = $this->wtRef_Repository->calHolidayDate();
298
-
299
- // $nationalClsd = $this->wtRef_Repository->nationalClsday();
300
-
301
- $officeClsds = $this->wtRef_Repository->officeClsd($request);
302
-
303
- // $dateColor = $this->wtRef_Repository->officeClsd($request);
304
-
305
- // dd($officeClsd);
306
-
307
- return view('work_time.WorkTimeReference', compact('empWorkTimeResults', 'weekday', 'errMsg_4029','officeClsds'));
308
-
309
- }
310
-
311
- }
312
-
313
-
314
-
315
- ```
316
-
317
- WorkTimeReference.blade.php
318
-
319
- @foreach ($officeClsds as $officeClsd )
320
-
321
-
322
-
323
- @foreach ($empWorkTimeResults as $empWorkTimeResult)
324
-
325
- <tr>
326
-
327
- @if ($officeClsd->HLD_DATE == $weekday[date('md',strtotime($empWorkTimeResult->CALD_DATE))] ||
328
-
329
- $weekday[date('w',strtotime($empWorkTimeResult->CALD_DATE))] == '日' ||
330
-
331
- $weekday[date('w',strtotime($empWorkTimeResult->CALD_DATE))] == '土')
332
-
333
- <td style="width: 70px;">
334
-
335
- <span id="lblCaldDate"
336
-
337
- style="width: 70px; display: inline-block; color: red">
338
-
339
- {{ date('Y/m/d', strtotime($empWorkTimeResult->CALD_DATE)) }}
340
-
341
- </span>
342
-
343
- </td>
344
-
345
- <td style="width: 30px;">
346
-
347
- <span id="lblCaldDate"
348
-
349
- style="width: 30px; display: inline-block; color: red">
350
-
351
- {{ $weekday[date('w', strtotime($empWorkTimeResult->CALD_DATE))] }}
352
-
353
- </span>
354
-
355
- </td>
356
-
357
- @else
358
-
359
- <td style="width: 70px;">
360
-
361
- <span id="lblCaldDate" style="width: 70px; display: inline-block;">
362
-
363
- {{ date('Y/m/d', strtotime($empWorkTimeResult->CALD_DATE)) }}
364
-
365
- </span>
366
-
367
- </td>
368
-
369
- <td style="width: 30px;">
370
-
371
- <span id="lblCaldDate" style="width: 30px; display: inline-block;">
372
-
373
- {{ $weekday[date('w', strtotime($empWorkTimeResult->CALD_DATE))] }}
374
-
375
- </span>
376
-
377
- </td>
378
-
379
- @endif
380
-
381
- ```
382
-
383
381
 
384
382
 
385
383
  ### 試したこと