member.blade.php 168 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617
  1. <div>
  2. @if($showDetail)
  3. <a style="margin-top:20px" class="btn--ui lightGrey" href="/{{$from != '' ? ($from . '?showFilters=1') : 'members'}}"><i class="fa-solid fa-arrow-left"></i></a><br><br>
  4. <div class="col col-lg-12" style="margin-bottom:100px;">
  5. <div class="user--profile d-lg-flex" style="margin-top:20px !important">
  6. <div class="user--profile_card d-flex justify-content-between flex-column w-100 w-lg-auto mb-3 mb-lg-0">
  7. <div class="user--details">
  8. <header>
  9. <div class="avatar--wrapper d-flex align-items-center justify-content-between w-50">
  10. <figure class="m-0 avatar--wrapper_img">
  11. @if ($currentMember->image != '')
  12. <img src="{{ asset('storage/app/public/'.$currentMember->image) }}" style="max-width:200px">
  13. @endif
  14. </figure>
  15. </div>
  16. </header>
  17. <article>
  18. <header class="title d-flex align-items-center mb-4"><i class="ico--ui borsellino fill me-2"></i>Borsellino</header>
  19. <div class="credito d-flex align-items-center justify-content-between">
  20. <div class="credito_title">
  21. <span>Borsellino MAD: <br></span><span class="value">{{formatPrice($currentMember->getMoney())}}</span>
  22. </div>
  23. <a href="/in?new=1&memberId={{$currentMember->id}}&causalId={{$causalId}}" class="btn--ui white small" style="width:100px">ricarica</a>
  24. </div>
  25. <div class="credito d-flex align-items-center justify-content-between">
  26. <br><br><button type="button" class="btn--ui white small" data-bs-toggle="modal" data-bs-target="#userModal" style="width:100px">Modifica</button>
  27. </div>
  28. </article>
  29. <article>
  30. <header class="title d-flex align-items-center mb-4"><i class="ico--ui corsi fill me-2"></i>Certificato</header>
  31. @if(sizeof($currentMember->certificates) > 0)
  32. @php
  33. $cert = $currentMember->certificates[0]
  34. @endphp
  35. <ul class="course-list m-0 p-0">
  36. <li>
  37. <span class="course_name">
  38. {{$cert->type == 'A' ? 'Agonistico' : 'Non agonistico'}}<br>
  39. Scadenza: <span class="title-detail_date">{{$cert->expire_date ? date("d/m/Y", strtotime($cert->expire_date)) : ''}}
  40. </span>
  41. </span>
  42. <span style="float:right">
  43. @if($cert->expire_date < date("Y-m-d"))
  44. <span class="badge tessera-badge suspended">scaduto</span>
  45. @endif
  46. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d") && $cert->expire_date < date("Y-m-d", strtotime("+1 month")))
  47. <span class="badge tessera-badge due">in scadenza</span>
  48. @endif
  49. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d", strtotime("+1 month")))
  50. <span class="badge tessera-badge active">valido</span>
  51. @endif
  52. </span>
  53. </li>
  54. </ul>
  55. @endif
  56. </article>
  57. <article>
  58. <header class="title d-flex align-items-center mb-4"><i class="ico--ui corsi fill me-2"></i>Tesseramento</header>
  59. @if(sizeof($currentMember->cards) > 0)
  60. @foreach($currentMember->cards as $card)
  61. @php
  62. // $card = $currentMember->cards[0];
  63. $active = 'active';
  64. if ($card->expire_date != '' && $card->expire_date < date("Y-m-d 23:59:59"))
  65. {
  66. $active = 'suspended';
  67. }
  68. @endphp
  69. @if($active != 'suspended')
  70. <ul class="course-list m-0 p-0">
  71. <li>
  72. <span class="course_name">
  73. {{$card->card->name}}<br>
  74. Scadenza: <span class="title-detail_date">{{$card->expire_date ? date("d/m/Y", strtotime($card->expire_date)) : ''}}
  75. </span>
  76. </span>
  77. <span style="float:right">
  78. <span class="badge tessera-badge {{$active}}">{{$active == 'active' ? 'ATTIVA' : 'SCADUTA'}}
  79. </span>
  80. </li>
  81. </ul>
  82. @endif
  83. @endforeach
  84. @endif
  85. </article>
  86. </div>
  87. </div>
  88. <div class="user--profile_resume">
  89. <header class="d-flex align-item-center ">
  90. <div class="user_name me-4">
  91. <span class="name">{{$currentMember->first_name}} {{$currentMember->last_name}}</span>
  92. <span class="badge tessera-badge {{$currentStatus["status"] > 0 ? ($currentStatus["status"] == 2 ? 'active' : 'due') : 'suspended'}}">{{$currentStatus["status"] > 0 ? ($currentStatus["status"] == 2 ? 'Tesserato' : 'Sospeso') : 'Non tesserato'}}</span>
  93. </div>
  94. <button class="btn--ui extraLightGrey" wire:click="edit({{ $currentMember->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  95. </header>
  96. <ul class="user-address mb-4 p-0">
  97. <li><i class="ico--ui resume--ico phone me-2"></i><span>Tel. {{$currentMember->phone}}</span></li>
  98. <li><i class="ico--ui resume--ico birth me-2"></i><span>Nato/a il {{$currentMember->birth_date ? date("d/m/Y", strtotime($currentMember->birth_date)) : ''}}</span>&nbsp;({{$currentMember->getAge()}} anni)</li>
  99. <li><i class="ico--ui resume--ico mail me-2"></i><span>{{strtolower($currentMember->email)}}</span></li>
  100. </ul>
  101. <ul class="user-residence p-0">
  102. <li><i class="ico--ui residence me-2"></i><span class="title">Residenza</span></li>
  103. <li><i class="ico--ui resume--ico blank me-2"></i>
  104. <span>
  105. @if($currentMember->city_id > 0)
  106. {{$this->getCity($currentMember->city_id)}}
  107. @if($currentMember->province_id > 0)
  108. ( {{$this->getProvince($currentMember->province_id)}} ) -
  109. @endif
  110. @endif
  111. {{ $currentMember->zip_code }}<br>
  112. {{$currentMember->address}}
  113. </span>
  114. </li>
  115. </ul>
  116. <div class="resume--tab_info gruppi">
  117. <h2 class="mb-3">Gruppi di appartenenza</h2>
  118. <div class="resume--info d-flex align-items-start row">
  119. @foreach($currentMember->categories as $member_category)
  120. <div class="col-md-3 mb-3">
  121. <i class="ico--ui gruppi me-2"></i>
  122. <div class="title" style="margin-right:20px">
  123. <h4>{{$member_category->category->getTree()}}</h4>
  124. </div>
  125. </div>
  126. @endforeach
  127. </div>
  128. </div>
  129. <div class="resume--tab_info corsi">
  130. <h2 class="mb-3">Corsi</h2>
  131. @foreach($currentMember->courses as $member_course)
  132. <div class="d-flex align-items-center corsi--user_details">
  133. <div class="title me-3">
  134. <h4>{{$member_course->course->getTree()}}</h4>
  135. </div>
  136. <div class="corsi--mesi me-3">
  137. <span class="corsi_mesi_text">
  138. @php
  139. $aMo = json_decode($member_course->months);
  140. if (sizeof($aMo) == 1)
  141. {
  142. print($this->getMonth($aMo[0]->m));
  143. }
  144. if (sizeof($aMo) > 1)
  145. {
  146. print($this->getMonth($aMo[0]->m) . " - " . $this->getMonth($aMo[sizeof($aMo) - 1]->m));
  147. }
  148. @endphp
  149. </span>
  150. </div>
  151. <div class="title--dettagli corsi--orari me-3">
  152. <span class="corsi--orari_text">
  153. @foreach(json_decode($member_course->when) as $xx => $x)
  154. @if($xx > 0)
  155. @endif
  156. @foreach($x->day as $d)
  157. {{$d}}
  158. @endforeach
  159. h {{$x->from}} - {{$x->to}}
  160. @endforeach
  161. </span>
  162. </div>
  163. </div>
  164. @endforeach
  165. </div>
  166. </div>
  167. </div>
  168. <div class="service--button d-md-flex align-items-center " style="margin-bottom:30px">
  169. <button class="btn--ui lightGrey" onclick="annulla()" style="margin-right:10px">annulla</button>
  170. <!--<button class="btn--ui_outline btn-large" style="margin-right:10px"><i class="ico--ui utenti"></i>stampa profilo</button>-->
  171. <div class="payment_btn">
  172. <a href="/in?new=1&memberId={{$currentMember->id}}" class="btn--ui primary">NUOVA ENTRATA</a>
  173. <!--<button class="btn--ui btn-large primary"><i class="ico--ui corsi"></i>pagamento corso</button>-->
  174. </div>
  175. </div>
  176. </div>
  177. @else
  178. <div class="col card--ui" id="card--dashboard">
  179. <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between" style="display:none !important">
  180. <div class="title--section_name d-flex align-items-center justify-content-between">
  181. <i class="ico--ui title_section utenti me-2 "></i>
  182. <h2 class="primary">@if(!$add && !$update)Utenti @else Inserimento/modifica utente @endif</h2>
  183. </div>
  184. @if(!$add && !$update)
  185. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  186. <div class="btn--ui entrata d-flex justify-items-between">
  187. <a href="#" style="color:white">Aggiungi</a>
  188. </div>
  189. </div>
  190. @endif
  191. </header>
  192. @if(!$add && !$update)
  193. <!--<button id="open-filter" onclick="pcsh1()"></button>
  194. <button id="close-filter" onclick="pcsh2()"></button>-->
  195. <section id="subheader" class="d-flex align-items-center justify-content-between">
  196. <!--<form action="" class="group--action d-flex align-items-center">
  197. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="multipleAction">
  198. <option selected>Azione multipla</option>
  199. <option value="delete"><i class="fa-regular fa-trash-can"></i></option>
  200. </select>
  201. <button type="submit" class="btn--ui" wire:click.prevent="executeMultipleAction()">applica</button>
  202. </form>-->
  203. @if(false)
  204. <form action="" class="search--form d-flex align-items-center">
  205. <div class="input-group mb-3">
  206. <input type="text" class="form-control" placeholder="Cerca utente" aria-label="cerca utent" aria-describedby="button-addon2" wire:model="search">
  207. @if($showReset)
  208. <button class="btn--ui" type="button" id="button-addon2" onclick="reset()"><i class="ico--ui search"></i>Reset</button>
  209. @else
  210. <button class="btn--ui" type="button" id="button-addon2" wire:click="search()"><i class="ico--ui search"></i>Cerca</button>
  211. @endif
  212. </div>
  213. </form>
  214. @endif
  215. </section>
  216. <div class="showFilter" style="display:none">
  217. <hr size="1">
  218. <div class="row g-3">
  219. <div class="col-md-3">
  220. <div class="row">
  221. <div class="col-md-12" style="margin-bottom:10px;">
  222. <b>Età</b>
  223. </div>
  224. <div class="col-12">
  225. <div class="row mb-2">
  226. <div class="col-3"><label class="form-check-label ms-2" >Da</label></div>
  227. <div class="col-9"><input class="form-control " type="number" name="txtFromYear"></div>
  228. </div>
  229. </div>
  230. <div class="col-12">
  231. <div class="row">
  232. <div class="col-3"><label class="form-check-label ms-2" >A</label></div>
  233. <div class="col-9"><input class="form-control " type="number" name="txtToYear"></div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <div class="col-md-3">
  239. <div class="row">
  240. <div class="col-md-12" style="margin-bottom:10px;">
  241. <b>Tipologia di tesseramento</b>
  242. </div>
  243. <div class="col-12">
  244. <select name="filterCards" class="form-select filterCards">
  245. <option value="">Tutte
  246. @foreach(getCards() as $card)
  247. <option value="{{$card->id}}">{{$card->name}}
  248. @endforeach
  249. </select>
  250. </div>
  251. </div>
  252. </div>
  253. <div class="col-md-3">
  254. <div class="row">
  255. <div class="col-md-12" style="margin-bottom:10px;">
  256. <b>Stato tesseramento</b>
  257. </div>
  258. <div class="col-12">
  259. <select name="filterStatus" class="form-select filterStatus" multiple="multiple">
  260. <option value="2">Attivo
  261. <option value="1">Sospeso
  262. <option value="0">Non tesserato
  263. </select>
  264. </div>
  265. </div>
  266. </div>
  267. <div class="col-md-3">
  268. <div class="row">
  269. <div class="col-md-12" style="margin-bottom:10px;">
  270. <b>Gruppo di appartenenza</b>
  271. </div>
  272. <div class="col-12">
  273. <select name="filterCategories" class="form-select filterCategories" multiple="multiple">
  274. <option value="">Tutte</option>
  275. @foreach($categories as $category)
  276. <option value="{{$category["id"]}}">
  277. {!! str_repeat('&bull; ', $category["indentation"] ?? 0) !!}{{$category["name"]}}
  278. </option>
  279. @endforeach
  280. </select>
  281. </div>
  282. </div>
  283. </div>
  284. <div class="col-md-3">
  285. <div class="row">
  286. <div class="col-md-12" style="margin-bottom:10px;">
  287. <b>Anno di nascita</b>
  288. </div>
  289. <div class="col-12">
  290. <div class="row mb-2">
  291. <div class="col-3"><label class="form-check-label ms-2" >Da</label></div>
  292. <div class="col-9"><input class="form-control " type="number" name="txtFromYearYear"></div>
  293. </div>
  294. </div>
  295. <div class="col-12">
  296. <div class="row">
  297. <div class="col-3"><label class="form-check-label ms-2" >A</label></div>
  298. <div class="col-9"><input class="form-control " type="number" name="txtToYearYear"></div>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. <div class="col-md-3">
  304. <div class="row">
  305. <div class="col-md-12" style="margin-bottom:10px;">
  306. <b>Scadenza certificato medico</b>
  307. </div>
  308. <div class="col-12">
  309. <select name="filterScadenza" class="form-select filterScadenza" multiple="multiple">
  310. <option value="">Tutti
  311. <option value="1">Scaduti
  312. <option value="2">In scadenza
  313. </select>
  314. </div>
  315. </div>
  316. </div>
  317. <div class="col-md-3">
  318. <div class="row">
  319. <div class="col-md-12" style="margin-bottom:10px;">
  320. <b>Tipologia certificato medico</b>
  321. </div>
  322. <div class="col-12">
  323. <select name="filterCertificateType" class="form-select filterCertificateType" multiple="multiple">
  324. <option value="">Tutti
  325. <option value="N">Non agonistico
  326. <option value="A">Agonistico
  327. </select>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. <div class="row g-3">
  333. <div class="col-md-12" style="text-align:right">
  334. <button class="btn--ui lightGrey" onclick="reset()" onclick="destroyDataTable()">Reset</button>
  335. <button class="btn--ui" onclick="loadDataTable()">FILTRA</button>
  336. </div>
  337. </div>
  338. <hr size="1">
  339. </div>
  340. <section id="anagrafiche--utenti">
  341. <div class="compare--chart_wrapper d-none"></div>
  342. <table class="table tablesaw tableHead tablesaw-stack table--lista_utenti tableHead" width="100%" id="tablesaw-350" width="100%">
  343. <thead>
  344. <tr>
  345. <!--<th scope="col">#</th>-->
  346. <th scope="col" style="text-align: center">Cognome</th>
  347. <th scope="col">Nome</th>
  348. <th scope="col">Telefono</th>
  349. <th scope="col" style="text-align: center">Età</th>
  350. <th scope="col" style="text-align: center">Anno</th>
  351. <th scope="col">Stato</th>
  352. <th scope="col">Certificato</th>
  353. <th scope="col">...</th>
  354. </tr>
  355. </thead>
  356. <tbody id="checkall-target">
  357. @if(false)
  358. @foreach($records as $idx => $record)
  359. <tr>
  360. <td> <label><input class="table-check" type="checkbox" wire:model="multipleIds" value="{{$record->id}}"><span class="sr-only d-inline-block d-lg-none ms-2 mobile-row-selector"> Seleziona riga</span></label></td>
  361. <td>{{ ($idx + 1) }}</td>
  362. <td>ID{{str_pad($record->id, 5, "0", STR_PAD_LEFT)}}</td>
  363. <td><a href="#" wire:click="showDetail({{$record->id}})">{{$record->last_name}}</a></td>
  364. <td><a href="#" wire:click="showDetail({{$record->id}})">{{$record->first_name}}</a></td>
  365. <td>
  366. @if($record->phone != '')
  367. <a href="tel:{{$record->phone}}">{{$record->phone}}</a>
  368. @endif
  369. </td>
  370. <td>{{$record->age > 0 ? $record->age : ''}} </td>
  371. <td>
  372. <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->state > 0 ? ($record->state == 2 ? 'active' : 'suspended') : 'due'}}">{{$record->state > 0 ? ($record->state == 2 ? 'Tesserato' : 'Sospeso') : 'Non tesserato'}}</span></span>
  373. </td>
  374. <td>
  375. <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->status > 0 ? ($record->status == 2 ? 'active' : 'suspended') : ''}}">{{$record->status > 0 ? ($record->status == 2 ? 'Attivo' : 'Sospesa') : ''}}</span></span>
  376. <b class=" tablesaw-cell-label">Scadenza tessera</b>
  377. <span class="tablesaw-cell-content d-flex align-items-center">
  378. {{$record->status ? 'Scadenza : ' : ($record->date != '' ? 'Scaduto : ' : '')}} {{$record->date != '' ? date("d/m/Y", strtotime($record->date)) : ''}}
  379. </span>
  380. </td>
  381. <td>
  382. @if($record->certificate != '')
  383. <b class=" tablesaw-cell-label">Scadenza certificato</b>
  384. <span class="tablesaw-cell-content d-flex align-items-center">
  385. @if($record->certificate < date("Y-m-d"))
  386. <i class="ico--ui check suspended me-2"></i>
  387. Scaduto :
  388. @endif
  389. @if($record->certificate >= date("Y-m-d") && $record->certificate < date("Y-m-d", strtotime("+1 month")))
  390. <i class="ico--ui check due me-2"></i>
  391. In scadenza :
  392. @endif
  393. @if($record->certificate >= date("Y-m-d", strtotime("+1 month")))
  394. <i class="ico--ui check active me-2"></i>
  395. Scadenza :
  396. @endif
  397. {{$record->certificate != '' ? date("d/m/Y", strtotime($record->certificate)) : ''}}
  398. </span>
  399. @endif
  400. </td>
  401. <td>
  402. <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  403. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  404. </td>
  405. </tr>
  406. @endforeach
  407. @endif
  408. </tbody>
  409. </table>
  410. <!--
  411. <div class="paginator d-flex justify-content-center">
  412. <nav aria-label="Page navigation example">
  413. <ul class="pagination">
  414. <li class="page-item">
  415. <a class="page-link" href="#" aria-label="Previous">
  416. <span aria-hidden="true"></span>
  417. </a>
  418. </li>
  419. <li class="page-item"><a class="page-link" href="#">1</a></li>
  420. <li class="page-item"><a class="page-link" href="#">2</a></li>
  421. <li class="page-item"><a class="page-link" href="#">3</a></li>
  422. <li class="page-item"><a class="page-link" href="#">3</a></li>
  423. <li class="page-item"><span class="more-page">...</span></li>
  424. <li class="page-item">
  425. <a class="page-link" href="#" aria-label="Next">
  426. <span aria-hidden="true"></span>
  427. </a>
  428. </li>
  429. </ul>
  430. </nav>
  431. </div>
  432. -->
  433. </section>
  434. @else
  435. <a name="top"></a>
  436. <a style="margin-top:20px" class="btn--ui lightGrey" href="/{{$from != '' ? ($from . '?showFilters=1') : 'members'}}"><i class="fa-solid fa-arrow-left"></i></a><br><br>
  437. @if (session()->has('success'))
  438. <div class="alert alert-success" role="alert">
  439. {{ session()->get('success') }}
  440. </div>
  441. @endif
  442. @if (session()->has('error'))
  443. <div class="alert alert-danger" role="alert">
  444. {{ session()->get('error') }}
  445. </div>
  446. @endif
  447. <div class="container-fluid">
  448. <div class="row mb-3">
  449. <div class="col-md-7 col-xl-8 p-3">
  450. <div class="section--tab d-flex">
  451. <h4 style="cursor:pointer;{{$type == 'dati' ? 'border-bottom:2px solid #0C6197; color:#0C6197;' : ''}}" wire:click="change('dati')">Anagrafica</h4>
  452. <h4 style="cursor:pointer;{{$type == 'tesseramento' ? 'border-bottom:2px solid #0C6197; color:#0C6197;' : ''}}" wire:click="change('tesseramento')">Tesseramento</h4>
  453. <h4 style="cursor:pointer;{{$type == 'corsi' ? 'border-bottom:2px solid #0C6197; color:#0C6197;' : ''}}" wire:click="change('corsi')">Corsi</h4>
  454. <h4 style="cursor:pointer;{{$type == 'gruppi' ? 'border-bottom:2px solid #0C6197; color:#0C6197;' : ''}}" wire:click="change('gruppi')">Gruppi</h4>
  455. </div>
  456. <div class="row">
  457. @if($type == 'dati')
  458. <div class="form--wrapper d-flex">
  459. <form class="form--utente d-flex">
  460. <div class="form--col" style="width:100%">
  461. <div class="row g-3">
  462. <div class="col-md-6 col-xxl-3">
  463. <label for="first_name" class="form-label">Nome</label>
  464. <input class="form-control @error('first_name') is-invalid @enderror" type="text" id="first_name" placeholder="Nome" wire:model="first_name" style="text-transform:uppercase">
  465. </div>
  466. <div class="col-md-6 col-xxl-3">
  467. <label for="last_name" class="form-label">Cognome</label>
  468. <input class="form-control @error('last_name') is-invalid @enderror" type="text" id="last_name" placeholder="Cognome" wire:model="last_name" style="text-transform:uppercase">
  469. </div>
  470. <div class="col-md-6 col-xxl-3">
  471. <label for="email" class="form-label">Sesso</label>
  472. <select id="gender" class="form-select @error('gender') is-invalid @enderror" aria-label="Sesso" wire:model="gender">
  473. <option value="">
  474. <option value="M">Uomo
  475. <option value="D">Donna
  476. <option value="O">Altro
  477. </select>
  478. </div>
  479. <div class="col-md-6 col-xxl-3">
  480. <label for="inputDate" class="form-label">Data di nascita {!!$age != '' ? ' <b style="font-size:14px;">(' . $age . ')</b>' : ''!!}</label>
  481. <div class="input-group mb-3">
  482. <div style="width:100%">
  483. <input class="form-control @error('birth_date') is-invalid @enderror" type="date" id="birth_date" placeholder="Data di nascita" wire:model="birth_date">
  484. </div>
  485. <div style="width:100%; text-align:center;">{!!$under18 ? '<span style="color:red;font-weight:bold;font-size:12px;">&nbsp;MINORENNE</span>' : ''!!}</div>
  486. </div>
  487. </div>
  488. </div>
  489. <div class="row g-3">
  490. <div class="col-md-6 col-xxl-3">
  491. <label for="birth_nation_id" class="form-label">Nazione di Nascita</label>
  492. <select id="birth_nation_id" class="form-select nationBirthClass @error('birth_nation_id') is-invalid @enderror" aria-label="Nazione di nascita" wire:model="birth_nation_id">
  493. <option value="{{$birth_nation_id}}">{{$this->getNation($birth_nation_id)}}
  494. </select>
  495. </div>
  496. @if($isBirthItaly)
  497. <div class="col-md-6 col-xxl-3">
  498. <label for="birth_province_id" class="form-label">Provincia di Nascita</label>
  499. <select id="birth_province_id" class="form-select provinceBirthClass @error('birth_province_id') is-invalid @enderror" aria-label="Provincia di nascita" wire:model="birth_province_id">
  500. <option value="{{$birth_province_id}}">{{$this->getProvince($birth_province_id)}}
  501. </select>
  502. </div>
  503. <div class="col-xl-6">
  504. <label for="birth_city_id" class="form-label">Comune di Nascita</label>
  505. <select id="birth_city_id" class="form-select cityBirthClass @error('birth_city_id') is-invalid @enderror" aria-label="Comune di nascita" wire:model="birth_city_id" >
  506. <option value="{{$birth_city_id}}">{{$this->getCity($birth_city_id)}}
  507. </select>
  508. </div>
  509. @else
  510. <div class="col-xl-3">
  511. <label for="birth_place" class="form-label">Paese di nascita</label>
  512. <input class="form-control @error('birth_place') is-invalid @enderror" type="text" id="birth_place" placeholder="Paese di nascita" wire:model="birth_place">
  513. </div>
  514. @endif
  515. </div>
  516. <div class="row g-3 mt-1">
  517. <div class="col-xl-6">
  518. <label for="fiscal_code" class="form-label">Codice fiscale (<a wire:click="getFiscalCode()" style="cursor:pointer;font-size:18px;color: #006099;font-weight: bold;">calcola</a>)</label>
  519. <input class="form-control @error('fiscal_code') is-invalid @enderror" type="text" id="fiscal_code" placeholder="Codice fiscale" wire:model="fiscal_code" maxlength="16">
  520. @if($this->error_fc)
  521. <span style="color:red;font-size:12px">Dati mancanti</span>
  522. @endif
  523. @error('fiscal_code')
  524. <div class="invalid-feedback">{{ $message }}</div>
  525. @enderror
  526. </div>
  527. <div class="col-xl-6">
  528. <div class="upload-file">
  529. <label for="formFile" class="form-label">Immagine profilo</label>
  530. @error('image') <span class="error">{{ $message }}</span> @enderror
  531. <input class="form-control" type="file" wire:model="image">
  532. @if ($image)
  533. <img src="{{ $image->temporaryUrl() }}" style="max-width:200px">
  534. @endif
  535. @if ($image_old)
  536. <img src="{{ asset('storage/app/public/'.$image_old) }}" style="max-width:200px">
  537. @endif
  538. </div>
  539. </div>
  540. </div>
  541. <div class="row g-3 mt-1">
  542. <span class="title-form primary d-block w-100">Residenza</span>
  543. <div class="col-xl-3" wire:ignore>
  544. <label for="nation_id" class="form-label">Nazione</label>
  545. <select id="nation_id" class="form-select nationClass @error('nation_id') is-invalid @enderror" aria-label="Nazione" wire:model="nation_id">
  546. <option value="{{$nation_id}}">{{$this->getNation($nation_id)}}
  547. </select>
  548. </div>
  549. @if($isItaly)
  550. <div class="col-xl-3">
  551. <label for="province_id" class="form-label">Provincia</label>
  552. <select id="province_id" class="form-select provinceClass @error('province_id') is-invalid @enderror" aria-label="Provincia" wire:model="province_id">
  553. <option value="{{$province_id}}">{{$this->getProvince($province_id)}}
  554. </select>
  555. </div>
  556. <div class="col-xl-6">
  557. <label for="city_id" class="form-label">Comune</label>
  558. <select id="city_id" class="form-select cityClass @error('city_id') is-invalid @enderror" aria-label="Comune" wire:model="city_id">
  559. <option value="{{$city_id}}">{{$this->getCity($city_id)}}
  560. </select>
  561. </div>
  562. @endif
  563. </div>
  564. <div class="row g-3 mt-1">
  565. <div class="col-xl-6">
  566. <label for="address" class="form-label">Indirizzo</label>
  567. <input class="form-control @error('address') is-invalid @enderror" type="text" id="address" placeholder="Indirizzo" wire:model="address" style="text-transform:uppercase">
  568. </div>
  569. <div class="col-xl-3">
  570. <label for="zip_code" class="form-label">CAP</label>
  571. <input class="form-control @error('zip_code') is-invalid @enderror" type="text" id="zip_code" placeholder="CAP" wire:model="zip_code" maxlength="5" >
  572. </div>
  573. </div>
  574. <div class="row g-3 mt-1">
  575. <span class="title-form primary d-block w-100">Contatti</span>
  576. <div class="col-xl-6">
  577. <label for="email" class="form-label">Email</label>
  578. <input class="form-control @error('email') is-invalid @enderror" type="text" id="email" placeholder="Email" wire:model="email">
  579. </div>
  580. <div class="col-xl-6">
  581. <label for="phone" class="form-label">Telefono/Cellulare</label>
  582. <input class="form-control @error('phone') is-invalid @enderror" type="text" id="phone" placeholder="Telefono" wire:model="phone">
  583. </div>
  584. <div class="col-xl-6">
  585. <label for="phone2" class="form-label">Telefono 2</label>
  586. <input class="form-control" type="text" id="phone2" placeholder="Telefono 2" wire:model="phone2">
  587. </div>
  588. <div class="col-xl-6">
  589. <label for="phone3" class="form-label">Telefono 3</label>
  590. <input class="form-control" type="text" id="phone3" placeholder="Telefono 3" wire:model="phone3">
  591. </div>
  592. </div>
  593. <div class="row g-3 mt-1">
  594. <div class="col-lg-12">
  595. <input type="checkbox" id="no_send_mail" wire:model="no_send_mail">&nbsp;<label for="birth_place" class="form-label">Non inviare mail ricevuta</label>
  596. </div>
  597. <div class="col-lg-12">
  598. <input type="checkbox" id="exclude_from_records" wire:model="exclude_from_records">&nbsp;<label for="birth_place" class="form-label">Escludi da prima nota e entrate/uscite</label>
  599. </div>
  600. @if($dataId > 0)
  601. <span class="title-form primary d-block w-100">Stato</span>
  602. <div class="col-12">
  603. <span class="badge tessera-badge {{$active["status"] == 2 ? 'active' : ($active["status"] == 0 ? 'due' : 'suspended')}}">{{$active["status_text"]}}</span>
  604. </div>
  605. @endif
  606. <!--<span class="title-form primary d-block w-100">Stato Pagamenti</span>
  607. <div class="col-12">
  608. <div class="form-check form-switch d-flex align-items-center active">
  609. <input class="form-check-input me-2" type="checkbox" role="switch" id="flexSwitchCheckChecked" checked>
  610. <label class="form-check-label" for="flexSwitchCheckChecked">Scadenza: <span><strong>16 aprile 2024</strong></span></label>
  611. </div>
  612. </div>-->
  613. </div>
  614. @if($under18)
  615. <div class="row g-3 mt-1">
  616. <span class="title-form primary d-block w-100">Genitore 1</span>
  617. <div class="col-xl-6">
  618. <label for="father_name" class="form-label"><b>Nominativo</b></label>
  619. <input class="form-control" type="text" id="father_name" placeholder="Nome" wire:model="father_name">
  620. </div>
  621. <div class="col-xl-6">
  622. <label for="father_name" class="form-label"><b>Email</b></label>
  623. <input class="form-control" type="text" id="father_email" placeholder="Email" wire:model="father_email">
  624. </div>
  625. <div class="col-xl-6">
  626. <label for="father_name" class="form-label"><b>Telefono</b></label>
  627. <input class="form-control" type="text" id="father_phone" placeholder="Telefono" wire:model="father_phone">
  628. </div>
  629. <div class="col-xl-6">
  630. <label for="father_name" class="form-label"><b>Codice fiscale</b></label>
  631. <input class="form-control" type="text" id="father_fiscal_code" placeholder="Codice fiscale" wire:model="father_fiscal_code" maxlength="16">
  632. </div>
  633. <div class="col-xl-6">
  634. <label for="father_name" class="form-label"><b>Numero del documento</b></label>
  635. <input class="form-control" type="text" id="father_doc_number" placeholder="Numero documento" wire:model="father_doc_number">
  636. </div>
  637. <div class="col-xl-6">
  638. <label for="father_name" class="form-label"><b>Tipo documento</b></label>
  639. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="father_doc_type">
  640. <option value="">Seleziona il tipo documento</option>
  641. <option value="Carta di identità">Carta di identità</option>
  642. <option value="Passaporto">Passaporto</option>
  643. <option value="Patente">Patente</option>
  644. <option value="Permesso di soggiorno">Permesso di soggiorno</option>
  645. </select>
  646. </div>
  647. </div>
  648. <div class="row g-3 mt-1">
  649. <span class="title-form primary d-block w-100">Genitore 2</span>
  650. <div class="col-xl-6">
  651. <label for="mother_name" class="form-label"><b>Nominativo</b></label>
  652. <input class="form-control " type="text" id="mother_name" placeholder="Nome genitore 2" wire:model="mother_name">
  653. </div>
  654. <div class="col-xl-6">
  655. <label for="mother_name" class="form-label"><b>Email</b></label>
  656. <input class="form-control " type="text" id="mother_email" placeholder="Email" wire:model="mother_email">
  657. </div>
  658. <div class="col-xl-6">
  659. <label for="mother_name" class="form-label"><b>Telefono</b></label>
  660. <input class="form-control " type="text" id="mother_phone" placeholder="Telefono" wire:model="mother_phone">
  661. </div>
  662. <div class="col-xl-6">
  663. <label for="mother_name" class="form-label"><b>Codice fiscale</b></label>
  664. <input class="form-control " type="text" id="mother_fiscal_code" placeholder="Codice fiscale" wire:model="mother_fiscal_code" maxlength="16">
  665. </div>
  666. <div class="col-xl-6">
  667. <label for="mother_name" class="form-label"><b>Numero del documento</b></label>
  668. <input class="form-control " type="text" id="mother_doc_number" placeholder="Numero documento" wire:model="mother_doc_number">
  669. </div>
  670. <div class="col-xl-6">
  671. <label for="mother_name" class="form-label"><b>Tipo documento</b></label>
  672. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="mother_doc_type">
  673. <option value="">Seleziona il tipo documento</option>
  674. <option value="Carta di identità">Carta di identità</option>
  675. <option value="Passaporto">Passaporto</option>
  676. <option value="Patente">Patente</option>
  677. <option value="Permesso di soggiorno">Permesso di soggiorno</option>
  678. </select>
  679. </div>
  680. </div>
  681. @endif
  682. <div class="row g-3 mt-1" wire:key='reload-{{$selectId}}'>
  683. <span class="title-form primary d-block w-100">Documento</span>
  684. <div class="col-xl-6 col-xl-3">
  685. <label for="document_type" class="form-label">Tipo</label>
  686. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="document_type">
  687. <option value="">--Seleziona--</option>
  688. <option value="Carta di identità">Carta di identità</option>
  689. <option value="Passaporto">Passaporto</option>
  690. <option value="Patente">Patente</option>
  691. <option value="Permesso di soggiorno">Permesso di soggiorno</option>
  692. </select>
  693. </div>
  694. <div class="col-xl-6 col-xl-3">
  695. <label for="document_number" class="form-label">Numero</label>
  696. <input class="form-control" type="text" id="document_number" placeholder="Numero" wire:model="document_number">
  697. </div>
  698. <div class="col-xl-6 col-xl-3">
  699. <label for="document_from" class="form-label">Rilasciato da</label>
  700. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="document_from">
  701. <option value="">--Seleziona--</option>
  702. <option value="Comune">Comune</option>
  703. <option value="Motorizzazione">Motorizzazione</option>
  704. <option value="Ministero degli interni">Ministero degli interni</option>
  705. <option value="Prefettura">Prefettura</option>
  706. </select>
  707. </div>
  708. <div class="col-xl-6 col-xl-3">
  709. <label for="document_expire_date" class="form-label">Scadenza</label>
  710. <input class="form-control" type="date" id="document_expire_date" placeholder="Scadenza" wire:model="document_expire_date">
  711. </div>
  712. <div class="col-12">
  713. <label for="document_files" class="form-label">File</label>
  714. <input class="form-control" type="file" wire:model="documents" multiple><br>
  715. <label for="document_files" class="form-label">Caricati</label>
  716. @foreach ($document_files as $idx => $d)
  717. <div class="row">
  718. <div class="col-6">
  719. <a href="{{ asset('storage/app/public/'.$d) }}" target="_blank" class="form-label">{{$d}}</a>
  720. </div>
  721. <div class="col-6">
  722. <a wire:click="removeDocument({{$idx}})" class="form-label">(elimina)</a><br>
  723. </div>
  724. </div>
  725. @endforeach
  726. </div>
  727. </div>
  728. <div class="row g-3 mt-1">
  729. <span class="title-form primary d-block w-100">Certificato Medico</span>
  730. @if($dataId > -1)
  731. @if(!$addCertificate && !$updateCertificate)
  732. <table class="table tablesaw tableHead tablesaw-stack" >
  733. <thead>
  734. <tr>
  735. <th scope="col">Tipo</th>
  736. <th scope="col">Scadenza</th>
  737. <th scope="col"></th>
  738. <th scope="col">...</th>
  739. </tr>
  740. </thead>
  741. <tbody >
  742. @foreach($member_certificates as $member_certificate)
  743. <tr>
  744. <td>{{$member_certificate->type == 'A' ? 'Agonistico' : 'Non agonistico'}}</td>
  745. <td>{{$member_certificate->expire_date ? date("d/m/Y", strtotime($member_certificate->expire_date)) : ''}}</td>
  746. <td>{!!$member_certificate->filename != '' ? '<a href="/storage/app/public/' . $member_certificate->filename . '" target="_blank">Visualizza</a>' : ''!!}</td>
  747. <td>
  748. <button type="button" class="btn" wire:click="editCertificate({{ $member_certificate->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  749. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="deleteCertificate({{ $member_certificate->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  750. </td>
  751. </tr>
  752. @endforeach
  753. </tbody>
  754. </table>
  755. <button class="btn--ui primary"wire:click.prevent="addCertificate()" style="max-width:200px">Aggiungi</button>
  756. @else
  757. <div class="form--wrapper">
  758. <form class="form--utente">
  759. <div class="row ">
  760. <div class="col-md-6">
  761. <label for="certificate_type" class="form-label">Tipo</label>
  762. <select id="certificate_type" class="form-select certificate_type" aria-label="Tessera" wire:model="certificate_type">
  763. <option value="N">Non agonistico
  764. <option value="A">Agonistico
  765. </select>
  766. </div>
  767. <div class="col-md-6">
  768. <label for="certificate_expire_date" class="form-label">Data scadenza</label>
  769. <input class="form-control @error('certificate_expire_date') is-invalid @enderror" type="date" id="certificate_expire_date" placeholder="Data scadenza" wire:model="certificate_expire_date">
  770. </div>
  771. </div>
  772. <div class="col-12">
  773. <div class="upload--image_box d-flex align-items-center justify-content-center flex-column">
  774. <input class="form-control" type="file" wire:model="certificate_filename">
  775. </div>
  776. <p class="caption text-center mt-1">Formati consentiti: .jpg, .pdf, .docx</p>
  777. {!!$certificate_filename_old != '' ? '<br><a href="/storage/app/public/' . $certificate_filename_old . '" target="_blank">Visualizza</a>' : ''!!}
  778. </div>
  779. </form>
  780. </div>
  781. <br>
  782. <button class="btn--ui lightGrey" wire:click.prevent="cancelCertificate()">Annulla</button>
  783. @if($addCertificate)
  784. <button class="btn--ui primary" wire:click.prevent="storeCertificate()">Salva</button>
  785. @endif
  786. @if($updateCertificate)
  787. <button class="btn--ui primary" wire:click.prevent="updateCertificate()">Salva</button>
  788. @endif
  789. @endif
  790. @else
  791. <label for="last_name" class="form-label">Prima di caricare un certificato salva l'utente</label>
  792. @endif
  793. </div>
  794. </div>
  795. </form>
  796. </div>
  797. @endif
  798. @if($type == 'tesseramento')
  799. @if($dataId > 0)
  800. @if(!$addCard && !$updateCard)
  801. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350-1">
  802. <thead>
  803. <tr>
  804. <th scope="col">Carta</th>
  805. <th scope="col">Numero</th>
  806. <th scope="col">Scadenza</th>
  807. <th scope="col">...</th>
  808. </tr>
  809. </thead>
  810. <tbody id="checkall-target">
  811. @foreach($member_cards as $member_card)
  812. <tr>
  813. <td>{{$member_card->card->name}}</td>
  814. <td>{{$member_card->number}}</td>
  815. <td>{{$member_card->expire_date ? date("d/m/Y", strtotime($member_card->expire_date)) : ''}}</td>
  816. <td>
  817. <button type="button" class="btn" wire:click="editCard({{ $member_card->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  818. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="deleteCard({{ $member_card->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  819. </td>
  820. </tr>
  821. @endforeach
  822. </tbody>
  823. </table>
  824. <button class="btn--ui primary"wire:click.prevent="addCard()" style="max-width:200px">Aggiungi</button>
  825. @else
  826. <div class="form--wrapper">
  827. <form class="form--utente">
  828. <div class="row ">
  829. <div class="col-md-6">
  830. <label for="card_card_id" class="form-label">Tessera</label>
  831. <select id="card_card_id" class="form-select card_card_id @error('card_card_id') is-invalid @enderror" aria-label="Tessera" wire:model="card_card_id">
  832. <option value="">--Seleziona--
  833. @foreach($cards as $card)
  834. <option value="{{$card->id}}">{{$card->name}}
  835. @endforeach
  836. </select>
  837. </div>
  838. <div class="col-md-6">
  839. <label for="card_number" class="form-label">Numero</label>
  840. <input class="form-control @error('card_number') is-invalid @enderror" type="text" id="card_number" placeholder="Numero" wire:model="card_number">
  841. </div>
  842. </div>
  843. <div class="row ">
  844. <div class="col-md-6">
  845. <label for="card_date" class="form-label">Data rilascio tessera</label>
  846. <input class="form-control" type="date" id="card_date" placeholder="Data" wire:model="card_date">
  847. </div>
  848. <div class="col-md-6">
  849. <label for="card_accept_date" class="form-label">Data accettazione</label>
  850. <input class="form-control" type="date" id="card_accept_date" placeholder="Data accettazione" wire:model="card_accept_date">
  851. </div>
  852. </div>
  853. <div class="row ">
  854. <div class="col-md-6">
  855. <label for="card_date" class="form-label">Disciplina 1</label>
  856. <select id="card_discipline1_id" class="form-select " aria-label="Disciplina 1" wire:model="card_discipline1_id">
  857. <option value="">--Seleziona--
  858. @foreach($disciplines as $d)
  859. <option value="{{$d->id}}">{{$d->name}}
  860. @endforeach
  861. </select>
  862. </div>
  863. <div class="col-md-6">
  864. <label for="card_date" class="form-label">Disciplina 2</label>
  865. <select id="card_discipline2_id" class="form-select " aria-label="Disciplina 2" wire:model="card_discipline2_id">
  866. <option value="">--Seleziona--
  867. @foreach($disciplines as $d)
  868. <option value="{{$d->id}}">{{$d->name}}
  869. @endforeach
  870. </select>
  871. </div>
  872. </div>
  873. @if($card_discipline2_id > 0)
  874. <div class="row ">
  875. <div class="col-md-6">
  876. <label for="card_date" class="form-label">Disciplina 3</label>
  877. <select id="card_discipline3_id" class="form-select " aria-label="Disciplina 3" wire:model="card_discipline3_id">
  878. <option value="">--Seleziona--
  879. @foreach($disciplines as $d)
  880. <option value="{{$d->id}}">{{$d->name}}
  881. @endforeach
  882. </select>
  883. </div>
  884. </div>
  885. @endif
  886. </form>
  887. </div>
  888. <br>
  889. <div class="row mt-2">
  890. <div class="col-md-12">
  891. <button class="btn--ui lightGrey" wire:click.prevent="cancelCard()">Annulla</button>
  892. @if($addCard)
  893. <button class="btn--ui primary" wire:click.prevent="storeCard()">Salva</button>
  894. @endif
  895. @if($updateCard)
  896. <button class="btn--ui primary" wire:click.prevent="updateCard()">Salva</button>
  897. @endif
  898. </div>
  899. </div>
  900. @endif
  901. <!--
  902. <button class="tab--btn w-100"><i class="ico--ui tessera me-2"></i><span class="btn_title">nessuna tessera registrata</span></button>
  903. <div class="tessere--tab">
  904. <div class="d-flex align-items-start">
  905. <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
  906. <button class="nav-link active" id="v-pills-fit-tab" data-bs-toggle="pill" data-bs-target="#v-pills-fit" type="button" role="tab" aria-controls="v-pills-fit" aria-selected="true">Fit</button>
  907. <button class="nav-link" id="v-pills-uisp-tab" data-bs-toggle="pill" data-bs-target="#v-pills-uisp" type="button" role="tab" aria-controls="v-pills-uisp" aria-selected="false">UISP</button>
  908. <button class="nav-link" id="v-pills-mps-tab" data-bs-toggle="pill" data-bs-target="#v-pills-mps" type="button" role="tab" aria-controls="v-pills-mps" aria-selected="false" >MPS</button>
  909. <button class="nav-link" id="v-pills-csi-tab" data-bs-toggle="pill" data-bs-target="#v-pills-csi" type="button" role="tab" aria-controls="v-pills-csi" aria-selected="false">CSI</button>
  910. <button class="nav-link" id="v-pills-altro-tab" data-bs-toggle="pill" data-bs-target="#v-pills-altro" type="button" role="tab" aria-controls="v-pills-altro" aria-selected="false">Altro</button>
  911. </div>
  912. <div class="tab-content" id="v-pills-tabContent">
  913. <div class="tab-pane fade show active" id="v-pills-fit" role="tabpanel" aria-labelledby="v-pills-fit-tab" tabindex="0">
  914. <form class="form--tessere">
  915. <div class="mb-3">
  916. <label for="inputTessera" class="form-label">Numero Tessera</label>
  917. <input type="text" class="form-control" id="inputTessera">
  918. </div>
  919. <div class="mb-3">
  920. <label for="inputDate" class="form-label">Data di nascita</label>
  921. <div class="input-group mb-3">
  922. <input id="inputDate" type="text" class="form-control" aria-label="Recipient's username" aria-describedby="button-addon2">
  923. <button class="btn btn-outline-secondary" type="button" id="button-addon2">Date</button>
  924. </div>
  925. </div>
  926. <span class="scadenza-tessera">Scadenza: <strong>16 aprile 2024</strong></span>
  927. <button class="btn--ui_outline small mt-2"><i class="ico--ui tessera"></i>aggiungi tessera</button>
  928. </form>
  929. </div>
  930. <div class="tab-pane fade" id="v-pills-uisp" role="tabpanel" aria-labelledby="v-pills-uisp-tab" tabindex="0">...</div>
  931. <div class="tab-pane fade" id="v-pills-mps" role="tabpanel" aria-labelledby="v-pills-mps-tab" tabindex="0">...</div>
  932. <div class="tab-pane fade" id="v-pills-csi" role="tabpanel" aria-labelledby="v-pills-csi-tab" tabindex="0">...</div>
  933. <div class="tab-pane fade" id="v-pills-altro" role="tabpanel" aria-labelledby="v-pills-altro-tab" tabindex="0">...</div>
  934. </div>
  935. </div>
  936. </div>-->
  937. @endif
  938. @endif
  939. @if($type == 'gruppi')
  940. <form class="form--tesseramento mt-4">
  941. @livewire('categories')
  942. @if(false)
  943. <div class="tessera--added d-flex align-items-center justify-content-between mt-4 mb-3">
  944. <select id="category_category_id" class="form-select categoriesClass @error('category_category') is-invalid @enderror" aria-label="Gruppo" wire:model="category_category_id" style="width:100%;">
  945. <option value="">--Seleziona--
  946. @foreach($categories as $category)
  947. <option value="{{$category["id"]}}">{{$category["name"]}}
  948. @endforeach
  949. </select>
  950. <button class="btn--ui_outline" wire:click.prevent="storeCategory()" style="margin-left:20px"><i class="ico--ui gruppi"></i>aggiungi</button>
  951. </div>
  952. @endif
  953. <span style="color:red">{!!$groupMsg!!}</span>
  954. @foreach($member_categories as $member_category)
  955. <div class="tessera--added d-flex align-items-center justify-content-between mt-4 mb-3">
  956. <div class="tessera--added_name d-flex align-items-start">
  957. <i class="ico--ui gruppi me-2"></i>
  958. <div class="title--tessera_added">
  959. <h4>{{$member_category->category->getTree()}}</h4>
  960. </div>
  961. </div>
  962. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="deleteCategory({{ $member_category->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  963. </div>
  964. @endforeach
  965. </form>
  966. @endif
  967. @if($type == 'corsi')
  968. @if($dataId > 0)
  969. @if(!$addCourse && !$updateCourse)
  970. <table class="table tablesaw tableHead tablesaw-stack tabella--corsi" id="tablesaw-350-2" style="min-width:800px">
  971. <tbody id="checkall-target">
  972. @foreach($member_courses as $member_course)
  973. <tr>
  974. <td style="width:10%">
  975. <b>{{$member_course->course->name}}</b><br>
  976. </td>
  977. <td style="width:10%">
  978. {{$member_course->course->type->name ?? ""}}<br>
  979. </td>
  980. <td style="width:10%">
  981. {{$member_course->course->level->name ?? ""}}<br>
  982. </td>
  983. <td style="width:30%">
  984. @foreach(json_decode($member_course->when) as $xx => $x)
  985. @if($xx > 0)
  986. <br>
  987. @endif
  988. @foreach($x->day as $zz => $d)
  989. {{$zz > 0 ? '-' : ''}}{{$d}}
  990. @endforeach
  991. h {{$x->from}} - {{$x->to}}
  992. @endforeach
  993. </td>
  994. <td style="width:25%">
  995. @php
  996. $aMo = json_decode($member_course->months);
  997. if (sizeof($aMo) == 1)
  998. {
  999. print($this->getMonth($aMo[0]->m));
  1000. }
  1001. if (sizeof($aMo) > 1)
  1002. {
  1003. print($this->getMonth($aMo[0]->m) . " - " . $this->getMonth($aMo[sizeof($aMo) - 1]->m));
  1004. }
  1005. @endphp
  1006. </td>
  1007. @if(false)
  1008. <td style="width:10%">Iscrizione:<br><b>{{$member_course->status == 1 ? 'Pagata' : ($member_course->status == 2 ? 'Da pagare' : 'Sospesa')}}</b></td>
  1009. @endif
  1010. <td style="text-align:right;width:15%">
  1011. <button type="button" class="btn" wire:click="showHideCourse({{ $member_course->id }})"><i class="fa-solid fa-chevron-down"></i></button>&nbsp;
  1012. </td>
  1013. </tr>
  1014. @if(in_array($member_course->id, $showCourse))
  1015. <tr>
  1016. <td colspan="5">
  1017. <a class="{{$this->getSubscriptionStatus($member_course->subscribed, $member_course->id)}}" wire:click="setCreateSubscription({{$member_course->subscribed}}, {{$member_course->id}})" style="float:none; width:150px;{{$this->getSubscriptionStatus($member_course->subscribed,$member_course->id) == 'blue' || $this->getSubscriptionStatus($member_course->subscribed,$member_course->id) == 'orange' || $this->getSubscriptionStatus($member_course->subscribed,$member_course->id) == 'yellow' ? 'cursor:pointer' : ''}}">Iscrizione</a><br>
  1018. <a class="{{$this->getMonthStatus(9, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(9, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(9, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(9, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(9, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Set</a>&nbsp;
  1019. <a class="{{$this->getMonthStatus(10, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(10, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(10, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(10, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(10, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Ott</a>&nbsp;
  1020. <a class="{{$this->getMonthStatus(11, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(11, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(11, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(11, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(11, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Nov</a>&nbsp;
  1021. <a class="{{$this->getMonthStatus(12, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(12, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(12, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(12, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(12, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Dic</a>&nbsp;
  1022. <a class="{{$this->getMonthStatus(1, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(1, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(1, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(1, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(1, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Gen</a>&nbsp;
  1023. <a class="{{$this->getMonthStatus(2, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(2, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(2, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(2, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(2, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Feb</a>&nbsp;
  1024. <a class="{{$this->getMonthStatus(3, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(3, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(3, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(3, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(3, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Mar</a>&nbsp;
  1025. <a class="{{$this->getMonthStatus(4, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(4, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(4, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(4, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(4, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Apr</a>&nbsp;
  1026. <a class="{{$this->getMonthStatus(5, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(5, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(5, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(5, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(5, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Mag</a>&nbsp;
  1027. <a class="{{$this->getMonthStatus(6, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(6, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(6, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(6, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(6, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Giu</a>&nbsp;
  1028. <a class="{{$this->getMonthStatus(7, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(7, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(7, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(7, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(7, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Lug</a>&nbsp;
  1029. <a class="{{$this->getMonthStatus(8, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(8, '{{ $member_course->months }}', {{$member_course->id}})" {{$this->getMonthStatus(8, $member_course->months, $member_course->id) == 'blue' || $this->getMonthStatus(8, $member_course->months, $member_course->id) == 'orange' || $this->getMonthStatus(8, $member_course->months, $member_course->id) == 'yellow' ? 'style=cursor:pointer' : ''}}>Ago</a>&nbsp;
  1030. </td>
  1031. <td>
  1032. <button type="button" class="btn" wire:click="editCourse({{ $member_course->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>&nbsp;
  1033. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="deleteCourse({{ $member_course->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  1034. </td>
  1035. </tr>
  1036. <tr>
  1037. <td colspan="6">
  1038. @if($selectedCourseMember == $member_course->id)
  1039. @if(sizeof($payMonths) > 0 || $createSubscription)
  1040. <button class="btn--ui primary" style="color:white" wire:click="newPayment({{$member_course}})">Nuova entrata</button>&nbsp;
  1041. <button class="btn--ui primary" style="color:white" wire:click="block({{$member_course}})">Sospendi</button>
  1042. @endif
  1043. @if(sizeof($suspendedMonths) > 0)
  1044. <button class="btn--ui primary" style="color:white" wire:click="reactivate({{$member_course}})">Riattiva</button>&nbsp;
  1045. @endif<br>
  1046. @endif
  1047. @if($member_course->notes != '')
  1048. <br><b>Note</b><br>
  1049. {{$member_course->notes}}
  1050. @endif
  1051. </td>
  1052. </tr>
  1053. @endif
  1054. @endforeach
  1055. </tbody>
  1056. </table>
  1057. <button class="btn--ui primary"wire:click.prevent="addCourse()" style="max-width:200px">Aggiungi</button>
  1058. @else
  1059. <div class="form--wrapper">
  1060. <form class="form--utente">
  1061. @if(false)
  1062. <div class="row ">
  1063. <div class="col-md-6">
  1064. <label for="course_course_id" class="form-label">Corso</label>
  1065. <select id="course_course_id" class="form-select @error('course_course_id') is-invalid @enderror" aria-label="Corso" wire:model="course_course_id" >
  1066. <option value="">
  1067. @foreach($courses as $course)
  1068. <option value="{{$course->id}}">{{$course->name}} - {{$course->level->name ?? ""}} - {{$course->type->name ?? ""}} - {{$course->frequency->name ?? ""}}
  1069. @endforeach
  1070. </select>
  1071. @if($course_exist)
  1072. <small style="color:red">Attenzione : il corso selezionato è già associato all'utente</small>
  1073. @endif
  1074. </div>
  1075. </div>
  1076. @endif
  1077. <div class="row ">
  1078. <div class="col-md-3">
  1079. <label for="course_name" class="form-label">Corso</label>
  1080. <select id="course_name" class="form-select @error('course_course_id') is-invalid @enderror" aria-label="Corso" wire:model="course_name" >
  1081. <option value="">
  1082. @foreach($course_names as $n)
  1083. <option value="{{$n}}">{{$n}}
  1084. @endforeach
  1085. </select>
  1086. @error('course_course_id')
  1087. <div class="invalid-feedback">Devi selezionare un corso (corso, livello, tipologia e frequenza)</div>
  1088. @enderror
  1089. @if($course_exist)
  1090. <small style="color:red">Attenzione : il corso selezionato è già associato all'utente</small>
  1091. @endif
  1092. </div>
  1093. @if($course_name != '')
  1094. <div class="col-md-3">
  1095. <label for="course_level_id" class="form-label">Livello</label>
  1096. <select id="course_level_id" class="form-select" aria-label="Livello" wire:model="course_level_id" >
  1097. <option value="">
  1098. @foreach($course_levels as $l)
  1099. <option value="{{$l->id}}">{{$l->name}}
  1100. @endforeach
  1101. </select>
  1102. </div>
  1103. @endif
  1104. @if($course_level_id != '')
  1105. <div class="col-md-3">
  1106. <label for="course_type_id" class="form-label">Tipologia</label>
  1107. <select id="course_type_id" class="form-select" aria-label="Tipologia" wire:model="course_type_id" >
  1108. <option value="">
  1109. @foreach($course_types as $t)
  1110. <option value="{{$t->id}}">{{$t->name}}
  1111. @endforeach
  1112. </select>
  1113. </div>
  1114. @endif
  1115. @if($course_type_id != '')
  1116. <div class="col-md-3">
  1117. <label for="course_frequency_id" class="form-label">Frequenza</label>
  1118. <select id="course_frequency_id" class="form-select" aria-label="Tipologia" wire:model="course_frequency_id" >
  1119. <option value="">
  1120. @foreach($course_frequencies as $f)
  1121. <option value="{{$f->id}}">{{$f->name}}
  1122. @endforeach
  1123. </select>
  1124. </div>
  1125. @endif
  1126. </div>
  1127. <div class="row mt-4">
  1128. <div class="col-md-6">
  1129. <label for="course_course_subscription_id" class="form-label">Abbonamento</label>
  1130. <select id="course_course_subscription_id" class="form-select @error('course_course_subscription_id') is-invalid @enderror" aria-label="Abbonamento" wire:model="course_course_subscription_id">
  1131. <option value="">
  1132. @foreach($course_subscriptions as $t)
  1133. <option value="{{$t["id"]}}">{{$t["name"]}}
  1134. @endforeach
  1135. </select>
  1136. </div>
  1137. <div class="col-md-6">
  1138. <label for="course_price" class="form-label">Costo mensile</label>
  1139. <input class="form-control" type="text" id="course_price" placeholder="Costo mensile" wire:model="course_price" onkeyup="onlyNumberAmount(this)">
  1140. </div>
  1141. @if(false)
  1142. <div class="col-md-6">
  1143. <label for="course_status" class="form-label">Stato iscrizione</label>
  1144. <select id="course_status" class="form-select @error('course_status') is-invalid @enderror" aria-label="Stato" wire:model="course_status">
  1145. <option value="">
  1146. <option value="1">Pagata
  1147. <option value="2">Da pagare
  1148. <option value="3">Sospesa
  1149. </select>
  1150. </div>
  1151. @endif
  1152. </div>
  1153. <div class="row mt-4 course--duration">
  1154. <div class="col-md-12">
  1155. <label for="duration" class="form-label">Durata del corso</label>
  1156. <div class="d-flex course--duration_mounth">
  1157. <a class="{{$this->checkMonth(9) ? 'selected' : 'notSelected'}}" wire:click="setMonth(9)">Set</a>
  1158. <a class="{{$this->checkMonth(10) ? 'selected' : 'notSelected'}}" wire:click="setMonth(10)">Ott</a>
  1159. <a class="{{$this->checkMonth(11) ? 'selected' : 'notSelected'}}" wire:click="setMonth(11)">Nov</a>
  1160. <a class="{{$this->checkMonth(12) ? 'selected' : 'notSelected'}}" wire:click="setMonth(12)">Dic</a>
  1161. <a class="{{$this->checkMonth(1) ? 'selected' : 'notSelected'}}" wire:click="setMonth(1)">Gen</a>
  1162. <a class="{{$this->checkMonth(2) ? 'selected' : 'notSelected'}}" wire:click="setMonth(2)">Feb</a>
  1163. <a class="{{$this->checkMonth(3) ? 'selected' : 'notSelected'}}" wire:click="setMonth(3)">Mar</a>
  1164. <a class="{{$this->checkMonth(4) ? 'selected' : 'notSelected'}}" wire:click="setMonth(4)">Apr</a>
  1165. <a class="{{$this->checkMonth(5) ? 'selected' : 'notSelected'}}" wire:click="setMonth(5)">Mag</a>
  1166. <a class="{{$this->checkMonth(6) ? 'selected' : 'notSelected'}}" wire:click="setMonth(6)">Giu</a>
  1167. <a class="{{$this->checkMonth(7) ? 'selected' : 'notSelected'}}" wire:click="setMonth(7)">Lug</a>
  1168. <a class="{{$this->checkMonth(8) ? 'selected' : 'notSelected'}}" wire:click="setMonth(8)">Ago</a>
  1169. </div>
  1170. </div>
  1171. </div>
  1172. <div class="row mt-4">
  1173. <div class="col-md-6">
  1174. <label for="course_subscription_price" class="form-label">Costo iscrizione</label>
  1175. <input class="form-control" type="text" id="course_subscription_price" placeholder="Costo iscrizione" wire:model="course_subscription_price" onkeyup="onlyNumberAmount(this)">
  1176. </div>
  1177. </div>
  1178. @if(false)
  1179. <div class="row mt-4">
  1180. <div class="col-md-6">
  1181. <label for="course_date_from" class="form-label">Dal</label>
  1182. <input class="form-control" type="date" id="course_date_from" placeholder="Dal" wire:model="course_date_from">
  1183. </div>
  1184. <div class="col-md-6">
  1185. <label for="course_date_to" class="form-label">Al</label>
  1186. <input class="form-control" type="date" id="course_date_to" placeholder="Al" wire:model="course_date_to">
  1187. </div>
  1188. </div>
  1189. @endif
  1190. @foreach($course_when as $idW => $when)
  1191. <div class="row">
  1192. <div class="col-12">
  1193. <div class="day durata--corso d-flex">
  1194. <label for="" class="form-label">Giorno</label>
  1195. <div class="durata--corso_days mb-3">
  1196. <a class="{{in_array('lun', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'lun')">Lun</a>
  1197. <a class="{{in_array('mar', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'mar')">Mar</a>
  1198. <a class="{{in_array('mer', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'mer')">Mer</a>
  1199. <a class="{{in_array('gio', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'gio')">Gio</a>
  1200. <a class="{{in_array('ven', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'ven')">Ven</a>
  1201. <a class="{{in_array('sab', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'sab')">Sab</a>
  1202. <a class="{{in_array('dom', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'dom')">Dom</a>
  1203. </div>
  1204. <div class="durata--corso_select">
  1205. <div class="from--h me-3">
  1206. <label for="" class="form-label">Dalle</label>
  1207. <select class="form-select" wire:model="course_when.{{$idW}}.from">
  1208. <option value="">--Seleziona--
  1209. @for($c=6;$c<=23;$c++)
  1210. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00
  1211. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30
  1212. @endfor
  1213. </select>
  1214. </div>
  1215. <div class="to--h">
  1216. <label for="" class="form-label">Alle</label>
  1217. <select class="form-select" wire:model="course_when.{{$idW}}.to">
  1218. <option value="">--Seleziona--
  1219. @for($c=6;$c<=23;$c++)
  1220. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00
  1221. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30
  1222. @endfor
  1223. </select>
  1224. </div>
  1225. </div>
  1226. <button class="btn--ui primary remove--day position-absolute" wire:click.prevent="delRow({{$idW}})"><i class="fa-solid fa-minus"></i></button>
  1227. <button class="btn--ui primary add--day position-absolute" wire:click.prevent="addRow()"><i class="fa-solid fa-plus"></i></button>
  1228. </div>
  1229. </div>
  1230. </div>
  1231. @endforeach
  1232. <div class="row mt-2">
  1233. <div class="col-md-12">
  1234. <label for="course_date_from" class="form-label">Note</label>
  1235. <input class="form-control" type="text" id="course_note" placeholder="Note" wire:model="course_note">
  1236. </div>
  1237. </div>
  1238. </form>
  1239. </div>
  1240. <br>
  1241. <div class="row mt-2">
  1242. <div class="col-md-12">
  1243. <button class="btn--ui lightGrey" wire:click.prevent="cancelCourse()">Annulla</button>
  1244. @if($addCourse)
  1245. @if(!$course_exist)
  1246. <button class="btn--ui primary" wire:click.prevent="storeCourse()">Salva corso</button>
  1247. @endif
  1248. @endif
  1249. @if($updateCourse)
  1250. <button class="btn--ui primary" wire:click.prevent="updateCourse()">Salva corso</button>
  1251. @endif
  1252. </div>
  1253. </div>
  1254. @endif
  1255. @endif
  1256. @endif
  1257. </div>
  1258. </div>
  1259. <div class="col-md-5 col-xl-4 p-3">
  1260. <div id="card--resume" class="primary card--ui ms-3 user--resume">
  1261. <header>
  1262. <div class="username d-flex align-items-start">
  1263. <i class="ico--ui utenti light me-2"></i>
  1264. <div class="user--resume_name d-flex flex-column">
  1265. <span class="user-name">{{ strtoupper($first_name) }} {{ strtoupper($last_name) }}</span>
  1266. <span class="user-email">{{ $birth_date ? date("d/m/Y", strtotime($birth_date)) : '' }}{!!$age != '' ? ' (' . $age . ')' : ''!!}</span>
  1267. </div>
  1268. </div>
  1269. </header>
  1270. <div class="card--resume_body">
  1271. <ul class="user-address mb-4 p-0">
  1272. <li><i class="ico--ui resume--ico phone me-2"></i><span>Tel. {{ $phone }}</span></li>
  1273. <li><i class="ico--ui resume--ico mail light me-2"></i><span>{{ $email }}</span></li>
  1274. </ul>
  1275. <ul class="user-residence p-0">
  1276. <li><i class="ico--ui resume--ico residence me-2"></i>
  1277. <span>
  1278. @if($city_id > 0)
  1279. {{$this->getCity($city_id)}}
  1280. @if($province_id > 0)
  1281. ( {{$this->getProvince($province_id)}} ) -
  1282. @endif
  1283. @endif
  1284. {{ $zip_code }}<br>
  1285. {{ $address }}
  1286. </span>
  1287. </li>
  1288. </ul>
  1289. <div class="resume--tab_info credito">
  1290. <h2 class="mb-3">Borsellino MAD</h2>
  1291. <span class="value">{{formatPrice($money)}}</span>
  1292. </div>
  1293. <div class="resume--tab_info gruppi corsi">
  1294. <h2 class="mb-3">Corsi</h2>
  1295. @foreach($member_courses as $member_course)
  1296. <div class="resume--info d-flex align-items-center">
  1297. <div class="row" style="margin-top:10px">
  1298. <div class="row">
  1299. <strong>{{$member_course->course->getTree()}}</strong></span><br>
  1300. </div>
  1301. <div class="row">
  1302. <span class="title-detail">
  1303. @php
  1304. $aMo = json_decode($member_course->months);
  1305. if (sizeof($aMo) == 1)
  1306. {
  1307. print($this->getMonth($aMo[0]->m));
  1308. }
  1309. if (sizeof($aMo) > 1)
  1310. {
  1311. print($this->getMonth($aMo[0]->m) . " - " . $this->getMonth($aMo[sizeof($aMo) - 1]->m));
  1312. }
  1313. @endphp
  1314. </span>
  1315. </div>
  1316. <div class="row">
  1317. <span class="title-detail">
  1318. @foreach(json_decode($member_course->when) as $xx => $x)
  1319. @if($xx > 0)
  1320. <br>
  1321. @endif
  1322. @foreach($x->day as $d)
  1323. {{$d}}
  1324. @endforeach
  1325. {{$x->from}} - {{$x->to}}
  1326. @endforeach
  1327. </span>
  1328. </div>
  1329. </div>
  1330. </div>
  1331. @endforeach
  1332. </div>
  1333. <div class="resume--tab_info tesseramento">
  1334. <h2 class="mb-3">Tesseramento</h2>
  1335. @foreach($member_cards as $member_card)
  1336. @if($member_card->expire_date . " 23:59:59" > date("Y-m-d"))
  1337. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1338. <div class="resume--info d-flex align-items-start">
  1339. <i class="ico--ui tessera me-2"></i>
  1340. <div class="title--tessera_added">
  1341. <h4>{{$member_card->card->name}}</h4>
  1342. <span class="title-detail">Scadenza: <span class="title-detail_date">{{$member_card->expire_date ? date("d/m/Y", strtotime($member_card->expire_date)) : ''}}</span></span></small>
  1343. @if($member_card->discipline_1)
  1344. </br>
  1345. <span class="title-detail">Disciplina : <b>{{$member_card->discipline_1->name}}</b></span>
  1346. @endif
  1347. @if($member_card->discipline_2)
  1348. </br>
  1349. <span class="title-detail">Disciplina : <b>{{$member_card->discipline_2->name}}</b></span>
  1350. @endif
  1351. @if($member_card->discipline_3)
  1352. </br>
  1353. <span class="title-detail">Disciplina : <b>{{$member_card->discipline_3->name}}</b></span>
  1354. @endif
  1355. </div>
  1356. </div>
  1357. <span class="badge tessera-badge active">attiva</span>
  1358. </div>
  1359. @endif
  1360. @endforeach
  1361. <!--
  1362. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1363. <div class="resume--info d-flex align-items-start">
  1364. <i class="ico--ui tessera me-2"></i>
  1365. <div class="title--tessera_added">
  1366. <h4>Tennis/Corso Tennis/Adulti/Bisettimanale</h4>
  1367. <span class="title-detail">Iscrizione: <span class="title-detail_date">12 marzo 2022</span></span></small>
  1368. </div>
  1369. </div>
  1370. <span class="badge tessera-badge active">attiva</span>
  1371. </div>-->
  1372. </div>
  1373. <div class="resume--tab_info tesseramento">
  1374. <h2 class="mb-3">Certificato</h2>
  1375. @if(sizeof($member_certificates) > 0)
  1376. @php
  1377. $cert = $member_certificates[0]
  1378. @endphp
  1379. @if($cert->expire_date . " 23:59:59" > date("Y-m-d"))
  1380. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1381. <div class="resume--info d-flex align-items-start">
  1382. <i class="fa-regular fa-file-lines me-2"></i>
  1383. <div class="title--tessera_added">
  1384. <h4>{{$cert->type == 'A' ? 'Agonistico' : 'Non agonistico'}}</h4>
  1385. <span class="title-detail">Scadenza: <span class="title-detail_date">{{$cert->expire_date ? date("d/m/Y", strtotime($cert->expire_date)) : ''}}</span></span></small>
  1386. </div>
  1387. </div>
  1388. @if($cert->expire_date . " 23:59:59" < date("Y-m-d"))
  1389. <span class="badge tessera-badge suspended">scaduto</span>
  1390. @endif
  1391. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d") && $cert->expire_date < date("Y-m-d", strtotime("+1 month")))
  1392. <span class="badge tessera-badge due">in scadenza</span>
  1393. @endif
  1394. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d", strtotime("+1 month")))
  1395. <span class="badge tessera-badge active">valido</span>
  1396. @endif
  1397. </div>
  1398. @endif
  1399. @endif
  1400. <!--
  1401. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1402. <div class="resume--info d-flex align-items-start">
  1403. <i class="ico--ui tessera me-2"></i>
  1404. <div class="title--tessera_added">
  1405. <h4>Tennis/Corso Tennis/Adulti/Bisettimanale</h4>
  1406. <span class="title-detail">Iscrizione: <span class="title-detail_date">12 marzo 2022</span></span></small>
  1407. </div>
  1408. </div>
  1409. <span class="badge tessera-badge active">attiva</span>
  1410. </div>-->
  1411. </div>
  1412. <div class="resume--tab_info gruppi">
  1413. <h2 class="mb-3">Gruppi di appartenenza</h2>
  1414. @foreach($member_categories as $member_category)
  1415. <div class="resume--info d-flex align-items-center">
  1416. <i class="ico--ui gruppi me-2"></i><span><strong>{{$member_category->category->getTree()}}</strong></span>
  1417. </div>
  1418. @endforeach
  1419. </div>
  1420. </div>
  1421. </div>
  1422. </div>
  1423. </div>
  1424. </div>
  1425. <!-- save & continue section -->
  1426. <section class="save--section d-flex justify-content-start">
  1427. <div class="container">
  1428. <div class="row">
  1429. <div class="col-md-7 col-xl-8 d-flex gx-0">
  1430. @if($add)
  1431. <button class="btn--ui primary d-flex order-1 me-2" wire:click="store(false)">salva e continua</button>
  1432. <button class="btn--ui primary d-flex order-3 ms-auto" wire:click="store(true)">salva e chiudi</button>
  1433. @endif
  1434. @if($update)
  1435. <button class="btn--ui primary d-flex order-1 me-2" wire:click="updateAAA(false)">salva e continua</button>
  1436. <button class="btn--ui primary d-flex order-3 ms-auto" wire:click="updateAAA(true)">salva e chiudi</button>
  1437. @endif
  1438. <button class="btn--ui lightGrey" onclick="annulla()" style="margin-right:10px">annulla</button><br><br>
  1439. </div>
  1440. <div class="col-md-5 col-xl-4"></div>
  1441. </div>
  1442. </div>
  1443. </section>
  1444. @endif
  1445. </div>
  1446. @endif
  1447. <div wire:ignore.self class="modal fade" id="userModal" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
  1448. <div class="modal-dialog">
  1449. <div class="modal-content">
  1450. <div class="modal-header">
  1451. <h5 class="modal-title" id="userModalLabel">Modifica borsellino</h5>
  1452. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1453. </div>
  1454. <div class="modal-body">
  1455. <div class="row">
  1456. <div class="col-md-6">
  1457. <label for="newMemberFirstName" class="form-label">Importo</label>
  1458. <input class="form-control " type="text" id="importoBorsellino" >
  1459. </div>
  1460. </div>
  1461. </div>
  1462. <div class="modal-footer">
  1463. <button type="button" class="btn--ui lightGrey" data-bs-dismiss="modal">Annulla</button>
  1464. <button type="button" class="btn--ui btn-primary" onclick="updateBorsellino('-')">Decrementa</button>
  1465. <button type="button" class="btn--ui btn-primary" onclick="updateBorsellino('+')">Aumenta</button>
  1466. </div>
  1467. </div>
  1468. </div>
  1469. </div>
  1470. </div>
  1471. @push('scripts')
  1472. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  1473. <style>
  1474. table.tableHead thead {
  1475. /* Important */
  1476. position: sticky;
  1477. z-index: 100;
  1478. top: 0;
  1479. }
  1480. .select2-container--default .select2-selection--single{
  1481. background-color: #E9F0F5;
  1482. border: 0.0625rem solid #DFE5EB;
  1483. font-size: 0.75rem;
  1484. }
  1485. .select2-selection
  1486. {
  1487. height: 38px !important;
  1488. }
  1489. .select2-selection__rendered
  1490. {
  1491. padding-top:3px;
  1492. }
  1493. .select2
  1494. {
  1495. width:100% !important;
  1496. }
  1497. a.notSelected
  1498. {
  1499. display: flex;
  1500. margin-right:10px;
  1501. float:left;
  1502. height: 2.5rem !important;
  1503. width:50px;
  1504. align-items: center;
  1505. justify-content: center;
  1506. color: #006099;
  1507. background-color: #d3dce1 !important;
  1508. padding: 0 1.25rem;
  1509. font-size: 0.875rem;
  1510. font-family: greycliff-cf, sans-serif;
  1511. border-radius: 1.875rem !important;
  1512. -webkit-border-radius: 1.875rem !important;
  1513. -moz-border-radius: 1.875rem !important;
  1514. -webkit-transition: all 0.3s ease-in-out;
  1515. -moz-transition: all 0.3s ease-in-out;
  1516. -o-transition: all 0.3s ease-in-out;
  1517. transition: all 0.3s ease-in-out;
  1518. border: none;
  1519. }
  1520. a.selected
  1521. {
  1522. display: flex;
  1523. margin-right:10px;
  1524. float:left;
  1525. height: 2.5rem !important;
  1526. width:50px;
  1527. align-items: center;
  1528. justify-content: center;
  1529. color: #fff;
  1530. background-color: #006099 !important;
  1531. padding: 0 1.25rem;
  1532. font-size: 0.875rem;
  1533. font-family: greycliff-cf, sans-serif;
  1534. border-radius: 1.875rem !important;
  1535. -webkit-border-radius: 1.875rem !important;
  1536. -moz-border-radius: 1.875rem !important;
  1537. -webkit-transition: all 0.3s ease-in-out;
  1538. -moz-transition: all 0.3s ease-in-out;
  1539. -o-transition: all 0.3s ease-in-out;
  1540. transition: all 0.3s ease-in-out;
  1541. border: none;
  1542. }
  1543. div.day
  1544. {
  1545. margin-top:20px;
  1546. color: #006099;
  1547. background-color: #ffffff !important;
  1548. padding: 20px;
  1549. border-radius: 1.875rem !important;
  1550. -webkit-border-radius: 1.875rem !important;
  1551. -moz-border-radius: 1.875rem !important;
  1552. -webkit-transition: all 0.3s ease-in-out;
  1553. -moz-transition: all 0.3s ease-in-out;
  1554. -o-transition: all 0.3s ease-in-out;
  1555. transition: all 0.3s ease-in-out;
  1556. border: 2px solid #d3dce1;
  1557. }
  1558. /* a.grey
  1559. {
  1560. display: flex;
  1561. margin-right:10px;
  1562. float:left;
  1563. height: 2.5rem !important;
  1564. width:50px;
  1565. align-items: center;
  1566. justify-content: center;
  1567. color: #006099;
  1568. background-color: #d3dce1 !important;
  1569. padding: 0 1.25rem;
  1570. font-size: 0.875rem;
  1571. font-family: greycliff-cf, sans-serif;
  1572. border-radius: 1.875rem !important;
  1573. -webkit-border-radius: 1.875rem !important;
  1574. -moz-border-radius: 1.875rem !important;
  1575. -webkit-transition: all 0.3s ease-in-out;
  1576. -moz-transition: all 0.3s ease-in-out;
  1577. -o-transition: all 0.3s ease-in-out;
  1578. transition: all 0.3s ease-in-out;
  1579. border: none;
  1580. }
  1581. a.blue
  1582. {
  1583. display: flex;
  1584. margin-right:10px;
  1585. float:left;
  1586. height: 2.5rem !important;
  1587. width:50px;
  1588. align-items: center;
  1589. justify-content: center;
  1590. color: #fff;
  1591. background-color: #006099 !important;
  1592. padding: 0 1.25rem;
  1593. font-size: 0.875rem;
  1594. font-family: greycliff-cf, sans-serif;
  1595. border-radius: 1.875rem !important;
  1596. -webkit-border-radius: 1.875rem !important;
  1597. -moz-border-radius: 1.875rem !important;
  1598. -webkit-transition: all 0.3s ease-in-out;
  1599. -moz-transition: all 0.3s ease-in-out;
  1600. -o-transition: all 0.3s ease-in-out;
  1601. transition: all 0.3s ease-in-out;
  1602. border: none;
  1603. }
  1604. a.yellow
  1605. {
  1606. display: flex;
  1607. margin-right:10px;
  1608. float:left;
  1609. height: 2.5rem !important;
  1610. width:50px;
  1611. align-items: center;
  1612. justify-content: center;
  1613. color: #fff;
  1614. background-color: #ffe238;
  1615. padding: 0 1.25rem;
  1616. font-size: 0.875rem;
  1617. font-family: greycliff-cf, sans-serif;
  1618. border-radius: 1.875rem !important;
  1619. -webkit-border-radius: 1.875rem !important;
  1620. -moz-border-radius: 1.875rem !important;
  1621. -webkit-transition: all 0.3s ease-in-out;
  1622. -moz-transition: all 0.3s ease-in-out;
  1623. -o-transition: all 0.3s ease-in-out;
  1624. transition: all 0.3s ease-in-out;
  1625. border: none;
  1626. }
  1627. a.orange
  1628. {
  1629. display: flex;
  1630. margin-right:10px;
  1631. float:left;
  1632. height: 2.5rem !important;
  1633. width:50px;
  1634. align-items: center;
  1635. justify-content: center;
  1636. color: #fff;
  1637. background-color: #FF7E38;
  1638. padding: 0 1.25rem;
  1639. font-size: 0.875rem;
  1640. font-family: greycliff-cf, sans-serif;
  1641. border-radius: 1.875rem !important;
  1642. -webkit-border-radius: 1.875rem !important;
  1643. -moz-border-radius: 1.875rem !important;
  1644. -webkit-transition: all 0.3s ease-in-out;
  1645. -moz-transition: all 0.3s ease-in-out;
  1646. -o-transition: all 0.3s ease-in-out;
  1647. transition: all 0.3s ease-in-out;
  1648. border: none;
  1649. }
  1650. a.green
  1651. {
  1652. display: flex;
  1653. margin-right:10px;
  1654. float:left;
  1655. height: 2.5rem !important;
  1656. width:50px;
  1657. align-items: center;
  1658. justify-content: center;
  1659. color: #fff;
  1660. background-color: green;
  1661. padding: 0 1.25rem;
  1662. font-size: 0.875rem;
  1663. font-family: greycliff-cf, sans-serif;
  1664. border-radius: 1.875rem !important;
  1665. -webkit-border-radius: 1.875rem !important;
  1666. -moz-border-radius: 1.875rem !important;
  1667. -webkit-transition: all 0.3s ease-in-out;
  1668. -moz-transition: all 0.3s ease-in-out;
  1669. -o-transition: all 0.3s ease-in-out;
  1670. transition: all 0.3s ease-in-out;
  1671. border: none;
  1672. }
  1673. .btn--ui
  1674. {
  1675. -webkit-border-radius: 0.5rem !important;
  1676. background-color:#0C6197 !important;
  1677. font-weight:normal;
  1678. } */
  1679. .btn--ui.lightGrey, .btn--ui.extraLightGrey
  1680. {
  1681. -webkit-border-radius: 0.5rem !important;
  1682. background-color:#ffffff !important;
  1683. border: 1px solid grey;
  1684. color: black;
  1685. font-weight:normal;
  1686. }
  1687. </style>
  1688. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  1689. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  1690. @endpush
  1691. @push('scripts')
  1692. <script>
  1693. function matchStart(params, data) {
  1694. params.term = params.term || '';
  1695. if (data.text.toUpperCase().indexOf(params.term.toUpperCase()) == 0) {
  1696. return data;
  1697. }
  1698. return false;
  1699. }
  1700. var nation_id = {{$nation_id > 0 ? $nation_id : 0}};
  1701. var province_id = 0;
  1702. /*
  1703. $('.nationClass').select2({
  1704. // theme: 'bootstrap4',
  1705. ajax: {
  1706. url: '/nations',
  1707. dataType: 'json'
  1708. }
  1709. });
  1710. $('.nationClass').on('change', function (e) {
  1711. nation_id = $('.nationClass').select2("val");
  1712. @this.set('nation_id', nation_id);
  1713. @this.set('province_id', 0);
  1714. @this.set('city_id', 0);
  1715. @this.checkIsItaly();
  1716. });
  1717. $('.provinceClass').select2({
  1718. ajax: {
  1719. url: '/provinces/' + nation_id,
  1720. dataType: 'json'
  1721. }
  1722. });
  1723. $('.cityClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});*/
  1724. var nation_birth_id = 0;
  1725. var province_birth_id = 0;
  1726. /*
  1727. $('.nationBirthClass').select2({
  1728. // theme: 'bootstrap4',
  1729. ajax: {
  1730. url: '/nations',
  1731. dataType: 'json'
  1732. }
  1733. });
  1734. $('.nationBirthClass').on('change', function (e) {
  1735. nation_birth_id = $('.nationBirthClass').select2("val");
  1736. @this.set('birth_nation_id', nation_birth_id);
  1737. @this.set('birth_province_id', 0);
  1738. @this.set('birth_city_id', 0);
  1739. @this.checkIsBirthItaly();
  1740. });
  1741. $('.provinceBirthClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1742. $('.cityBirthClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});*/
  1743. Livewire.on('load-select', () => {
  1744. loadCombo();
  1745. });
  1746. function updateBorsellino(verse)
  1747. {
  1748. var importoBorsellino = $("#importoBorsellino").val();
  1749. @this.updateBorsellino(importoBorsellino, verse);
  1750. }
  1751. Livewire.on('load-provinces', (nation_id, element) => {
  1752. $('.' + element).select2({
  1753. ajax: {
  1754. url: '/provinces/' + nation_id,
  1755. dataType: 'json'
  1756. }
  1757. });
  1758. });
  1759. Livewire.on('load-cities', (province_id, element) => {
  1760. $('.' + element).select2({
  1761. ajax: {
  1762. url: '/cities/' + province_id,
  1763. dataType: 'json'
  1764. }
  1765. });
  1766. });
  1767. Livewire.on('hide-search', () => {
  1768. //pcsh2();
  1769. });
  1770. Livewire.on('setIds', (nation_id_x, birth_nation_id_x) => {
  1771. nation_id = nation_id_x;
  1772. nation_birth_id = birth_nation_id_x;
  1773. });
  1774. function loadCombo()
  1775. {
  1776. $('.nationClass').select2({
  1777. ajax: {
  1778. url: '/nations',
  1779. dataType: 'json'
  1780. }
  1781. });
  1782. $('.nationClass').on('change', function (e) {
  1783. nation_id = $('.nationClass').select2("val");
  1784. province_id = 0;
  1785. @this.set('nation_id', nation_id);
  1786. @this.set('province_id', 0);
  1787. @this.set('city_id', 0);
  1788. @this.checkIsItaly();
  1789. });
  1790. $('.provinceClass').select2({
  1791. ajax: {
  1792. url: '/provinces/' + nation_id,
  1793. dataType: 'json'
  1794. }
  1795. });
  1796. $('.provinceClass').on('change', function (e) {
  1797. province_id = $('.provinceClass').select2("val");
  1798. @this.set('province_id', province_id);
  1799. @this.set('city_id', 0);
  1800. });
  1801. $('.cityClass').select2({
  1802. ajax: {
  1803. url: '/cities/' + province_id,
  1804. dataType: 'json'
  1805. }
  1806. });
  1807. $('.cityClass').on('change', function (e) {
  1808. var data = $('.cityClass').select2("val");
  1809. @this.set('city_id', data);
  1810. });
  1811. $('.nationBirthClass').select2({
  1812. ajax: {
  1813. url: '/nations',
  1814. dataType: 'json'
  1815. }
  1816. });
  1817. $('.nationBirthClass').on('change', function (e) {
  1818. nation_birth_id = $('.nationBirthClass').select2("val");
  1819. province_birth_id = 0;
  1820. @this.set('birth_nation_id', nation_birth_id);
  1821. @this.set('birth_province_id', 0);
  1822. @this.set('birth_city_id', 0);
  1823. @this.checkIsBirthItaly();
  1824. });
  1825. $('.provinceBirthClass').select2({
  1826. ajax: {
  1827. url: '/provinces/' + nation_birth_id,
  1828. dataType: 'json'
  1829. }
  1830. });
  1831. $('.provinceBirthClass').on('change', function (e) {
  1832. province_birth_id = $('.provinceBirthClass').select2("val");
  1833. @this.set('birth_province_id', province_birth_id);
  1834. @this.set('birth_city_id', 0);
  1835. });
  1836. $('.cityBirthClass').select2({
  1837. ajax: {
  1838. url: '/cities/' + province_birth_id,
  1839. dataType: 'json'
  1840. }
  1841. });
  1842. $('.cityBirthClass').on('change', function (e) {
  1843. var data = $('.cityBirthClass').select2("val");
  1844. @this.set('birth_city_id', data);
  1845. });
  1846. $('.card_card_id').select2({
  1847. matcher: function(params, data) {
  1848. return matchStart(params, data);
  1849. }
  1850. });
  1851. $('.card_card_id').on('change', function (e) {
  1852. var data = $('.card_card_id').select2("val");
  1853. @this.set('card_card_id', data);
  1854. });
  1855. $('.certificate_type').select2({
  1856. matcher: function(params, data) {
  1857. return matchStart(params, data);
  1858. }
  1859. });
  1860. $('.certificate_type').on('change', function (e) {
  1861. var data = $('.certificate_type').select2("val");
  1862. @this.set('certificate_type', data);
  1863. });
  1864. $('.categoriesClass').select2({
  1865. matcher: function(params, data) {
  1866. return matchStart(params, data);
  1867. }
  1868. });
  1869. $('.categoriesClass').on('change', function (e) {
  1870. var data = $('.categoriesClass').select2("val");
  1871. @this.set('category_category_id', data);
  1872. });
  1873. $('.coursesClass').select2({
  1874. matcher: function(params, data) {
  1875. return matchStart(params, data);
  1876. }
  1877. });
  1878. $('.coursesClass').on('change', function (e) {
  1879. var data = $('.coursesClass').select2("val");
  1880. @this.set('course_course_id', data);
  1881. });
  1882. }
  1883. @if($refreshAfter == 1)
  1884. setTimeout(() => {
  1885. loadCombo();
  1886. }, 100)
  1887. @endif
  1888. function onlyNumberAmount(input) {
  1889. let v = input.value.replace(/\D+/g, '');
  1890. if (v.length > 14) v = v.slice(0, 14);
  1891. input.value = "€ " + v.replace(/(\d)(\d\d)$/, "$1,$2").replace(/(^\d{1,3}|\d{3})(?=(?:\d{3})+(?:,|$))/g, '$1.');
  1892. }
  1893. </script>
  1894. @endpush
  1895. @push('scripts')
  1896. <link href="/css/datatables.css" rel="stylesheet" />
  1897. <script src="/assets/js/datatables.js"></script>
  1898. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  1899. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  1900. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  1901. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  1902. @endpush
  1903. @push('scripts')
  1904. <script>
  1905. function showData(id)
  1906. {
  1907. @this.showDetailF(id);
  1908. }
  1909. function editData(id)
  1910. {
  1911. @this.edit(id);
  1912. }
  1913. function deleteData(id)
  1914. {
  1915. if (confirm('Sei sicuro?'))
  1916. @this.delete(id);
  1917. }
  1918. var isFilter = false;
  1919. $(document).ready(function() {
  1920. $(document).on("click",".showHideFilter",function() {
  1921. if (isFilter)
  1922. {
  1923. isFilter = false;
  1924. $(".showFilter").hide();
  1925. }
  1926. else
  1927. {
  1928. isFilter = true;
  1929. $(".showFilter").show();
  1930. }
  1931. });
  1932. } );
  1933. $(document).ready(function() {
  1934. loadDataTable();
  1935. } );
  1936. Livewire.on('load-data-table', () => {
  1937. setTimeout(function() {loadDataTable()}, 100);
  1938. });
  1939. Livewire.on('destroy-data-table', () => {
  1940. $('#tablesaw-350').DataTable().destroy();
  1941. });
  1942. function destroyDataTable()
  1943. {
  1944. $('#tablesaw-350').DataTable().destroy();
  1945. }
  1946. $('.filterCards').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1947. $('.filterStatus').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1948. $('.filterScadenza').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1949. $('.filterCertificateType').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1950. $('.filterCategories').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1951. @if(isset($_GET["showFilters"]))
  1952. var filterStatus = localStorage.getItem("filterStatusMember");
  1953. if (filterStatus)
  1954. {
  1955. $('.filterStatus').val(filterStatus).trigger('change');
  1956. }
  1957. var filterCards = localStorage.getItem("filterCardsMember");
  1958. if (filterCards)
  1959. {
  1960. $('.filterCards').val(filterCards).trigger('change');
  1961. }
  1962. var filterScadenza = localStorage.getItem("filterScadenzaMember");
  1963. if (filterScadenza)
  1964. {
  1965. $('.filterScadenza').val(filterScadenza).trigger('change');
  1966. }
  1967. var filterCertificateType = localStorage.getItem("filterCertificateTypeMember");
  1968. if (filterCertificateType)
  1969. {
  1970. $('.filterCertificateType').val(filterCertificateType).trigger('change');
  1971. }
  1972. var filterCategories = localStorage.getItem("filterCategoriesMember");
  1973. if (filterCategories)
  1974. {
  1975. $('.filterCategories').val(filterCategories).trigger('change');
  1976. }
  1977. var fromYear = localStorage.getItem("fromYearMember");
  1978. if (fromYear)
  1979. {
  1980. $('input[name="txtFromYear"]').val(fromYear);
  1981. }
  1982. var toYear = localStorage.getItem("toYearMember");
  1983. if (toYear)
  1984. {
  1985. $('input[name="txtToYear"]').val(toYear);
  1986. }
  1987. var fromYearYear = localStorage.getItem("fromYearYearMember");
  1988. if (fromYearYear)
  1989. {
  1990. $('input[name="txtFromYearYear"]').val(fromYearYear);
  1991. }
  1992. var toYearYear = localStorage.getItem("toYearYearMember");
  1993. if (toYearYear)
  1994. {
  1995. $('input[name="txtToYearYear"]').val(toYearYear);
  1996. }
  1997. @endif
  1998. $(document).on("keypress", $('.filterCategories'), function (e) {
  1999. setTimeout(() => {
  2000. $(".select2-results__option").each(function(){
  2001. var txt = $(this).html();
  2002. var count = (txt.match(/-/g) || []).length;
  2003. $(this).addClass('paddingLeftSelect' + count);
  2004. });
  2005. }, 100);
  2006. });
  2007. $('.filterCategories').on('select2:open', function (e) {
  2008. setTimeout(() => {
  2009. $(".select2-results__option").each(function(){
  2010. var txt = $(this).html();
  2011. var count = (txt.match(/-/g) || []).length;
  2012. $(this).addClass('paddingLeftSelect' + count);
  2013. });
  2014. }, 100);
  2015. });
  2016. function reset()
  2017. {
  2018. $('.filterCards').val('').trigger('change');
  2019. $('.filterStatus').val('').trigger('change');
  2020. $('.filterScadenza').val('-1').trigger('change');
  2021. $('.filterCertificateType').val('-1').trigger('change');
  2022. $('.filterCategories').val('-1').trigger('change');
  2023. /*
  2024. $(".chkCertificateNormal").prop( "checked", false );
  2025. $(".chkCertificateAgonistico").prop( "checked", false );
  2026. $(".chkCertificateScadenza").prop( "checked", false );
  2027. $(".chkCertificateScaduti").prop( "checked", false );
  2028. */
  2029. $('input[name="txtFromYear"]').val('');
  2030. $('input[name="txtToYear"]').val('');
  2031. $('input[name="txtFromYearYear"]').val('');
  2032. $('input[name="txtToYearYear"]').val('');
  2033. //localStorage.clear();
  2034. loadDataTable();
  2035. }
  2036. function loadDataTable()
  2037. {
  2038. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  2039. $('#tablesaw-350').DataTable().destroy();
  2040. }
  2041. /*var chkCertificateNormal = $(".chkCertificateNormal").is(':checked') ? "1" : "";
  2042. var chkCertificateAgonistico = $(".chkCertificateAgonistico").is(':checked') ? "1" : "";
  2043. var chkCertificateScadenza = $(".chkCertificateScadenza").is(':checked') ? "1" : "";
  2044. var chkCertificateScaduti = $(".chkCertificateScaduti").is(':checked') ? "1" : "";*/
  2045. //var status2 = $('input[name="chkStatus2"]:checked').val();
  2046. var fromYear = $('input[name="txtFromYear"]').val();
  2047. localStorage.setItem("fromYearMember", fromYear);
  2048. var toYear = $('input[name="txtToYear"]').val();
  2049. localStorage.setItem("toYearMember", toYear);
  2050. var fromYearYear = $('input[name="txtFromYearYear"]').val();
  2051. localStorage.setItem("fromYearYearMember", fromYearYear);
  2052. var toYearYear = $('input[name="txtToYearYear"]').val();
  2053. localStorage.setItem("toYearYearMember", toYearYear);
  2054. var filterCards = $('.filterCards').val();
  2055. localStorage.setItem("filterCardsMember", filterCards);
  2056. var filterStatus = $('.filterStatus').val();
  2057. localStorage.setItem("filterStatusMember", filterStatus);
  2058. var filterScadenza = $('.filterScadenza').val();
  2059. localStorage.setItem("filterScadenzaMember", filterScadenza);
  2060. var filterCertificateType = $('.filterCertificateType').val();
  2061. localStorage.setItem("filterCertificateTypeMember", filterCertificateType);
  2062. var filterCategories = $('.filterCategories').val();
  2063. localStorage.setItem("filterCategoriesMember", filterCategories);
  2064. $('#tablesaw-350').DataTable({
  2065. //destroy: true,
  2066. serverSide: true,
  2067. ajax: '/get_members?cards=' + filterCards + "&filterCategories=" + filterCategories + "&filterCertificateType=" + filterCertificateType + "&filterScadenza=" + filterScadenza + "&filterStatus=" + filterStatus + "&fromYear=" + fromYear + "&toYear=" + toYear + "&fromYearYear=" + fromYearYear + "&toYearYear=" + toYearYear,
  2068. //ajax: '/get_members?cards=' + cards + "&categories=" + categories + "&chkCertificateNormal=" + chkCertificateNormal + "&chkCertificateAgonistico=" + chkCertificateAgonistico + "&chkCertificateScadenza=" + chkCertificateScadenza + "&chkCertificateScaduti=" + chkCertificateScaduti + "&chkStatus0=" + chkStatus0 + "&chkStatus1=" + chkStatus1 + "&chkStatus2=" + chkStatus2 + "&fromYear=" + fromYear + "&toYear=" + toYear,
  2069. columns: [
  2070. //{ data: 'id' },
  2071. {
  2072. data: "last_name",
  2073. render: function (data){
  2074. // Split class and text
  2075. const d = data.split("|");
  2076. var ret = '<a style="cursor:pointer" onclick="showData(' + d[1] + ')">' + d[0] + '</a>';
  2077. return ret;
  2078. }
  2079. },
  2080. {
  2081. data: "first_name",
  2082. render: function (data){
  2083. // Split class and text
  2084. const d = data.split("|");
  2085. var ret = '<a style="cursor:pointer" onclick="showData(' + d[1] + ')">' + d[0] + '</a>';
  2086. return ret;
  2087. }
  2088. },
  2089. { data: "phone"},
  2090. { data: "age", "type": "num"},
  2091. { data: "year"},
  2092. {
  2093. data: "status",
  2094. //"orderable": false,
  2095. render: function (data){
  2096. // Split class and text
  2097. const d = data.split("|");
  2098. var ret = '<span class="tablesaw-cell-content"><span class="badge tessera-badge ' + d[0] + '">' + d[1] + '</span></span>';
  2099. return ret;
  2100. }
  2101. },
  2102. /*{
  2103. data: "state",
  2104. render: function (data){
  2105. // Split class and text
  2106. const d = data.split("|");
  2107. var ret = '<span class="tablesaw-cell-content"><span class="badge tessera-badge ' + d[0] + '">' + d[1] + '</span></span>';
  2108. ret += '<b class=" tablesaw-cell-label">Scadenza tessera</b>';
  2109. ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
  2110. d[2] + ' ' + d[3];
  2111. ret += '</span>';
  2112. return ret;
  2113. }
  2114. },*/
  2115. {
  2116. data: "certificate",
  2117. render: function (data){
  2118. // Split class and text
  2119. var ret = '';
  2120. if (data != "")
  2121. {
  2122. const d = data.split("|");
  2123. //ret += '<b class=" tablesaw-cell-label">Scadenza certificato</b>';
  2124. ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
  2125. if (d[0] == "0")
  2126. {
  2127. ret += '<i class="ico--ui check suspended me-2"></i>';
  2128. ret += 'Scaduto : ';
  2129. }
  2130. if (d[0] == "1")
  2131. {
  2132. ret += '<i class="ico--ui check due me-2"></i>';
  2133. ret += 'In scadenza : ';
  2134. }
  2135. if (d[0] == "2")
  2136. {
  2137. ret += '<i class="ico--ui check active me-2"></i>';
  2138. ret += 'Scadenza : ';
  2139. }
  2140. ret += d[1];
  2141. ret += '</span>';
  2142. }
  2143. return ret;
  2144. }
  2145. },
  2146. {
  2147. data: "action",
  2148. render: function (data){
  2149. var ret = '<button type="button" class="btn" onclick="editData(' + data + ')" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>&nbsp;';
  2150. ret += '<button type="button" class="btn" onclick="deleteData(' + data + ')" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>';
  2151. return ret;
  2152. }
  2153. },
  2154. ],
  2155. fixedHeader: false,
  2156. order: [[0, 'asc'], [1, 'asc']],
  2157. thead: {
  2158. 'th': {'background-color': 'blue'}
  2159. },
  2160. layout: {
  2161. topStart : null,
  2162. topEnd : null,
  2163. top1A: {
  2164. buttons: [
  2165. {
  2166. extend: 'collection',
  2167. text: 'Esporta',
  2168. buttons: [
  2169. {
  2170. extend: 'excelHtml5',"action":newexportaction,
  2171. title: 'Utenti',
  2172. exportOptions: {
  2173. columns: ":not(':last')",
  2174. page: 'all'
  2175. }
  2176. },
  2177. {
  2178. extend: 'pdfHtml5',"action":newexportaction,
  2179. title: 'Utenti',
  2180. exportOptions: {
  2181. columns: ":not(':last')"
  2182. },
  2183. customize: function(doc) {
  2184. doc.styles.tableHeader.alignment = 'left';
  2185. }
  2186. },
  2187. {
  2188. extend: 'print',"action":newexportaction,
  2189. text: 'Stampa',
  2190. title: 'Utenti',
  2191. exportOptions: {
  2192. columns: ":not(':last')"
  2193. }
  2194. }
  2195. ],
  2196. dropup: true
  2197. }
  2198. ]
  2199. },
  2200. top1B : {
  2201. pageLength: {
  2202. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  2203. }
  2204. },
  2205. top1C :'search',
  2206. /*bottomCenter : {
  2207. info: {
  2208. text: 'Table display: _START_ to _END_ of _TOTAL_ records'
  2209. }
  2210. },
  2211. bottomRight : {
  2212. paging: {
  2213. numbers: true
  2214. }
  2215. }*/
  2216. },
  2217. //"dom": '<"top"i>rt<"bottom"flp><"clear">',
  2218. pagingType: 'numbers',
  2219. "language": {
  2220. "url": "/assets/js/Italian.json"
  2221. },
  2222. "fnInitComplete": function (oSettings, json) {
  2223. var html = '&nbsp;<a style="cursor:pointer" class="showHideFilter btn--ui"><i class="fa-solid fa-sliders"></i></a>';
  2224. html += '&nbsp;<a style="cursor:pointer" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  2225. $(".dt-search").append(html);
  2226. }
  2227. });
  2228. $('#tablesaw-350 thead tr th').addClass('col');
  2229. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  2230. $('#tablesaw-350').on('draw.dt', function() {
  2231. $('[data-bs-toggle="popover"]').popover()
  2232. });
  2233. }
  2234. $(document).ready(function() {
  2235. $(document).on("click",".addData",function() {
  2236. $(".title--section_addButton").trigger("click")
  2237. });
  2238. } );
  2239. var isEdit = false;
  2240. var isEditCorso = false;
  2241. Livewire.on('setEdit', (x) =>
  2242. {
  2243. isEdit = x;
  2244. console.log(isEdit);
  2245. });
  2246. Livewire.on('setEditCorso', (x) =>
  2247. {
  2248. isEditCorso = x;
  2249. console.log("Edit corso" + isEditCorso);
  2250. });
  2251. Livewire.on('setErrorMsg', (errors) =>
  2252. {
  2253. function msg(value)
  2254. {
  2255. const myArray = value.split("=");
  2256. if (myArray[1] == '0' || myArray[1] == '')
  2257. $("span").find("[aria-controls='select2-" + myArray[0] + "-container']").css('border', 'solid 3px #dc3545');
  2258. }
  2259. console.log(errors);
  2260. //window.location.href = "#top";
  2261. //$("span").find(`[aria-controls='select2-birth_nation_id-container']`).css('border', 'solid 3px red');
  2262. });
  2263. Livewire.on('reload', (x) =>
  2264. {
  2265. location.reload();
  2266. });
  2267. Livewire.on('goToTop', () => {
  2268. @this.set('type', 'dati');
  2269. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2270. });
  2271. function storeAction(type)
  2272. {
  2273. @this.change('dati');
  2274. if (isEditCorso)
  2275. {
  2276. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2277. @this.store(type);
  2278. }
  2279. else
  2280. {
  2281. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2282. //window.location.href = "#top";
  2283. }
  2284. }
  2285. function updateAction(type)
  2286. {
  2287. @this.change('dati');
  2288. if (isEditCorso)
  2289. {
  2290. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2291. @this.updateAAA(type);
  2292. }
  2293. else
  2294. {
  2295. @this.updateAAA(type);
  2296. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2297. }
  2298. }
  2299. function cancelAction()
  2300. {
  2301. if (isEditCorso)
  2302. {
  2303. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2304. @this.cancel();
  2305. }
  2306. else
  2307. @this.cancel();
  2308. }
  2309. function annulla()
  2310. {
  2311. window.onbeforeunload = null;
  2312. document.location.href = '/members';
  2313. }
  2314. window.onbeforeunload = function(){
  2315. if (isEdit)
  2316. return 'Cambiando pagina le eventuali modifiche andranno perse';
  2317. if (isEditCorso)
  2318. return 'Devi prima salvare i dati del corso';
  2319. };
  2320. window.livewire.on('saved', () => {
  2321. $('#userModal').modal('hide');
  2322. });
  2323. Livewire.on('goToAnchor', () =>
  2324. {
  2325. window.location.href = "#top";
  2326. });
  2327. /*$(window).on('popstate', function(event) {
  2328. document.location.href = '/members';
  2329. });*/
  2330. $(function() {
  2331. if (window.history && window.history.pushState) {
  2332. window.history.pushState('', null, './');
  2333. $(window).on('popstate', function() {
  2334. // alert('Back button was pressed.');
  2335. //document.location.href = '#';
  2336. document.location.href = '/members';
  2337. });
  2338. }
  2339. });
  2340. </script>
  2341. @endpush