member.blade.php 166 KB

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