reminders.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <div class="col card--ui" id="card--dashboard" >
  2. <header id="title--section" style="display:none !important" 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">Scadenze</h2>
  6. </div>
  7. </header>
  8. <div class="showFilter" style="display:none" wire:ignore.self>
  9. <hr size="1">
  10. <div class="row g-3">
  11. <div class="col-md-2">
  12. <div class="row">
  13. <div class="col-md-12" style="margin-bottom:10px;">
  14. <b>Periodo scadenza</b>
  15. </div>
  16. <div class="col-12 mb-2">
  17. <input id="dateFrom" type="date" class="form-control filterFrom" >
  18. </div>
  19. <div class="col-12">
  20. <input id="dateTo" type="date" class="form-control filterTo" >
  21. </div>
  22. <div class="col-6 mt-2">
  23. <button class="btn--ui lightGrey todayButton" style="width:100%" onclick="setToday('{{date("Y-m-d")}}')">OGGI</button>
  24. </div>
  25. <div class="col-6 mt-2">
  26. <button class="btn--ui lightGrey yesterdayButton" style="width:100%" onclick="setYesterday('{{date("Y-m-d",strtotime("-1 days"))}}')">IERI</button>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="col-md-2">
  31. <div class="row">
  32. <div class="col-md-12" style="margin-bottom:10px;">
  33. <b>Tipologia</b>
  34. </div>
  35. <div class="col-12">
  36. <select class="form-select filterType" wire:model="filterType" onchange="destroyDataTable()" multiple="multiple">
  37. <option value="C">Certificato
  38. @foreach(getCards() as $card)
  39. <option value="{{$card->id}}">{{$card->name}}
  40. @endforeach
  41. </select>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="row g-3">
  47. <div class="col-md-12" style="text-align:right">
  48. <button class="btn--ui lightGrey" wire:click.prevent="disableSearch()" onclick="destroyDataTable()">Reset</button>
  49. <button class="btn--ui" wire:click.prevent="search()" onclick="destroyDataTable()">FILTRA</button>
  50. </div>
  51. </div>
  52. <hr size="1">
  53. </div>
  54. <section id="resume-table">
  55. <div class="compare--chart_wrapper d-none"></div>
  56. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
  57. <thead>
  58. <tr>
  59. <th scope="col" >Tipologia</th>
  60. <th scope="col" >Data</th>
  61. <th scope="col" >Cognome</th>
  62. <th scope="col" >Nome</th>
  63. </tr>
  64. </thead>
  65. <tbody id="checkall-target">
  66. @foreach($records as $record)
  67. <tr>
  68. <td>{{$record["type"]}}</td>
  69. <td>{{date("d/m/Y", strtotime($record["date"]))}}</td>
  70. <td>{{$record["last_name"]}}</td>
  71. <td>{{$record["first_name"]}}</td>
  72. </tr>
  73. @endforeach
  74. </tbody>
  75. </table>
  76. <!--
  77. <div class="paginator d-flex justify-content-center">
  78. <nav aria-label="Page navigation example">
  79. <ul class="pagination">
  80. <li class="page-item">
  81. <a class="page-link" href="#" aria-label="Previous">
  82. <span aria-hidden="true"></span>
  83. </a>
  84. </li>
  85. <li class="page-item"><a class="page-link" href="#">1</a></li>
  86. <li class="page-item"><a class="page-link" href="#">2</a></li>
  87. <li class="page-item"><a class="page-link" href="#">3</a></li>
  88. <li class="page-item"><a class="page-link" href="#">3</a></li>
  89. <li class="page-item"><span class="more-page">...</span></li>
  90. <li class="page-item">
  91. <a class="page-link" href="#" aria-label="Next">
  92. <span aria-hidden="true"></span>
  93. </a>
  94. </li>
  95. </ul>
  96. </nav>
  97. </div>
  98. -->
  99. </section>
  100. </div>
  101. @push('scripts')
  102. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  103. <style>
  104. .select2-container--default .select2-selection--single{
  105. background-color: #E9F0F5;
  106. border: 0.0625rem solid #DFE5EB;
  107. font-size: 0.75rem;
  108. }
  109. .select2-selection
  110. {
  111. height: 38px !important;
  112. }
  113. .select2-selection__rendered
  114. {
  115. padding-top:3px;
  116. }
  117. .select2 {
  118. width:100% !important;
  119. }
  120. </style>
  121. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  122. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  123. @endpush
  124. @push('scripts')
  125. <link href="/css/datatables.css" rel="stylesheet" />
  126. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  127. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  128. <style>
  129. .select2-container--default .select2-selection--single{
  130. background-color: #E9F0F5;
  131. border: 0.0625rem solid #DFE5EB;
  132. font-size: 0.75rem;
  133. }
  134. .select2-selection
  135. {
  136. height: 38px !important;
  137. }
  138. .select2-selection__rendered
  139. {
  140. padding-top:3px;
  141. }
  142. .select2 {
  143. width:100% !important;
  144. }
  145. .select2-selection--multiple{
  146. overflow: hidden !important;
  147. height: auto !important;
  148. }
  149. .select2-container {
  150. box-sizing: border-box;
  151. display: inline-block;
  152. margin: 0;
  153. position: relative;
  154. vertical-align: middle;
  155. }
  156. .select2-container .select2-selection--single {
  157. box-sizing: border-box;
  158. cursor: pointer;
  159. display: block;
  160. height: 38px;
  161. user-select: none;
  162. -webkit-user-select: none;
  163. }
  164. .select2-container .select2-selection--single .select2-selection__rendered {
  165. display: block;
  166. padding-left: 8px;
  167. padding-right: 20px;
  168. overflow: hidden;
  169. text-overflow: ellipsis;
  170. white-space: nowrap;
  171. }
  172. .select2-selection__choice__display{
  173. color:#000000 !important;
  174. }
  175. </style>
  176. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  177. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  178. <script src="/assets/js/datatables.js"></script>
  179. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  180. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  181. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  182. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  183. @endpush
  184. @push('scripts')
  185. <script>
  186. $(document).ready(function() {
  187. loadDataTable();
  188. } );
  189. $('.filterType').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  190. $('.filterType').on('change', function (e) {
  191. var data = $('.filterType').select2("val");
  192. if (data == null) data = [];
  193. @this.set('filterType', data);
  194. //@this.search();
  195. });
  196. Livewire.on('load-data-table', () => {
  197. $('.filterType').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  198. setTimeout(function() {loadDataTable()}, 100);
  199. });
  200. Livewire.on('destroy-data-table', () => {
  201. $('#tablesaw-350').DataTable().destroy();
  202. });
  203. function destroyDataTable()
  204. {
  205. $('#tablesaw-350').DataTable().destroy();
  206. }
  207. var isFilter = false;
  208. $(document).ready(function() {
  209. $(document).on("click",".showHideFilter",function() {
  210. if (isFilter)
  211. {
  212. isFilter = false;
  213. $(".showFilter").hide();
  214. }
  215. else
  216. {
  217. isFilter = true;
  218. $(".showFilter").show();
  219. }
  220. });
  221. } );
  222. function loadDataTable(){
  223. let date = new Date();
  224. let date_export = `${date.getFullYear()}${date.getMonth()}${date.getDate()}_`;
  225. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  226. $('#tablesaw-350').DataTable().destroy();
  227. }
  228. $('#tablesaw-350').DataTable({
  229. processing: true,
  230. thead: {
  231. 'th': {'background-color': 'blue'}
  232. },
  233. layout: {
  234. topStart : null,
  235. topEnd : null,
  236. top1A: {
  237. // buttons: [
  238. // {
  239. // extend: 'collection',
  240. // text: 'ESPORTA',
  241. buttons: [
  242. {
  243. extend: 'excelHtml5',
  244. text: '<i class="fa-solid fa-file-excel"></i>',
  245. action: newexportaction,
  246. title: date_export + 'Scadenze',
  247. exportOptions: {
  248. columns: ":not(':last')"
  249. }
  250. },
  251. {
  252. extend: 'pdfHtml5',
  253. text: '<i class="fa-solid fa-file-pdf"></i>',
  254. action: newexportaction,
  255. title: date_export + 'Scadenze',
  256. exportOptions: {
  257. columns: ":not(':last')"
  258. }
  259. },
  260. {
  261. extend: 'print',
  262. action: newexportaction,
  263. text: '<i class="fa-solid fa-print"></i>',
  264. title: date_export + 'Scadenze',
  265. exportOptions: {
  266. columns: ":not(':last')"
  267. }
  268. }
  269. ],
  270. // dropup: true
  271. // }
  272. // ]
  273. },
  274. top1B : {
  275. pageLength: {
  276. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  277. }
  278. },
  279. top1C :'search',
  280. bottomEnd: {
  281. paging: {
  282. boundaryNumbers: false
  283. }
  284. }
  285. },
  286. pagingType: 'first_last_numbers',
  287. language: {
  288. "url": "/assets/js/Italian.json",
  289. paginate: {
  290. first: '<i class="fa-solid fa-angles-left"></i>',
  291. last: '<i class="fa-solid fa-angles-right"></i>',
  292. }
  293. },
  294. "fnInitComplete": function (oSettings, json) {
  295. var html = '&nbsp;<a href="#" class="showHideFilter btn--ui"><i class="fa-solid fa-sliders"></i></a>';
  296. $(".dt-search").append(html);
  297. }
  298. });
  299. $('#tablesaw-350 thead tr th').addClass('col');
  300. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  301. $('#tablesaw-350').on('draw.dt', function() {
  302. $('[data-bs-toggle="popover"]').popover()
  303. });
  304. }
  305. </script>
  306. @endpush