table.blade.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <div class="table-responsive">
  2. <table class="table table-sm table-hover table-striped table-bordered mb-0">
  3. <thead class="fw-bold text-secondary bg-light">
  4. <tr>
  5. <th>Created At</th>
  6. <th>User ID</th>
  7. <th>Lab</th>
  8. <th>Tests</th>
  9. </tr>
  10. </thead>
  11. <tbody>
  12. @foreach ($records as $record)
  13. <?php
  14. $detailJson = (array) $record->detailJson(true);
  15. if(isset($detailJson['lab']) && isset($detailJson['lab']['hrs_of_operation'])){
  16. unset($detailJson['lab']['hrs_of_operation']);
  17. }
  18. $lab = (array) @$detailJson['lab'];
  19. $tests = (array) @$detailJson['tests'];
  20. ?>
  21. <tr>
  22. <td>{{ friendly_date($record->created_at ?? $record->updated_at) }}</td>
  23. <td>
  24. @if($record->user())
  25. <?php $user = $record->user(); ?>
  26. <a href="{{ route('admin.users.view.dashboard', $user) }}">{{ $user->displayName() }}</a>
  27. <div class="d-flex" style="gap:16px;">
  28. <span>Sex: <b>{{ $user->getDetailJsonValue('sex') }}</b></span>
  29. <span>E: <b>{{ $user->getEmail() }}</b></span>
  30. <span>DOB: <b>{{ friendly_date($user->getDetailJsonValue('dob')) }}</b></span>
  31. <span>P: <b>{{ $user->getDetailJsonValue('phoneNumber') }}</b></span>
  32. </div>
  33. @else
  34. ---
  35. @endif
  36. </td>
  37. <td><?= labAddress($lab) ?></td>
  38. <td>
  39. @foreach($tests as $key =>$amount)
  40. <span><b>{{ getTestLabelByKey($key) }}</b> - ${{ $amount }}</span>
  41. @endforeach
  42. </td>
  43. </tr>
  44. @endforeach
  45. </tbody>
  46. </table>
  47. </div>