member.blade.php 170 KB

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