member.blade.php 166 KB

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