index.blade.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {{-- resources/views/components/testimoni/index.blade.php --}}
  2. @php
  3. use App\Helpers\VerbaleHelper;
  4. $hasValidWitnesses = isset($data['testi_oculari']) &&
  5. count($data['testi_oculari']) > 0 &&
  6. collect($data['testi_oculari'])->some(fn($teste) => $teste->testi_oculari > 0);
  7. @endphp
  8. @if ($hasValidWitnesses)
  9. <style>
  10. .striped-table {
  11. width: 100%;
  12. border-collapse: collapse;
  13. }
  14. .striped-table th, .striped-table td {
  15. border: 1px solid #000;
  16. padding: 8px;
  17. }
  18. .striped-table tr:nth-child(even) {
  19. background-color: #f2f2f2;
  20. }
  21. .striped-table tr:nth-child(odd) {
  22. background-color: #fff;
  23. }
  24. </style>
  25. <table width="100%">
  26. <tr>
  27. <td width="100%" valign="top" align="center">
  28. <h2>TESTE OCULARI</h2>
  29. </td>
  30. </tr>
  31. </table>
  32. @foreach ($data['testi_oculari'] as $i => $teste)
  33. @if ($teste->testi_oculari > 0)
  34. <table class="table-content striped-table" width="100%">
  35. <tr>
  36. <td width="20%" align="center" style="font-size: 20px;">
  37. <table>
  38. <tr class="tr-sub-title">
  39. <td class="bold" style="border: none!important">TESTE</td>
  40. </tr>
  41. </table>
  42. </td>
  43. <td width="80%">
  44. <table class="striped-table">
  45. <tr>
  46. <td width="40%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">COGNOME E NOME:</td>
  47. <td width="60%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
  48. {{ @$teste->teste->lastname }} {{ @$teste->teste->firstname }}
  49. </td>
  50. </tr>
  51. @if ($teste->teste->birth_date != '')
  52. <tr>
  53. <td width="25%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">NATO A:</td>
  54. <td width="25%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
  55. {{ @$teste->teste->birth_town_id_value->title }}
  56. </td>
  57. <td width="25%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">NATO IL:</td>
  58. <td width="25%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
  59. {{ (!empty(@$teste->teste->birth_date) && Carbon\Carbon::parse(@$teste->teste->birth_date)->year > 0) ? Carbon\Carbon::parse(@$teste->teste->birth_date)->format('d/m/Y') : '-' }}
  60. </td>
  61. </tr>
  62. @endif
  63. @if ($teste->stato_testi_oculari != '')
  64. <tr>
  65. <td width="30%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">STATO TESTE:</td>
  66. <td width="70%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
  67. {{ VerbaleHelper::getStatusText($teste->stato_testi_oculari,VerbaleHelper::getWitnessStatusMap()) }}
  68. </td>
  69. </tr>
  70. @endif
  71. </table>
  72. </td>
  73. </tr>
  74. </table>
  75. @endif
  76. @endforeach
  77. @endif