index.blade.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. ({{ @$teste->teste->birth_prov_id_value->title }})
  57. </td>
  58. <td width="25%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">NATO IL:</td>
  59. <td width="25%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
  60. {{ (!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') : '-' }}
  61. </td>
  62. </tr>
  63. @endif
  64. @if ($teste->stato_testi_oculari != '')
  65. <tr>
  66. <td width="30%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">STATO TESTE:</td>
  67. <td width="70%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
  68. {{ VerbaleHelper::getStatusText($teste->stato_testi_oculari,VerbaleHelper::getWitnessStatusMap()) }}
  69. </td>
  70. </tr>
  71. @endif
  72. </table>
  73. </td>
  74. </tr>
  75. </table>
  76. @endif
  77. @endforeach
  78. @endif