course_member.blade.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <div class="col card--ui" id="card--dashboard">
  2. <header id="title--section" class="d-flex align-items-center justify-content-between">
  3. <div class="title--section_name d-flex align-items-center justify-content-between">
  4. <i class="ico--ui title_section utenti me-2"></i>
  5. <h2 class="primary">Iscritti ai corsi</h2>
  6. </div>
  7. </header>
  8. <section id="resume-table">
  9. <div class="compare--chart_wrapper d-none"></div>
  10. <table class="table tablesaw tablesaw-stack" id="tablesaw-350">
  11. <thead>
  12. <tr>
  13. <th scope="col">#</th>
  14. <th scope="col">Corso</th>
  15. <th scope="col">Cognome</th>
  16. <th scope="col">Nome</th>
  17. <th scope="col">Età</th>
  18. <th scope="col">Telefono</th>
  19. <th scope="col">Email</th>
  20. </tr>
  21. </thead>
  22. <tbody id="checkall-target">
  23. @foreach($records as $idx => $record)
  24. <tr>
  25. <td>{{$idx +1}}</td>
  26. <td>{{$record->course->name}}</td>
  27. <td>{{$record->member->last_name}}</td>
  28. <td>{{$record->member->first_name}}</td>
  29. <td>{{$record->member->getAge() . " (" . date("Y", strtotime($record->member->birth_date)) . ")"}}</td>
  30. <td>{{$record->member->phone}}</td>
  31. <td>{{$record->member->email}}</td>
  32. </tr>
  33. @endforeach
  34. </tbody>
  35. </table>
  36. </section>
  37. </div>
  38. @push('scripts')
  39. <link href="/css/datatables.css" rel="stylesheet" />
  40. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  41. <script src="/assets/js/datatables.js"></script>
  42. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  43. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  44. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  45. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  46. @endpush
  47. @push('scripts')
  48. <script>
  49. $(document).ready(function() {
  50. loadDataTable();
  51. } );
  52. Livewire.on('load-data-table', () => {
  53. loadDataTable();
  54. });
  55. function loadDataTable(){
  56. $('#tablesaw-350').DataTable({
  57. thead: {
  58. 'th': {'background-color': 'blue'}
  59. },
  60. layout: {
  61. topStart: {
  62. buttons: [
  63. {
  64. extend: 'excelHtml5',
  65. title: 'Iscritti corsi'
  66. },
  67. {
  68. extend: 'pdfHtml5',
  69. title: 'Iscritti corsi'
  70. },
  71. {
  72. extend: 'print',
  73. text: 'Stampa',
  74. title: 'Iscritti corsi'
  75. }
  76. ]
  77. }
  78. },
  79. pagingType: 'numbers',
  80. "language": {
  81. "url": "/assets/js/Italian.json"
  82. }
  83. });
  84. $('#tablesaw-350 thead tr th').addClass('col');
  85. $('#tablesaw-350 thead tr th').css("background-color", "#EDF0F2");
  86. }
  87. </script>
  88. @endpush