course_list.blade.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <div class="col">
  2. <div class="row h-100">
  3. <div class="col card--ui" id="card--dashboard">
  4. <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between">
  5. <div class="title--section_name d-flex align-items-center justify-content-between">
  6. <i class="ico--ui title_section utenti me-2"></i>
  7. <h2 class="primary">Pagamento corsi</h2>
  8. </div>
  9. </header>
  10. <div class="showFilter" style="display:none" wire:ignore.self>
  11. <hr size="1">
  12. <div class="row g-3">
  13. <div class="col-md-2">
  14. <div class="row">
  15. <div class="col-md-12" style="margin-bottom:10px;">
  16. <b>Corso</b>
  17. </div>
  18. <div class="col-12">
  19. <select class="form-select filterMultiple" wire:model="filterCourse" onchange="destroyDataTable()" multiple="multiple">
  20. @foreach($courses as $c)
  21. <option value="{{$c}}">{{$c}}
  22. @endforeach
  23. </select>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="col-md-2">
  28. <div class="row">
  29. <div class="col-md-12" style="margin-bottom:10px;">
  30. <b>Livello</b>
  31. </div>
  32. <div class="col-12">
  33. <select class="form-select filterMultiple" wire:model="filterLevel" onchange="destroyDataTable()" multiple="multiple">
  34. @foreach($course_levels as $c)
  35. <option value="{{$c->id}}">{{$c->name}}
  36. @endforeach
  37. </select>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="col-md-2">
  42. <div class="row">
  43. <div class="col-md-12" style="margin-bottom:10px;">
  44. <b>Frequenza</b>
  45. </div>
  46. <div class="col-12">
  47. <select class="form-select" wire:model="filterFrequency" onchange="destroyDataTable()" multiple="multiple">
  48. @foreach($course_frequencies as $c)
  49. <option value="{{$c->id}}">{{$c->name}}
  50. @endforeach
  51. </select>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="col-md-2">
  56. <div class="row">
  57. <div class="col-md-12" style="margin-bottom:10px;">
  58. <b>Tipologia</b>
  59. </div>
  60. <div class="col-12">
  61. <select class="form-select" wire:model="filterType" onchange="destroyDataTable()" multiple="multiple">
  62. @foreach($course_types as $c)
  63. <option value="{{$c->id}}">{{$c->name}}
  64. @endforeach
  65. </select>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="col-md-2">
  70. <div class="row">
  71. <div class="col-md-12" style="margin-bottom:10px;">
  72. <b>Durata</b>
  73. </div>
  74. <div class="col-12">
  75. <select class="form-select" wire:model="filterDuration" onchange="destroyDataTable()" multiple="multiple">
  76. @foreach($course_durations as $c)
  77. <option value="{{$c->id}}">{{$c->name}}
  78. @endforeach
  79. </select>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="row g-3" style="margin-top:20px;">
  85. <div class="col-md-12" style="text-align:right">
  86. <button class="card--ui card--ui_btnCancel" wire:click.prevent="disableSearch()" onclick="destroyDataTable()">CANCELLA</button>
  87. <button class="card--ui card--ui_btnAddHeaderUser" wire:click.prevent="search()" onclick="destroyDataTable()">FILTRA</button>
  88. </div>
  89. </div>
  90. <hr size="1">
  91. </div>
  92. <section id="resume-table">
  93. <div class="compare--chart_wrapper d-none"></div>
  94. <table class="table tablesaw tablesaw-stack" id="tablesaw-350">
  95. <thead>
  96. <tr>
  97. <th scope="col">Cognome</th>
  98. <th scope="col">Nome</th>
  99. <th scope="col">Iscrizione</th>
  100. @foreach($months as $m)
  101. <th scope="col">&nbsp;&nbsp;&nbsp;&nbsp;{{$m}}</th>
  102. @endforeach
  103. </tr>
  104. </thead>
  105. <tbody id="checkall-target">
  106. @foreach($records as $record)
  107. <tr>
  108. @php
  109. list($id, $first_name, $last_name) = explode("§", $record[0]);
  110. @endphp
  111. <td><a href="/members?member_detail={{$id}}">{{$last_name}}</a></td>
  112. <td><a href="/members?member_detail={{$id}}">{{$first_name}}</a></td>
  113. @php
  114. list($subscribed, $subPrice) = explode("§", $record[15]);
  115. @endphp
  116. <td><a class="{{$subscribed ? 'green' : 'orange'}}" wire:click="newSubscription({{$record[13]}}, {{$id}}, {{$record[14]}})" style="cursor: pointer;width:60px;padding:0px;"><small>{{formatPrice($subPrice)}}</small></a></td>
  117. @for($x=1; $x<=12; $x++)
  118. <td>
  119. @php
  120. list($color, $price) = explode("§", $record[$x]);
  121. @endphp
  122. @if($color == 'orange')
  123. <a class="{{$color}}" wire:click="newPayment({{$record[13]}}, {{$x}}, {{$id}}, {{$record[14]}})" style="cursor: pointer;padding:0px;width:60px;"><small>{{formatPrice($price)}}</small></a>
  124. @else
  125. <a class="{{$color}}" style="padding:0px;width:60px;"><small>{{formatPrice($price)}}</small></a>
  126. @endif
  127. </td>
  128. @endfor
  129. </tr>
  130. @endforeach
  131. </tbody>
  132. </table>
  133. </section>
  134. </div>
  135. @push('scripts')
  136. <style>
  137. a.grey
  138. {
  139. display: flex;
  140. margin-right:10px;
  141. float:left;
  142. height: 2.5rem !important;
  143. width:50px;
  144. align-items: center;
  145. justify-content: center;
  146. color: #006099;
  147. background-color: #d3dce1 !important;
  148. padding: 0 1.25rem;
  149. font-size: 0.875rem;
  150. font-family: greycliff-cf, sans-serif;
  151. border-radius: 1.875rem !important;
  152. -webkit-border-radius: 1.875rem !important;
  153. -moz-border-radius: 1.875rem !important;
  154. -webkit-transition: all 0.3s ease-in-out;
  155. -moz-transition: all 0.3s ease-in-out;
  156. -o-transition: all 0.3s ease-in-out;
  157. transition: all 0.3s ease-in-out;
  158. border: none;
  159. }
  160. a.blue
  161. {
  162. display: flex;
  163. margin-right:10px;
  164. float:left;
  165. height: 2.5rem !important;
  166. width:50px;
  167. align-items: center;
  168. justify-content: center;
  169. color: #fff;
  170. background-color: #006099 !important;
  171. padding: 0 1.25rem;
  172. font-size: 0.875rem;
  173. font-family: greycliff-cf, sans-serif;
  174. border-radius: 1.875rem !important;
  175. -webkit-border-radius: 1.875rem !important;
  176. -moz-border-radius: 1.875rem !important;
  177. -webkit-transition: all 0.3s ease-in-out;
  178. -moz-transition: all 0.3s ease-in-out;
  179. -o-transition: all 0.3s ease-in-out;
  180. transition: all 0.3s ease-in-out;
  181. border: none;
  182. }
  183. a.yellow
  184. {
  185. display: flex;
  186. margin-right:10px;
  187. float:left;
  188. height: 2.5rem !important;
  189. width:50px;
  190. align-items: center;
  191. justify-content: center;
  192. color: #fff;
  193. background-color: #ffe238;
  194. padding: 0 1.25rem;
  195. font-size: 0.875rem;
  196. font-family: greycliff-cf, sans-serif;
  197. border-radius: 1.875rem !important;
  198. -webkit-border-radius: 1.875rem !important;
  199. -moz-border-radius: 1.875rem !important;
  200. -webkit-transition: all 0.3s ease-in-out;
  201. -moz-transition: all 0.3s ease-in-out;
  202. -o-transition: all 0.3s ease-in-out;
  203. transition: all 0.3s ease-in-out;
  204. border: none;
  205. }
  206. a.orange
  207. {
  208. display: flex;
  209. margin-right:10px;
  210. float:left;
  211. height: 2.5rem !important;
  212. width:50px;
  213. align-items: center;
  214. justify-content: center;
  215. color: #fff;
  216. background-color: #FF7E38;
  217. padding: 0 1.25rem;
  218. font-size: 0.875rem;
  219. font-family: greycliff-cf, sans-serif;
  220. border-radius: 1.875rem !important;
  221. -webkit-border-radius: 1.875rem !important;
  222. -moz-border-radius: 1.875rem !important;
  223. -webkit-transition: all 0.3s ease-in-out;
  224. -moz-transition: all 0.3s ease-in-out;
  225. -o-transition: all 0.3s ease-in-out;
  226. transition: all 0.3s ease-in-out;
  227. border: none;
  228. }
  229. a.green
  230. {
  231. display: flex;
  232. margin-right:10px;
  233. float:left;
  234. height: 2.5rem !important;
  235. width:50px;
  236. align-items: center;
  237. justify-content: center;
  238. color: #fff;
  239. background-color: green;
  240. padding: 0 1.25rem;
  241. font-size: 0.875rem;
  242. font-family: greycliff-cf, sans-serif;
  243. border-radius: 1.875rem !important;
  244. -webkit-border-radius: 1.875rem !important;
  245. -moz-border-radius: 1.875rem !important;
  246. -webkit-transition: all 0.3s ease-in-out;
  247. -moz-transition: all 0.3s ease-in-out;
  248. -o-transition: all 0.3s ease-in-out;
  249. transition: all 0.3s ease-in-out;
  250. border: none;
  251. }
  252. </style>
  253. @endpush
  254. @push('scripts')
  255. <link href="/css/datatables.css" rel="stylesheet" />
  256. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  257. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  258. <style>
  259. .select2-container--default .select2-selection--single{
  260. background-color: #E9F0F5;
  261. border: 0.0625rem solid #DFE5EB;
  262. font-size: 0.75rem;
  263. }
  264. .select2-selection
  265. {
  266. height: 38px !important;
  267. }
  268. .select2-selection__rendered
  269. {
  270. padding-top:3px;
  271. }
  272. .select2 {
  273. width:100% !important;
  274. }
  275. .select2-selection--multiple{
  276. overflow: hidden !important;
  277. height: auto !important;
  278. }
  279. .select2-container {
  280. box-sizing: border-box;
  281. display: inline-block;
  282. margin: 0;
  283. position: relative;
  284. vertical-align: middle;
  285. }
  286. .select2-container .select2-selection--single {
  287. box-sizing: border-box;
  288. cursor: pointer;
  289. display: block;
  290. height: 38px;
  291. user-select: none;
  292. -webkit-user-select: none;
  293. }
  294. .select2-container .select2-selection--single .select2-selection__rendered {
  295. display: block;
  296. padding-left: 8px;
  297. padding-right: 20px;
  298. overflow: hidden;
  299. text-overflow: ellipsis;
  300. white-space: nowrap;
  301. }
  302. .select2-selection__choice__display{
  303. color:#000000 !important;
  304. }
  305. </style>
  306. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  307. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  308. <script src="/assets/js/datatables.js"></script>
  309. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  310. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  311. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  312. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  313. @endpush
  314. @push('scripts')
  315. <script>
  316. $(document).ready(function() {
  317. loadDataTable();
  318. } );
  319. Livewire.on('load-data-table', () => {
  320. loadDataTable();
  321. });
  322. Livewire.on('destroy-data-table', () => {
  323. $('#tablesaw-350').DataTable().destroy();
  324. });
  325. function destroyDataTable()
  326. {
  327. $('#tablesaw-350').DataTable().destroy();
  328. }
  329. var isFilter = false;
  330. $(document).ready(function() {
  331. $(document).on("click",".showHideFilter",function() {
  332. if (isFilter)
  333. {
  334. isFilter = false;
  335. $(".showFilter").hide();
  336. }
  337. else
  338. {
  339. isFilter = true;
  340. $(".showFilter").show();
  341. }
  342. });
  343. } );
  344. function loadDataTable(){
  345. //$('.filterMultiple').select2();
  346. $('#tablesaw-350').DataTable({
  347. thead: {
  348. 'th': {'background-color': 'blue'}
  349. },
  350. layout: {
  351. topStart : null,
  352. topEnd : null,
  353. top1A: {
  354. buttons: [
  355. {
  356. extend: 'collection',
  357. text: 'Esporta',
  358. buttons: [
  359. {
  360. extend: 'excelHtml5',
  361. title: 'Utenti',
  362. exportOptions: {
  363. columns: ":not(':last')"
  364. }
  365. },
  366. {
  367. extend: 'pdfHtml5',
  368. title: 'Utenti',
  369. exportOptions: {
  370. columns: ":not(':last')"
  371. }
  372. },
  373. {
  374. extend: 'print',
  375. text: 'Stampa',
  376. title: 'Utenti',
  377. exportOptions: {
  378. columns: ":not(':last')"
  379. }
  380. }
  381. ],
  382. dropup: true
  383. }
  384. ]
  385. },
  386. top1B : {
  387. pageLength: {
  388. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  389. }
  390. },
  391. top1C :'search',
  392. },
  393. order: [[0, 'asc'], [1, 'asc']],
  394. pagingType: 'numbers',
  395. "language": {
  396. "url": "/assets/js/Italian.json"
  397. },
  398. "fnInitComplete": function (oSettings, json) {
  399. var html = '&nbsp;<a href="#" class="showHideFilter card--ui card--ui_btnAddHeaderUser">&nbsp;&nbsp;<i class="fa-solid fa-sliders"></i>&nbsp;&nbsp;</a>';
  400. $(".dt-search").append(html);
  401. }
  402. });
  403. $('#tablesaw-350 thead tr th').addClass('col');
  404. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  405. }
  406. </script>
  407. @endpush