member.blade.php 188 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997
  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()}} ({{$member_course->course ? $member_course->course->year : ''}})</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"><input type="checkbox" name="chkAll" class="chkAll"></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 == 'presenze' ? 'border-bottom:2px solid #0C6197; color:#0C6197;' : ''}}" wire:click="change('presenze')">Presenze</h4>
  456. <h4 style="cursor:pointer;{{$type == 'gruppi' ? 'border-bottom:2px solid #0C6197; color:#0C6197;' : ''}}" wire:click="change('gruppi')">Gruppi</h4>
  457. </div>
  458. <div class="row">
  459. @if($type == 'dati')
  460. <div class="form--wrapper d-flex">
  461. <form class="form--utente d-flex">
  462. <div class="form--col" style="width:100%">
  463. <div class="row g-3">
  464. <div class="col-md-6 col-xxl-3">
  465. <label for="first_name" class="form-label">Nome</label>
  466. <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">
  467. </div>
  468. <div class="col-md-6 col-xxl-3">
  469. <label for="last_name" class="form-label">Cognome</label>
  470. <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">
  471. </div>
  472. <div class="col-md-6 col-xxl-3">
  473. <label for="email" class="form-label">Sesso</label>
  474. <select id="gender" class="form-select @error('gender') is-invalid @enderror" aria-label="Sesso" wire:model="gender">
  475. <option value="">
  476. <option value="M">Uomo
  477. <option value="D">Donna
  478. <option value="O">Altro
  479. </select>
  480. </div>
  481. <div class="col-md-6 col-xxl-3">
  482. <label for="inputDate" class="form-label">Data di nascita {!!$age != '' ? ' <b style="font-size:14px;">(' . $age . ')</b>' : ''!!}</label>
  483. <div class="input-group mb-3">
  484. <div style="width:100%">
  485. <input class="form-control @error('birth_date') is-invalid @enderror" type="date" id="birth_date" placeholder="Data di nascita" wire:model="birth_date">
  486. </div>
  487. <div style="width:100%; text-align:center;">{!!$under18 ? '<span style="color:red;font-weight:bold;font-size:12px;">&nbsp;MINORENNE</span>' : ''!!}</div>
  488. </div>
  489. </div>
  490. </div>
  491. <div class="row g-3">
  492. <div class="col-md-6 col-xxl-3">
  493. <label for="birth_nation_id" class="form-label">Nazione di Nascita</label>
  494. <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">
  495. <option value="{{$birth_nation_id}}">{{$this->getNation($birth_nation_id)}}
  496. </select>
  497. </div>
  498. @if($isBirthItaly)
  499. <div class="col-md-6 col-xxl-3">
  500. <label for="birth_province_id" class="form-label">Provincia di Nascita</label>
  501. <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">
  502. <option value="{{$birth_province_id}}">{{$this->getProvince($birth_province_id)}}
  503. </select>
  504. </div>
  505. <div class="col-xl-6">
  506. <label for="birth_city_id" class="form-label">Comune di Nascita</label>
  507. <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" >
  508. <option value="{{$birth_city_id}}">{{$this->getCity($birth_city_id)}}
  509. </select>
  510. </div>
  511. @else
  512. <div class="col-xl-3">
  513. <label for="birth_place" class="form-label">Paese di nascita</label>
  514. <input class="form-control @error('birth_place') is-invalid @enderror" type="text" id="birth_place" placeholder="Paese di nascita" wire:model="birth_place">
  515. </div>
  516. @endif
  517. </div>
  518. <div class="row g-3 mt-1">
  519. <div class="col-xl-6">
  520. <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>
  521. <input class="form-control @error('fiscal_code') is-invalid @enderror" type="text" id="fiscal_code" placeholder="Codice fiscale" wire:model="fiscal_code" maxlength="16">
  522. @if($this->error_fc)
  523. <span style="color:red;font-size:12px">Dati mancanti</span>
  524. @endif
  525. @error('fiscal_code')
  526. <div class="invalid-feedback">{{ $message }}</div>
  527. @enderror
  528. </div>
  529. <div class="col-xl-6">
  530. <div class="upload-file">
  531. <label for="formFile" class="form-label">Immagine profilo</label>
  532. @error('image') <span class="error">{{ $message }}</span> @enderror
  533. <input class="form-control" type="file" wire:model="image">
  534. @if ($image)
  535. <img src="{{ $image->temporaryUrl() }}" style="max-width:200px">
  536. @endif
  537. @if ($image_old)
  538. <img src="{{ asset('storage/app/public/'.$image_old) }}" style="max-width:200px">
  539. @endif
  540. </div>
  541. </div>
  542. </div>
  543. <div class="row g-3 mt-1">
  544. <span class="title-form primary d-block w-100">Residenza</span>
  545. <div class="col-xl-3" wire:ignore>
  546. <label for="nation_id" class="form-label">Nazione</label>
  547. <select id="nation_id" class="form-select nationClass @error('nation_id') is-invalid @enderror" aria-label="Nazione" wire:model="nation_id">
  548. <option value="{{$nation_id}}">{{$this->getNation($nation_id)}}
  549. </select>
  550. </div>
  551. @if($isItaly)
  552. <div class="col-xl-3">
  553. <label for="province_id" class="form-label">Provincia</label>
  554. <select id="province_id" class="form-select provinceClass @error('province_id') is-invalid @enderror" aria-label="Provincia" wire:model="province_id">
  555. <option value="{{$province_id}}">{{$this->getProvince($province_id)}}
  556. </select>
  557. </div>
  558. <div class="col-xl-6">
  559. <label for="city_id" class="form-label">Comune</label>
  560. <select id="city_id" class="form-select cityClass @error('city_id') is-invalid @enderror" aria-label="Comune" wire:model="city_id">
  561. <option value="{{$city_id}}">{{$this->getCity($city_id)}}
  562. </select>
  563. </div>
  564. @endif
  565. </div>
  566. <div class="row g-3 mt-1">
  567. <div class="col-xl-6">
  568. <label for="address" class="form-label">Indirizzo</label>
  569. <input class="form-control @error('address') is-invalid @enderror" type="text" id="address" placeholder="Indirizzo" wire:model="address" style="text-transform:uppercase">
  570. </div>
  571. <div class="col-xl-3">
  572. <label for="zip_code" class="form-label">CAP</label>
  573. <input class="form-control @error('zip_code') is-invalid @enderror" type="text" id="zip_code" placeholder="CAP" wire:model="zip_code" maxlength="5" >
  574. </div>
  575. </div>
  576. <div class="row g-3 mt-1">
  577. <span class="title-form primary d-block w-100">Contatti</span>
  578. <div class="col-xl-6">
  579. <label for="email" class="form-label">Email</label>
  580. <input class="form-control @error('email') is-invalid @enderror" type="text" id="email" placeholder="Email" wire:model="email">
  581. </div>
  582. <div class="col-xl-6">
  583. <label for="phone" class="form-label">Telefono/Cellulare</label>
  584. <input class="form-control @error('phone') is-invalid @enderror" type="text" id="phone" placeholder="Telefono" wire:model="phone">
  585. </div>
  586. <div class="col-xl-6">
  587. <label for="phone2" class="form-label">Telefono 2</label>
  588. <input class="form-control" type="text" id="phone2" placeholder="Telefono 2" wire:model="phone2">
  589. </div>
  590. <div class="col-xl-6">
  591. <label for="phone3" class="form-label">Telefono 3</label>
  592. <input class="form-control" type="text" id="phone3" placeholder="Telefono 3" wire:model="phone3">
  593. </div>
  594. </div>
  595. <div class="row g-3 mt-1">
  596. <div class="col-lg-12">
  597. <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>
  598. </div>
  599. <div class="col-lg-12">
  600. <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>
  601. </div>
  602. @if($dataId > 0)
  603. <span class="title-form primary d-block w-100">Stato</span>
  604. <div class="col-12">
  605. <span class="badge tessera-badge {{$active["status"] == 2 ? 'active' : ($active["status"] == 0 ? 'due' : 'suspended')}}">{{$active["status_text"]}}</span>
  606. </div>
  607. @endif
  608. <!--<span class="title-form primary d-block w-100">Stato Pagamenti</span>
  609. <div class="col-12">
  610. <div class="form-check form-switch d-flex align-items-center active">
  611. <input class="form-check-input me-2" type="checkbox" role="switch" id="flexSwitchCheckChecked" checked>
  612. <label class="form-check-label" for="flexSwitchCheckChecked">Scadenza: <span><strong>16 aprile 2024</strong></span></label>
  613. </div>
  614. </div>-->
  615. </div>
  616. <div class="row g-3 mt-1" wire:key='reload-{{$selectId}}'>
  617. <span class="title-form primary d-block w-100">Documento</span>
  618. <div class="col-xl-6 col-xl-3">
  619. <label for="document_type" class="form-label">Tipo</label>
  620. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="document_type">
  621. <option value="">--Seleziona--</option>
  622. <option value="Carta di identità">Carta di identità</option>
  623. <option value="Passaporto">Passaporto</option>
  624. <option value="Patente">Patente</option>
  625. <option value="Permesso di soggiorno">Permesso di soggiorno</option>
  626. </select>
  627. </div>
  628. <div class="col-xl-6 col-xl-3">
  629. <label for="document_number" class="form-label">Numero</label>
  630. <input class="form-control" type="text" id="document_number" placeholder="Numero" wire:model="document_number">
  631. </div>
  632. <div class="col-xl-6 col-xl-3">
  633. <label for="document_from" class="form-label">Rilasciato da</label>
  634. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="document_from">
  635. <option value="">--Seleziona--</option>
  636. <option value="Comune">Comune</option>
  637. <option value="Motorizzazione">Motorizzazione</option>
  638. <option value="Ministero degli interni">Ministero degli interni</option>
  639. <option value="Prefettura">Prefettura</option>
  640. </select>
  641. </div>
  642. <div class="col-xl-6 col-xl-3">
  643. <label for="document_expire_date" class="form-label">Scadenza</label>
  644. <input class="form-control" type="date" id="document_expire_date" placeholder="Scadenza" wire:model="document_expire_date">
  645. </div>
  646. <div class="col-12">
  647. <label for="document_files" class="form-label">File</label>
  648. <input class="form-control" type="file" wire:model="documents" multiple><br>
  649. <label for="document_files" class="form-label">Caricati</label>
  650. @if ($document_files !== null && count(array_filter($document_files)) > 0)
  651. @foreach ($document_files as $idx => $d)
  652. @if (!empty($d))
  653. <div class="row">
  654. <div class="col-6">
  655. <a href="{{ asset('storage/app/public/'.$d) }}" target="_blank" class="form-label">{{$d}}</a>
  656. </div>
  657. <div class="col-6">
  658. <a wire:click="removeDocument({{$idx}},'self')" class="form-label">(elimina)</a><br>
  659. </div>
  660. </div>
  661. @endif
  662. @endforeach
  663. @endif
  664. </div>
  665. </div>
  666. @if($under18)
  667. <div class="row g-3 mt-1">
  668. <span class="title-form primary d-block w-100">Genitore 1</span>
  669. <div class="col-xl-6">
  670. <label for="father_name" class="form-label"><b>Nominativo</b></label>
  671. <input class="form-control" type="text" id="father_name" placeholder="Nome" wire:model="father_name">
  672. </div>
  673. <div class="col-xl-6">
  674. <label for="father_name" class="form-label"><b>Email</b></label>
  675. <input class="form-control" type="text" id="father_email" placeholder="Email" wire:model="father_email">
  676. </div>
  677. <div class="col-xl-6">
  678. <label for="father_name" class="form-label"><b>Telefono</b></label>
  679. <input class="form-control" type="text" id="father_phone" placeholder="Telefono" wire:model="father_phone">
  680. </div>
  681. <div class="col-xl-6">
  682. <label for="father_name" class="form-label"><b>Codice fiscale</b></label>
  683. <input class="form-control" type="text" id="father_fiscal_code" placeholder="Codice fiscale" wire:model="father_fiscal_code" maxlength="16">
  684. </div>
  685. <div class="col-xl-6">
  686. <label for="father_name" class="form-label"><b>Numero del documento</b></label>
  687. <input class="form-control" type="text" id="father_doc_number" placeholder="Numero documento" wire:model="father_doc_number">
  688. </div>
  689. <div class="col-xl-6">
  690. <label for="father_name" class="form-label"><b>Tipo documento</b></label>
  691. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="father_doc_type">
  692. <option value="">Seleziona il tipo documento</option>
  693. <option value="Carta di identità">Carta di identità</option>
  694. <option value="Passaporto">Passaporto</option>
  695. <option value="Patente">Patente</option>
  696. <option value="Permesso di soggiorno">Permesso di soggiorno</option>
  697. </select>
  698. </div>
  699. <div class="col-12">
  700. <label for="father_documents" class="form-label">File</label>
  701. <input class="form-control" type="file" wire:model="father_documents" multiple><br>
  702. <label for="father_documents" class="form-label">Caricati</label>
  703. @if ($father_document_files !== null && count(array_filter($father_document_files)) > 0)
  704. @foreach ($father_document_files as $idx => $d)
  705. @if (!empty($d))
  706. <div class="row">
  707. <div class="col-6">
  708. <a href="{{ asset('storage/app/public/'.$d) }}" target="_blank" class="form-label">{{$d}}</a>
  709. </div>
  710. <div class="col-6">
  711. <a wire:click="removeDocument({{$idx}},'father')" class="form-label">(elimina)</a><br>
  712. </div>
  713. </div>
  714. @endif
  715. @endforeach
  716. @endif
  717. </div>
  718. </div>
  719. <div class="row g-3 mt-1">
  720. <span class="title-form primary d-block w-100">Genitore 2</span>
  721. <div class="col-xl-6">
  722. <label for="mother_name" class="form-label"><b>Nominativo</b></label>
  723. <input class="form-control " type="text" id="mother_name" placeholder="Nome genitore 2" wire:model="mother_name">
  724. </div>
  725. <div class="col-xl-6">
  726. <label for="mother_name" class="form-label"><b>Email</b></label>
  727. <input class="form-control " type="text" id="mother_email" placeholder="Email" wire:model="mother_email">
  728. </div>
  729. <div class="col-xl-6">
  730. <label for="mother_name" class="form-label"><b>Telefono</b></label>
  731. <input class="form-control " type="text" id="mother_phone" placeholder="Telefono" wire:model="mother_phone">
  732. </div>
  733. <div class="col-xl-6">
  734. <label for="mother_name" class="form-label"><b>Codice fiscale</b></label>
  735. <input class="form-control " type="text" id="mother_fiscal_code" placeholder="Codice fiscale" wire:model="mother_fiscal_code" maxlength="16">
  736. </div>
  737. <div class="col-xl-6">
  738. <label for="mother_name" class="form-label"><b>Numero del documento</b></label>
  739. <input class="form-control " type="text" id="mother_doc_number" placeholder="Numero documento" wire:model="mother_doc_number">
  740. </div>
  741. <div class="col-xl-6">
  742. <label for="mother_name" class="form-label"><b>Tipo documento</b></label>
  743. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="mother_doc_type">
  744. <option value="">Seleziona il tipo documento</option>
  745. <option value="Carta di identità">Carta di identità</option>
  746. <option value="Passaporto">Passaporto</option>
  747. <option value="Patente">Patente</option>
  748. <option value="Permesso di soggiorno">Permesso di soggiorno</option>
  749. </select>
  750. </div>
  751. </div>
  752. <div class="col-12">
  753. <label for="mother_documents" class="form-label">File</label>
  754. <input class="form-control" type="file" wire:model="mother_documents" multiple><br>
  755. <label for="mother_documents" class="form-label">Caricati</label>
  756. @if ($mother_document_files !== null && count(array_filter($mother_document_files)) > 0)
  757. @foreach ($mother_document_files as $idx => $d)
  758. @if (!empty($d))
  759. <div class="row">
  760. <div class="col-6">
  761. <a href="{{ asset('storage/app/public/'.$d) }}" target="_blank" class="form-label">{{$d}}</a>
  762. </div>
  763. <div class="col-6">
  764. <a wire:click="removeDocument({{$idx}},'mother')" class="form-label">(elimina)</a><br>
  765. </div>
  766. </div>
  767. @endif
  768. @endforeach
  769. @endif
  770. </div>
  771. @endif
  772. <div class="row g-3 mt-1">
  773. <span class="title-form primary d-block w-100">Certificato Medico</span>
  774. @if($dataId > -1)
  775. @if(!$addCertificate && !$updateCertificate)
  776. <table class="table tablesaw tableHead tablesaw-stack" >
  777. <thead>
  778. <tr>
  779. <th scope="col">Tipo</th>
  780. <th scope="col">Scadenza</th>
  781. <th scope="col"></th>
  782. <th scope="col">...</th>
  783. </tr>
  784. </thead>
  785. <tbody >
  786. @foreach($member_certificates as $member_certificate)
  787. <tr>
  788. <td>{{$member_certificate->type == 'A' ? 'Agonistico' : 'Non agonistico'}}</td>
  789. <td>{{$member_certificate->expire_date ? date("d/m/Y", strtotime($member_certificate->expire_date)) : ''}}</td>
  790. <td>{!!$member_certificate->filename != '' ? '<a href="/storage/app/public/' . $member_certificate->filename . '" target="_blank">Visualizza</a>' : ''!!}</td>
  791. <td>
  792. <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>
  793. <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>
  794. </td>
  795. </tr>
  796. @endforeach
  797. </tbody>
  798. </table>
  799. <button class="btn--ui primary"wire:click.prevent="addCertificate()" style="max-width:200px">Aggiungi</button>
  800. @else
  801. <div class="form--wrapper">
  802. <form class="form--utente">
  803. <div class="row ">
  804. <div class="col-md-6">
  805. <label for="certificate_type" class="form-label">Tipo</label>
  806. <select id="certificate_type" class="form-select certificate_type" aria-label="Tessera" wire:model="certificate_type">
  807. <option value="">--Seleziona--</option>
  808. <option value="N">Non agonistico
  809. <option value="A">Agonistico
  810. </select>
  811. </div>
  812. <div class="col-md-6">
  813. <label for="certificate_expire_date" class="form-label">Data scadenza</label>
  814. <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">
  815. </div>
  816. </div>
  817. <div class="col-12">
  818. <div class="upload--image_box d-flex align-items-center justify-content-center flex-column">
  819. <input class="form-control" type="file" wire:model="certificate_filename">
  820. </div>
  821. <p class="caption text-center mt-1">Formati consentiti: .jpg, .pdf, .docx</p>
  822. {!!$certificate_filename_old != '' ? '<br><a href="/storage/app/public/' . $certificate_filename_old . '" target="_blank">Visualizza</a>' : ''!!}
  823. </div>
  824. </form>
  825. </div>
  826. <br>
  827. <button class="btn--ui lightGrey" wire:click.prevent="cancelCertificate()">Annulla</button>
  828. @if($addCertificate)
  829. <button class="btn--ui primary" wire:click.prevent="storeCertificate()">Salva</button>
  830. @endif
  831. @if($updateCertificate)
  832. <button class="btn--ui primary" wire:click.prevent="updateCertificate()">Salva</button>
  833. @endif
  834. @endif
  835. @else
  836. <label for="last_name" class="form-label">Prima di caricare un certificato salva l'utente</label>
  837. @endif
  838. </div>
  839. </div>
  840. </form>
  841. </div>
  842. @endif
  843. @if($type == 'tesseramento')
  844. @if($dataId > 0)
  845. @if(!$addCard && !$updateCard)
  846. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350-1">
  847. <thead>
  848. <tr>
  849. <th scope="col">Tesseramento</th>
  850. <th scope="col">Numero</th>
  851. <th scope="col">Scadenza</th>
  852. <th scope="col">...</th>
  853. </tr>
  854. </thead>
  855. <tbody id="checkall-target">
  856. @foreach($member_cards as $member_card)
  857. <tr>
  858. <td>{{$member_card->card->name}}</td>
  859. <td>{{$member_card->number}}</td>
  860. <td>{{$member_card->expire_date ? date("d/m/Y", strtotime($member_card->expire_date)) : ''}}</td>
  861. <td>
  862. <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>
  863. <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>
  864. </td>
  865. </tr>
  866. @endforeach
  867. </tbody>
  868. </table>
  869. <button class="btn--ui primary"wire:click.prevent="addCard()" style="max-width:200px">Aggiungi</button>
  870. @else
  871. <div class="form--wrapper">
  872. <form class="form--utente">
  873. <div class="row ">
  874. <div class="col-md-6">
  875. <label for="card_card_id" class="form-label">Tessera</label>
  876. <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">
  877. <option value="">--Seleziona--
  878. @foreach($cards as $card)
  879. <option value="{{$card->id}}">{{$card->name}}
  880. @endforeach
  881. </select>
  882. </div>
  883. <div class="col-md-6">
  884. <label for="card_number" class="form-label">Numero</label>
  885. <input class="form-control @error('card_number') is-invalid @enderror" type="text" id="card_number" placeholder="Numero" wire:model="card_number">
  886. </div>
  887. </div>
  888. <div class="row ">
  889. <div class="col-md-6">
  890. <label for="card_date" class="form-label">Data rilascio tessera</label>
  891. <input class="form-control" type="date" id="card_date" placeholder="Data" wire:model="card_date">
  892. </div>
  893. <div class="col-md-6">
  894. <label for="card_accept_date" class="form-label">Data accettazione</label>
  895. <input class="form-control" type="date" id="card_accept_date" placeholder="Data accettazione" wire:model="card_accept_date">
  896. </div>
  897. </div>
  898. <div class="row ">
  899. <div class="col-md-6">
  900. <label for="card_date" class="form-label">Disciplina 1</label>
  901. <select id="card_discipline1_id" class="form-select " aria-label="Disciplina 1" wire:model="card_discipline1_id">
  902. <option value="">--Seleziona--
  903. @foreach($disciplines as $d)
  904. <option value="{{$d->id}}">{{$d->name}}
  905. @endforeach
  906. </select>
  907. </div>
  908. <div class="col-md-6">
  909. <label for="card_date" class="form-label">Disciplina 2</label>
  910. <select id="card_discipline2_id" class="form-select " aria-label="Disciplina 2" wire:model="card_discipline2_id">
  911. <option value="">--Seleziona--
  912. @foreach($disciplines as $d)
  913. <option value="{{$d->id}}">{{$d->name}}
  914. @endforeach
  915. </select>
  916. </div>
  917. </div>
  918. @if($card_discipline2_id > 0)
  919. <div class="row ">
  920. <div class="col-md-6">
  921. <label for="card_date" class="form-label">Disciplina 3</label>
  922. <select id="card_discipline3_id" class="form-select " aria-label="Disciplina 3" wire:model="card_discipline3_id">
  923. <option value="">--Seleziona--
  924. @foreach($disciplines as $d)
  925. <option value="{{$d->id}}">{{$d->name}}
  926. @endforeach
  927. </select>
  928. </div>
  929. </div>
  930. @endif
  931. </form>
  932. </div>
  933. <br>
  934. <div class="row mt-2">
  935. <div class="col-md-12">
  936. <button class="btn--ui lightGrey" wire:click.prevent="cancelCard()">Annulla</button>
  937. @if($addCard)
  938. <button class="btn--ui primary" wire:click.prevent="storeCard()">Salva</button>
  939. @endif
  940. @if($updateCard)
  941. <button class="btn--ui primary" wire:click.prevent="updateCard()">Salva</button>
  942. @endif
  943. </div>
  944. </div>
  945. @endif
  946. <!--
  947. <button class="tab--btn w-100"><i class="ico--ui tessera me-2"></i><span class="btn_title">nessuna tessera registrata</span></button>
  948. <div class="tessere--tab">
  949. <div class="d-flex align-items-start">
  950. <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
  951. <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>
  952. <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>
  953. <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>
  954. <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>
  955. <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>
  956. </div>
  957. <div class="tab-content" id="v-pills-tabContent">
  958. <div class="tab-pane fade show active" id="v-pills-fit" role="tabpanel" aria-labelledby="v-pills-fit-tab" tabindex="0">
  959. <form class="form--tessere">
  960. <div class="mb-3">
  961. <label for="inputTessera" class="form-label">Numero Tessera</label>
  962. <input type="text" class="form-control" id="inputTessera">
  963. </div>
  964. <div class="mb-3">
  965. <label for="inputDate" class="form-label">Data di nascita</label>
  966. <div class="input-group mb-3">
  967. <input id="inputDate" type="text" class="form-control" aria-label="Recipient's username" aria-describedby="button-addon2">
  968. <button class="btn btn-outline-secondary" type="button" id="button-addon2">Date</button>
  969. </div>
  970. </div>
  971. <span class="scadenza-tessera">Scadenza: <strong>16 aprile 2024</strong></span>
  972. <button class="btn--ui_outline small mt-2"><i class="ico--ui tessera"></i>aggiungi tessera</button>
  973. </form>
  974. </div>
  975. <div class="tab-pane fade" id="v-pills-uisp" role="tabpanel" aria-labelledby="v-pills-uisp-tab" tabindex="0">...</div>
  976. <div class="tab-pane fade" id="v-pills-mps" role="tabpanel" aria-labelledby="v-pills-mps-tab" tabindex="0">...</div>
  977. <div class="tab-pane fade" id="v-pills-csi" role="tabpanel" aria-labelledby="v-pills-csi-tab" tabindex="0">...</div>
  978. <div class="tab-pane fade" id="v-pills-altro" role="tabpanel" aria-labelledby="v-pills-altro-tab" tabindex="0">...</div>
  979. </div>
  980. </div>
  981. </div>-->
  982. @endif
  983. @endif
  984. @if($type == 'gruppi')
  985. <form class="form--tesseramento mt-4">
  986. @livewire('categories')
  987. @if(false)
  988. <div class="tessera--added d-flex align-items-center justify-content-between mt-4 mb-3">
  989. <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%;">
  990. <option value="">--Seleziona--
  991. @foreach($categories as $category)
  992. <option value="{{$category["id"]}}">{{$category["name"]}}
  993. @endforeach
  994. </select>
  995. <button class="btn--ui_outline" wire:click.prevent="storeCategory()" style="margin-left:20px"><i class="ico--ui gruppi"></i>aggiungi</button>
  996. </div>
  997. @endif
  998. <span style="color:red">{!!$groupMsg!!}</span>
  999. @foreach($member_categories as $member_category)
  1000. <div class="tessera--added d-flex align-items-center justify-content-between mt-4 mb-3">
  1001. <div class="tessera--added_name d-flex align-items-start">
  1002. <i class="ico--ui gruppi me-2"></i>
  1003. <div class="title--tessera_added">
  1004. <h4>{{$member_category->category->getTree()}}</h4>
  1005. </div>
  1006. </div>
  1007. <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>
  1008. </div>
  1009. @endforeach
  1010. </form>
  1011. @endif
  1012. @if($type == 'presenze')
  1013. <div class="form--wrapper">
  1014. <div class="row ">
  1015. <div class="col-md-6">
  1016. <select class="form-control" wire:model="presenceYearFilter">
  1017. @foreach($presenceYears as $y)
  1018. <option value="{{$y}}">{{$y}}</option>
  1019. @endforeach
  1020. </select>
  1021. </div>
  1022. <div class="col-md-6">
  1023. <select class="form-control" wire:model="presenceTitleFilter">
  1024. @foreach($presenceTitle as $t)
  1025. <option value="{{$t}}">{{$t}}</option>
  1026. @endforeach
  1027. </select>
  1028. </div>
  1029. </div>
  1030. <br>
  1031. <div class="row align-items-center">
  1032. <div class="col-md-3">
  1033. <div class="box-presenze">
  1034. Presenze<br>
  1035. {{$presenze}}
  1036. </div>
  1037. </div>
  1038. <div class="col-md-3">
  1039. <div class="box-assenze">
  1040. Assenze<br>
  1041. {{$assenze}}
  1042. </div>
  1043. </div>
  1044. <div class="col-md-3" style="border-right: 1px solid gray">
  1045. <div class="box-annullate">
  1046. Annullate<br>
  1047. {{$annullate}}
  1048. </div>
  1049. </div>
  1050. <div class="col-md-3">
  1051. <div class="row">
  1052. {{-- <div class="col-12"><div class="box-recupero">Recupero {{$recuperi}}</div></div>
  1053. <div class="col-12"><div class="box-recupero">Recupero {{$recuperi}}</div></div> --}}
  1054. @foreach ($recuperi as $name => $count)
  1055. <div class="col-12"><div class="box-presenze">{!!$name!!} {{$count}}</div></div>
  1056. @endforeach
  1057. {{-- <div class="col-12"><div class="box-presenze">Recupero {{$recuperi}}</div></div> --}}
  1058. </div>
  1059. </div>
  1060. </div>
  1061. <div class="row ">
  1062. <div class="col-md-12">
  1063. <div class="presenzechart-wrapper">
  1064. <canvas id="presenzeChart" style="padding:20px"></canvas>
  1065. <button class="btn--ui download-png" onclick="downloadChart('presenzeChart')" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Scarica grafico"><i class="fas fa-download"></i></button>
  1066. </div>
  1067. </div>
  1068. </div>
  1069. @if (!empty($member_presences))
  1070. <div class="row " style="height: 300px; overflow:auto; ">
  1071. <div class="col-md-12">
  1072. <table class="table tablesaw tableHead tablesaw-stack tabella--presenze" id="tablesaw-350-2" style="min-width:700px">
  1073. <thead>
  1074. <tr>
  1075. <th>Data</th>
  1076. <th>Orario</th>
  1077. <th>Stato</th>
  1078. <th>Motivazione</th>
  1079. </tr>
  1080. </thead>
  1081. <tbody>
  1082. @foreach($member_presences as $mp)
  1083. <tr>
  1084. <td>{{date("d/m/Y", strtotime($mp["from"]))}}</td>
  1085. <td>{{date("H:i", strtotime($mp["from"]))}} - {{date("H:i", strtotime($mp["to"]))}}</td>
  1086. <td>{!!$mp["status"]!!}</td>
  1087. <td>{!!$mp["motivation"]!!}</td>
  1088. </tr>
  1089. @endforeach
  1090. </tbody>
  1091. </table>
  1092. </div>
  1093. </div>
  1094. @endif
  1095. </div>
  1096. @endif
  1097. @if($type == 'corsi')
  1098. @if($dataId > 0)
  1099. @if(!$addCourse && !$updateCourse)
  1100. @if(false && $active["status"] != 2 && $active["status"] != 1 )
  1101. <div class="alert alert-warning" role="alert">
  1102. <strong>Attenzione:</strong> Per aggiungere corsi è necessario avere un tesseramento.
  1103. </div>
  1104. @endif
  1105. <table class="table tablesaw tableHead tablesaw-stack tabella--corsi" id="tablesaw-350-2" style="min-width:800px">
  1106. <tbody id="checkall-target">
  1107. @foreach($member_courses as $member_course)
  1108. <tr>
  1109. <td style="width:10%">
  1110. <b>{{$member_course->course->name}}</b><br>
  1111. </td>
  1112. <td style="width:10%">
  1113. {{$member_course->course->year}}<br>
  1114. </td>
  1115. <td style="width:5%">
  1116. {{$member_course->course->type->name ?? ""}}<br>
  1117. </td>
  1118. <td style="width:10%">
  1119. {{$member_course->course->level->name ?? ""}}<br>
  1120. </td>
  1121. <td style="width:25%">
  1122. @foreach(json_decode($member_course->when) as $xx => $x)
  1123. @if($xx > 0)
  1124. <br>
  1125. @endif
  1126. @foreach($x->day as $zz => $d)
  1127. {{$zz > 0 ? '-' : ''}}{{$d}}
  1128. @endforeach
  1129. h {{$x->from}} - {{$x->to}}
  1130. @endforeach
  1131. </td>
  1132. <td style="width:25%">
  1133. @php
  1134. $aMo = json_decode($member_course->months);
  1135. if (sizeof($aMo) == 1)
  1136. {
  1137. print($this->getMonth($aMo[0]->m));
  1138. }
  1139. if (sizeof($aMo) > 1)
  1140. {
  1141. print($this->getMonth($aMo[0]->m) . " - " . $this->getMonth($aMo[sizeof($aMo) - 1]->m));
  1142. }
  1143. @endphp
  1144. </td>
  1145. @if(false)
  1146. <td style="width:10%">Iscrizione:<br><b>{{$member_course->status == 1 ? 'Pagata' : ($member_course->status == 2 ? 'Da pagare' : 'Sospesa')}}</b></td>
  1147. @endif
  1148. <td style="text-align:right;width:15%">
  1149. <button type="button" class="btn" wire:click="showHideCourse({{ $member_course->id }})"><i class="fa-solid fa-chevron-down"></i></button>&nbsp;
  1150. </td>
  1151. </tr>
  1152. @if(in_array($member_course->id, $showCourse))
  1153. <tr>
  1154. <td colspan="6">
  1155. <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>
  1156. <a class="{{$this->getMonthStatus(9, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(9, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(9, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Set</a>&nbsp;
  1157. <a class="{{$this->getMonthStatus(10, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(10, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(10, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Ott</a>&nbsp;
  1158. <a class="{{$this->getMonthStatus(11, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(11, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(11, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Nov</a>&nbsp;
  1159. <a class="{{$this->getMonthStatus(12, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(12, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(12, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Dic</a>&nbsp;
  1160. <a class="{{$this->getMonthStatus(1, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(1, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(1, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Gen</a>&nbsp;
  1161. <a class="{{$this->getMonthStatus(2, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(2, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(2, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Feb</a>&nbsp;
  1162. <a class="{{$this->getMonthStatus(3, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(3, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(3, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Mar</a>&nbsp;
  1163. <a class="{{$this->getMonthStatus(4, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(4, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(4, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Apr</a>&nbsp;
  1164. <a class="{{$this->getMonthStatus(5, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(5, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(5, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Mag</a>&nbsp;
  1165. <a class="{{$this->getMonthStatus(6, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(6, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(6, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Giu</a>&nbsp;
  1166. <a class="{{$this->getMonthStatus(7, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(7, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(7, $member_course->months, $member_course->id), ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Lug</a>&nbsp;
  1167. <a class="{{$this->getMonthStatus(8, $member_course->months, $member_course->id)}}" wire:click="setPayMonth(8, '{{ $member_course->months }}', {{$member_course->id}})" {{in_array($this->getMonthStatus(8, $member_course->months, $member_course->id) , ['blue', 'orange', 'yellow', 'orange half']) ? 'style=cursor:pointer' : ''}}>Ago</a>&nbsp;
  1168. </td>
  1169. <td>
  1170. <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;
  1171. <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>
  1172. </td>
  1173. </tr>
  1174. <tr>
  1175. <td colspan="7">
  1176. @if($selectedCourseMember == $member_course->id)
  1177. @if(sizeof($payMonths) > 0 || $createSubscription)
  1178. <button class="btn--ui primary" style="color:white" wire:click="newPayment({{$member_course}})">Nuova entrata</button>&nbsp;
  1179. <button class="btn--ui primary" style="color:white" wire:click="block({{$member_course}})">Sospendi</button>
  1180. @endif
  1181. @if(sizeof($suspendedMonths) > 0)
  1182. <button class="btn--ui primary" style="color:white" wire:click="reactivate({{$member_course}})">Riattiva</button>&nbsp;
  1183. @endif<br>
  1184. @endif
  1185. @if($member_course->notes != '')
  1186. <br><b>Note</b><br>
  1187. {{$member_course->notes}}
  1188. @endif
  1189. </td>
  1190. </tr>
  1191. @endif
  1192. @endforeach
  1193. </tbody>
  1194. </table>
  1195. @if($dataId > 0)
  1196. <button class="btn--ui primary" wire:click.prevent="addCourse()" style="max-width:200px">Aggiungi</button>
  1197. @if(false)
  1198. @if ($active["status"] == 2 || $active["status"] == 1)
  1199. <button class="btn--ui primary" wire:click.prevent="addCourse()" style="max-width:200px">Aggiungi</button>
  1200. @else
  1201. <button class="btn--ui lightGrey" disabled style="max-width:200px">Aggiungi corso (non disponibile)</button>
  1202. <small class="text-muted d-block mt-1">Completa prima il tesseramento per abilitare l'aggiunta di corsi</small>
  1203. @endif
  1204. @endif
  1205. @endif
  1206. @else
  1207. <div class="form--wrapper">
  1208. <form class="form--utente">
  1209. @if(false)
  1210. <div class="row ">
  1211. <div class="col-md-6">
  1212. <label for="course_course_id" class="form-label">Corso</label>
  1213. <select id="course_course_id" class="form-select @error('course_course_id') is-invalid @enderror" aria-label="Corso" wire:model="course_course_id" >
  1214. <option value="">
  1215. @foreach($courses as $course)
  1216. <option value="{{$course->id}}">{{$course->name}} - {{$course->level->name ?? ""}} - {{$course->type->name ?? ""}} - {{$course->frequency->name ?? ""}}
  1217. @endforeach
  1218. </select>
  1219. @if($course_exist)
  1220. <small style="color:red">Attenzione: il corso selezionato è già associato all'utente</small>
  1221. @endif
  1222. </div>
  1223. </div>
  1224. @endif
  1225. <div class="row ">
  1226. <div class="col-md-3">
  1227. <label for="course_name" class="form-label">Corso</label>
  1228. <select id="course_name" class="form-select @error('course_course_id') is-invalid @enderror" aria-label="Corso" wire:model="course_name" >
  1229. <option value="">
  1230. @foreach($course_names as $n)
  1231. <option value="{{$n}}">{{$n}}
  1232. @endforeach
  1233. </select>
  1234. @error('course_course_id')
  1235. <div class="invalid-feedback">Devi selezionare un corso (corso, livello, tipologia e frequenza)</div>
  1236. @enderror
  1237. @if($course_exist)
  1238. <small style="color:red">Attenzione: il corso selezionato è già associato all'utente</small>
  1239. @endif
  1240. </div>
  1241. @if($course_name != '')
  1242. <div class="col-md-3">
  1243. <label for="course_level_id" class="form-label">Livello</label>
  1244. <select id="course_level_id" class="form-select" aria-label="Livello" wire:model="course_level_id" >
  1245. <option value="">
  1246. @foreach($course_levels as $l)
  1247. <option value="{{$l->id}}">{{$l->name}}
  1248. @endforeach
  1249. </select>
  1250. </div>
  1251. @endif
  1252. @if($course_level_id != '')
  1253. <div class="col-md-3">
  1254. <label for="course_type_id" class="form-label">Tipologia</label>
  1255. <select id="course_type_id" class="form-select" aria-label="Tipologia" wire:model="course_type_id" >
  1256. <option value="">
  1257. @foreach($course_types as $t)
  1258. <option value="{{$t->id}}">{{$t->name}}
  1259. @endforeach
  1260. </select>
  1261. </div>
  1262. @endif
  1263. @if($course_type_id != '')
  1264. <div class="col-md-3">
  1265. <label for="course_frequency_id" class="form-label">Frequenza</label>
  1266. <select id="course_frequency_id" class="form-select" aria-label="Tipologia" wire:model="course_frequency_id" >
  1267. <option value="">
  1268. @foreach($course_frequencies as $f)
  1269. <option value="{{$f->id}}">{{$f->name}}
  1270. @endforeach
  1271. </select>
  1272. </div>
  1273. @endif
  1274. </div>
  1275. <div class="row mt-4">
  1276. <div class="col-md-6">
  1277. <label for="course_course_subscription_id" class="form-label">Abbonamento</label>
  1278. <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">
  1279. <option value="">
  1280. @foreach($course_subscriptions as $t)
  1281. <option value="{{$t["id"]}}">{{$t["name"]}}
  1282. @endforeach
  1283. </select>
  1284. </div>
  1285. <div class="col-md-6">
  1286. <label for="course_price" class="form-label">Costo mensile</label>
  1287. <input class="form-control" type="text" id="course_price" placeholder="Costo mensile" wire:model="course_price" onkeyup="onlyNumberAmount(this)">
  1288. </div>
  1289. @if(false)
  1290. <div class="col-md-6">
  1291. <label for="course_status" class="form-label">Stato iscrizione</label>
  1292. <select id="course_status" class="form-select @error('course_status') is-invalid @enderror" aria-label="Stato" wire:model="course_status">
  1293. <option value="">
  1294. <option value="1">Pagata
  1295. <option value="2">Da pagare
  1296. <option value="3">Sospesa
  1297. </select>
  1298. </div>
  1299. @endif
  1300. </div>
  1301. <div class="row mt-4 course--duration">
  1302. <div class="col-md-12">
  1303. <label for="duration" class="form-label">Durata del corso</label>
  1304. <div class="d-flex course--duration_mounth">
  1305. <a class="{{$this->checkMonth(9) ? 'selected' : 'notSelected'}}" wire:click="setMonth(9)">Set</a>
  1306. <a class="{{$this->checkMonth(10) ? 'selected' : 'notSelected'}}" wire:click="setMonth(10)">Ott</a>
  1307. <a class="{{$this->checkMonth(11) ? 'selected' : 'notSelected'}}" wire:click="setMonth(11)">Nov</a>
  1308. <a class="{{$this->checkMonth(12) ? 'selected' : 'notSelected'}}" wire:click="setMonth(12)">Dic</a>
  1309. <a class="{{$this->checkMonth(1) ? 'selected' : 'notSelected'}}" wire:click="setMonth(1)">Gen</a>
  1310. <a class="{{$this->checkMonth(2) ? 'selected' : 'notSelected'}}" wire:click="setMonth(2)">Feb</a>
  1311. <a class="{{$this->checkMonth(3) ? 'selected' : 'notSelected'}}" wire:click="setMonth(3)">Mar</a>
  1312. <a class="{{$this->checkMonth(4) ? 'selected' : 'notSelected'}}" wire:click="setMonth(4)">Apr</a>
  1313. <a class="{{$this->checkMonth(5) ? 'selected' : 'notSelected'}}" wire:click="setMonth(5)">Mag</a>
  1314. <a class="{{$this->checkMonth(6) ? 'selected' : 'notSelected'}}" wire:click="setMonth(6)">Giu</a>
  1315. <a class="{{$this->checkMonth(7) ? 'selected' : 'notSelected'}}" wire:click="setMonth(7)">Lug</a>
  1316. <a class="{{$this->checkMonth(8) ? 'selected' : 'notSelected'}}" wire:click="setMonth(8)">Ago</a>
  1317. </div>
  1318. </div>
  1319. </div>
  1320. <div class="row mt-4">
  1321. <div class="col-md-6">
  1322. <label for="course_subscription_price" class="form-label">Costo iscrizione</label>
  1323. <input class="form-control" type="text" id="course_subscription_price" placeholder="Costo iscrizione" wire:model="course_subscription_price" onkeyup="onlyNumberAmount(this)">
  1324. </div>
  1325. </div>
  1326. <div class="row mt-4">
  1327. <div class="col-md-6">
  1328. <label for="course_date_from" class="form-label">Dal</label>
  1329. <input class="form-control" type="date" id="course_date_from" placeholder="Dal" wire:model="course_date_from">
  1330. </div>
  1331. <div class="col-md-6">
  1332. <label for="course_date_to" class="form-label">Al</label>
  1333. <input class="form-control" type="date" id="course_date_to" placeholder="Al" wire:model="course_date_to">
  1334. </div>
  1335. </div>
  1336. @foreach($course_when as $idW => $when)
  1337. <div class="row">
  1338. <div class="col-12">
  1339. <div class="day durata--corso d-flex">
  1340. <label for="" class="form-label">Giorno</label>
  1341. <div class="durata--corso_days mb-3">
  1342. <a class="{{in_array('lun', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'lun')">Lun</a>
  1343. <a class="{{in_array('mar', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'mar')">Mar</a>
  1344. <a class="{{in_array('mer', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'mer')">Mer</a>
  1345. <a class="{{in_array('gio', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'gio')">Gio</a>
  1346. <a class="{{in_array('ven', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'ven')">Ven</a>
  1347. <a class="{{in_array('sab', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'sab')">Sab</a>
  1348. <a class="{{in_array('dom', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'dom')">Dom</a>
  1349. </div>
  1350. <div class="durata--corso_select">
  1351. <div class="from--h me-3">
  1352. <label for="" class="form-label">Dalle</label>
  1353. <select class="form-select" wire:model="course_when.{{$idW}}.from">
  1354. <option value="">--Seleziona--
  1355. @for($c=6;$c<=23;$c++)
  1356. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00
  1357. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30
  1358. @endfor
  1359. </select>
  1360. </div>
  1361. <div class="to--h">
  1362. <label for="" class="form-label">Alle</label>
  1363. <select class="form-select" wire:model="course_when.{{$idW}}.to">
  1364. <option value="">--Seleziona--
  1365. @for($c=6;$c<=23;$c++)
  1366. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00
  1367. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30
  1368. @endfor
  1369. </select>
  1370. </div>
  1371. </div>
  1372. <button class="btn--ui primary remove--day position-absolute" wire:click.prevent="delRow({{$idW}})"><i class="fa-solid fa-minus"></i></button>
  1373. <button class="btn--ui primary add--day position-absolute" wire:click.prevent="addRow()"><i class="fa-solid fa-plus"></i></button>
  1374. </div>
  1375. </div>
  1376. </div>
  1377. @endforeach
  1378. <div class="row mt-2">
  1379. <div class="col-md-12">
  1380. <label for="course_date_from" class="form-label">Note</label>
  1381. <input class="form-control" type="text" id="course_note" placeholder="Note" wire:model="course_note">
  1382. </div>
  1383. </div>
  1384. </form>
  1385. </div>
  1386. <br>
  1387. <div class="row mt-2">
  1388. <div class="col-md-12">
  1389. <button class="btn--ui lightGrey" wire:click.prevent="cancelCourse()">Annulla</button>
  1390. @if($addCourse)
  1391. @if(!$course_exist)
  1392. <button class="btn--ui primary" wire:click.prevent="storeCourse()">Salva corso</button>
  1393. @endif
  1394. @endif
  1395. @if($updateCourse)
  1396. <button class="btn--ui primary" wire:click.prevent="updateCourse()">Salva corso</button>
  1397. @endif
  1398. </div>
  1399. </div>
  1400. @endif
  1401. @endif
  1402. @endif
  1403. </div>
  1404. </div>
  1405. <div class="col-md-5 col-xl-4 p-3">
  1406. <div id="card--resume" class="primary card--ui ms-3 user--resume">
  1407. <header>
  1408. <div class="username d-flex align-items-start">
  1409. <i class="ico--ui utenti light me-2"></i>
  1410. <div class="user--resume_name d-flex flex-column">
  1411. <span class="user-name">{{ strtoupper($first_name) }} {{ strtoupper($last_name) }}</span>
  1412. <span class="user-email">{{ $birth_date ? date("d/m/Y", strtotime($birth_date)) : '' }}{!!$age != '' ? ' (' . $age . ')' : ''!!}</span>
  1413. </div>
  1414. </div>
  1415. </header>
  1416. <div class="card--resume_body">
  1417. <ul class="user-address mb-4 p-0">
  1418. <li><i class="ico--ui resume--ico phone me-2"></i><span>Tel. {{ $phone }}</span></li>
  1419. <li><i class="ico--ui resume--ico mail light me-2"></i><span>{{ $email }}</span></li>
  1420. </ul>
  1421. <ul class="user-residence p-0">
  1422. <li><i class="ico--ui resume--ico residence me-2"></i>
  1423. <span>
  1424. @if($city_id > 0)
  1425. {{$this->getCity($city_id)}}
  1426. @if($province_id > 0)
  1427. ( {{$this->getProvince($province_id)}} ) -
  1428. @endif
  1429. @endif
  1430. {{ $zip_code }}<br>
  1431. {{ $address }}
  1432. </span>
  1433. </li>
  1434. </ul>
  1435. <div class="resume--tab_info credito">
  1436. <h2 class="mb-3">Borsellino MAD</h2>
  1437. <span class="value">{{formatPrice($money)}}</span>
  1438. </div>
  1439. <div class="resume--tab_info gruppi corsi">
  1440. <h2 class="mb-3">Corsi</h2>
  1441. @foreach($member_courses as $member_course)
  1442. <div class="resume--info d-flex align-items-center">
  1443. <div class="row" style="margin-top:10px">
  1444. <div class="row">
  1445. <strong>{{$member_course->course->getTree()}} <span style="font-weight:lighter">({{$member_course->course->year}})</span></strong></span><br>
  1446. </div>
  1447. <div class="row">
  1448. <span class="title-detail">
  1449. @php
  1450. $aMo = json_decode($member_course->months);
  1451. if (sizeof($aMo) == 1)
  1452. {
  1453. print($this->getMonth($aMo[0]->m));
  1454. }
  1455. if (sizeof($aMo) > 1)
  1456. {
  1457. print($this->getMonth($aMo[0]->m) . " - " . $this->getMonth($aMo[sizeof($aMo) - 1]->m));
  1458. }
  1459. @endphp
  1460. </span>
  1461. </div>
  1462. <div class="row">
  1463. <span class="title-detail">
  1464. @foreach(json_decode($member_course->when) as $xx => $x)
  1465. @if($xx > 0)
  1466. <br>
  1467. @endif
  1468. @foreach($x->day as $d)
  1469. {{$d}}
  1470. @endforeach
  1471. {{$x->from}} - {{$x->to}}
  1472. @endforeach
  1473. </span>
  1474. </div>
  1475. </div>
  1476. </div>
  1477. @endforeach
  1478. </div>
  1479. <div class="resume--tab_info tesseramento">
  1480. <h2 class="mb-3">Tesseramento</h2>
  1481. @foreach($member_cards as $member_card)
  1482. @if($member_card->expire_date . " 23:59:59" > date("Y-m-d"))
  1483. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1484. <div class="resume--info d-flex align-items-start">
  1485. <i class="ico--ui tessera me-2"></i>
  1486. <div class="title--tessera_added">
  1487. <h4>{{$member_card->card->name}}</h4>
  1488. <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>
  1489. @if($member_card->discipline_1)
  1490. </br>
  1491. <span class="title-detail">Disciplina: <b>{{$member_card->discipline_1->name}}</b></span>
  1492. @endif
  1493. @if($member_card->discipline_2)
  1494. </br>
  1495. <span class="title-detail">Disciplina: <b>{{$member_card->discipline_2->name}}</b></span>
  1496. @endif
  1497. @if($member_card->discipline_3)
  1498. </br>
  1499. <span class="title-detail">Disciplina: <b>{{$member_card->discipline_3->name}}</b></span>
  1500. @endif
  1501. </div>
  1502. </div>
  1503. <span class="badge tessera-badge active">attiva</span>
  1504. </div>
  1505. @endif
  1506. @endforeach
  1507. </div>
  1508. <div class="resume--tab_info tesseramento">
  1509. <h2 class="mb-3">Certificato</h2>
  1510. @if(sizeof($member_certificates) > 0)
  1511. @php
  1512. $cert = $member_certificates[0]
  1513. @endphp
  1514. @if($cert->expire_date . " 23:59:59" > date("Y-m-d"))
  1515. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1516. <div class="resume--info d-flex align-items-start">
  1517. <i class="fa-regular fa-file-lines me-2"></i>
  1518. <div class="title--tessera_added">
  1519. <h4>{{$cert->type == 'A' ? 'Agonistico' : 'Non agonistico'}}</h4>
  1520. <span class="title-detail">Scadenza: <span class="title-detail_date">{{$cert->expire_date ? date("d/m/Y", strtotime($cert->expire_date)) : ''}}</span></span></small>
  1521. </div>
  1522. </div>
  1523. @if($cert->expire_date . " 23:59:59" < date("Y-m-d"))
  1524. <span class="badge tessera-badge suspended">scaduto</span>
  1525. @endif
  1526. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d") && $cert->expire_date < date("Y-m-d", strtotime("+1 month")))
  1527. <span class="badge tessera-badge due">in scadenza</span>
  1528. @endif
  1529. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d", strtotime("+1 month")))
  1530. <span class="badge tessera-badge active">valido</span>
  1531. @endif
  1532. </div>
  1533. @endif
  1534. @endif
  1535. <!--
  1536. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1537. <div class="resume--info d-flex align-items-start">
  1538. <i class="ico--ui tessera me-2"></i>
  1539. <div class="title--tessera_added">
  1540. <h4>Tennis/Corso Tennis/Adulti/Bisettimanale</h4>
  1541. <span class="title-detail">Iscrizione: <span class="title-detail_date">12 marzo 2022</span></span></small>
  1542. </div>
  1543. </div>
  1544. <span class="badge tessera-badge active">attiva</span>
  1545. </div>-->
  1546. </div>
  1547. <div class="resume--tab_info gruppi">
  1548. <h2 class="mb-3">Gruppi di appartenenza</h2>
  1549. @foreach($member_categories as $member_category)
  1550. <div class="resume--info d-flex align-items-center">
  1551. <i class="ico--ui gruppi me-2"></i><span><strong>{{$member_category->category->getTree()}}</strong></span>
  1552. </div>
  1553. @endforeach
  1554. </div>
  1555. </div>
  1556. </div>
  1557. </div>
  1558. </div>
  1559. </div>
  1560. <!-- save & continue section -->
  1561. <section class="save--section d-flex justify-content-start">
  1562. <div class="container">
  1563. <div class="row">
  1564. <div class="col-md-7 col-xl-8 d-flex gx-0">
  1565. @if($add)
  1566. <button class="btn--ui primary d-flex order-1 me-2" wire:click="store(false)">salva e continua</button>
  1567. <button class="btn--ui primary d-flex order-3 ms-auto" onclick="store(true)">salva e chiudi</button>
  1568. @endif
  1569. @if($update)
  1570. <button class="btn--ui primary d-flex order-1 me-2" wire:click="updateAAA(false)">salva e continua</button>
  1571. <button class="btn--ui primary d-flex order-3 ms-auto" onclick="updateAAA(true)">salva e chiudi</button>
  1572. @endif
  1573. <button class="btn--ui lightGrey" onclick="annulla()" style="margin-right:10px">annulla</button><br><br>
  1574. </div>
  1575. <div class="col-md-5 col-xl-4"></div>
  1576. </div>
  1577. </div>
  1578. </section>
  1579. @endif
  1580. </div>
  1581. @endif
  1582. <div wire:ignore.self class="modal fade" id="userModal" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
  1583. <div class="modal-dialog">
  1584. <div class="modal-content">
  1585. <div class="modal-header">
  1586. <h5 class="modal-title" id="userModalLabel">Modifica borsellino</h5>
  1587. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1588. </div>
  1589. <div class="modal-body">
  1590. <div class="row">
  1591. <div class="col-md-6">
  1592. <label for="newMemberFirstName" class="form-label">Importo</label>
  1593. <input class="form-control " type="text" id="importoBorsellino" >
  1594. </div>
  1595. </div>
  1596. </div>
  1597. <div class="modal-footer">
  1598. <button type="button" class="btn--ui lightGrey" data-bs-dismiss="modal">Annulla</button>
  1599. <button type="button" class="btn--ui btn-primary" onclick="updateBorsellino('-')">Decrementa</button>
  1600. <button type="button" class="btn--ui btn-primary" onclick="updateBorsellino('+')">Aumenta</button>
  1601. </div>
  1602. </div>
  1603. </div>
  1604. </div>
  1605. </div>
  1606. @push('scripts')
  1607. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  1608. <style>
  1609. table.tableHead thead {
  1610. /* Important */
  1611. position: sticky;
  1612. z-index: 100;
  1613. top: 0;
  1614. }
  1615. .select2-container--default .select2-selection--single{
  1616. background-color: #E9F0F5;
  1617. border: 0.0625rem solid #DFE5EB;
  1618. font-size: 0.75rem;
  1619. }
  1620. .select2-selection
  1621. {
  1622. height: 38px !important;
  1623. }
  1624. .select2-selection__rendered
  1625. {
  1626. padding-top:3px;
  1627. }
  1628. .select2
  1629. {
  1630. width:100% !important;
  1631. }
  1632. a.notSelected
  1633. {
  1634. display: flex;
  1635. margin-right:10px;
  1636. float:left;
  1637. height: 2.5rem !important;
  1638. width:50px;
  1639. align-items: center;
  1640. justify-content: center;
  1641. color: #006099;
  1642. background-color: #d3dce1 !important;
  1643. padding: 0 1.25rem;
  1644. font-size: 0.875rem;
  1645. font-family: greycliff-cf, sans-serif;
  1646. border-radius: 1.875rem !important;
  1647. -webkit-border-radius: 1.875rem !important;
  1648. -moz-border-radius: 1.875rem !important;
  1649. -webkit-transition: all 0.3s ease-in-out;
  1650. -moz-transition: all 0.3s ease-in-out;
  1651. -o-transition: all 0.3s ease-in-out;
  1652. transition: all 0.3s ease-in-out;
  1653. border: none;
  1654. }
  1655. a.selected
  1656. {
  1657. display: flex;
  1658. margin-right:10px;
  1659. float:left;
  1660. height: 2.5rem !important;
  1661. width:50px;
  1662. align-items: center;
  1663. justify-content: center;
  1664. color: #fff;
  1665. background-color: #006099 !important;
  1666. padding: 0 1.25rem;
  1667. font-size: 0.875rem;
  1668. font-family: greycliff-cf, sans-serif;
  1669. border-radius: 1.875rem !important;
  1670. -webkit-border-radius: 1.875rem !important;
  1671. -moz-border-radius: 1.875rem !important;
  1672. -webkit-transition: all 0.3s ease-in-out;
  1673. -moz-transition: all 0.3s ease-in-out;
  1674. -o-transition: all 0.3s ease-in-out;
  1675. transition: all 0.3s ease-in-out;
  1676. border: none;
  1677. }
  1678. div.day
  1679. {
  1680. margin-top:20px;
  1681. color: #006099;
  1682. background-color: #ffffff !important;
  1683. padding: 20px;
  1684. border-radius: 1.875rem !important;
  1685. -webkit-border-radius: 1.875rem !important;
  1686. -moz-border-radius: 1.875rem !important;
  1687. -webkit-transition: all 0.3s ease-in-out;
  1688. -moz-transition: all 0.3s ease-in-out;
  1689. -o-transition: all 0.3s ease-in-out;
  1690. transition: all 0.3s ease-in-out;
  1691. border: 2px solid #d3dce1;
  1692. }
  1693. /* a.grey
  1694. {
  1695. display: flex;
  1696. margin-right:10px;
  1697. float:left;
  1698. height: 2.5rem !important;
  1699. width:50px;
  1700. align-items: center;
  1701. justify-content: center;
  1702. color: #006099;
  1703. background-color: #d3dce1 !important;
  1704. padding: 0 1.25rem;
  1705. font-size: 0.875rem;
  1706. font-family: greycliff-cf, sans-serif;
  1707. border-radius: 1.875rem !important;
  1708. -webkit-border-radius: 1.875rem !important;
  1709. -moz-border-radius: 1.875rem !important;
  1710. -webkit-transition: all 0.3s ease-in-out;
  1711. -moz-transition: all 0.3s ease-in-out;
  1712. -o-transition: all 0.3s ease-in-out;
  1713. transition: all 0.3s ease-in-out;
  1714. border: none;
  1715. }
  1716. a.blue
  1717. {
  1718. display: flex;
  1719. margin-right:10px;
  1720. float:left;
  1721. height: 2.5rem !important;
  1722. width:50px;
  1723. align-items: center;
  1724. justify-content: center;
  1725. color: #fff;
  1726. background-color: #006099 !important;
  1727. padding: 0 1.25rem;
  1728. font-size: 0.875rem;
  1729. font-family: greycliff-cf, sans-serif;
  1730. border-radius: 1.875rem !important;
  1731. -webkit-border-radius: 1.875rem !important;
  1732. -moz-border-radius: 1.875rem !important;
  1733. -webkit-transition: all 0.3s ease-in-out;
  1734. -moz-transition: all 0.3s ease-in-out;
  1735. -o-transition: all 0.3s ease-in-out;
  1736. transition: all 0.3s ease-in-out;
  1737. border: none;
  1738. }
  1739. a.yellow
  1740. {
  1741. display: flex;
  1742. margin-right:10px;
  1743. float:left;
  1744. height: 2.5rem !important;
  1745. width:50px;
  1746. align-items: center;
  1747. justify-content: center;
  1748. color: #fff;
  1749. background-color: #ffe238;
  1750. padding: 0 1.25rem;
  1751. font-size: 0.875rem;
  1752. font-family: greycliff-cf, sans-serif;
  1753. border-radius: 1.875rem !important;
  1754. -webkit-border-radius: 1.875rem !important;
  1755. -moz-border-radius: 1.875rem !important;
  1756. -webkit-transition: all 0.3s ease-in-out;
  1757. -moz-transition: all 0.3s ease-in-out;
  1758. -o-transition: all 0.3s ease-in-out;
  1759. transition: all 0.3s ease-in-out;
  1760. border: none;
  1761. }
  1762. a.orange
  1763. {
  1764. display: flex;
  1765. margin-right:10px;
  1766. float:left;
  1767. height: 2.5rem !important;
  1768. width:50px;
  1769. align-items: center;
  1770. justify-content: center;
  1771. color: #fff;
  1772. background-color: #FF7E38;
  1773. padding: 0 1.25rem;
  1774. font-size: 0.875rem;
  1775. font-family: greycliff-cf, sans-serif;
  1776. border-radius: 1.875rem !important;
  1777. -webkit-border-radius: 1.875rem !important;
  1778. -moz-border-radius: 1.875rem !important;
  1779. -webkit-transition: all 0.3s ease-in-out;
  1780. -moz-transition: all 0.3s ease-in-out;
  1781. -o-transition: all 0.3s ease-in-out;
  1782. transition: all 0.3s ease-in-out;
  1783. border: none;
  1784. }
  1785. a.green
  1786. {
  1787. display: flex;
  1788. margin-right:10px;
  1789. float:left;
  1790. height: 2.5rem !important;
  1791. width:50px;
  1792. align-items: center;
  1793. justify-content: center;
  1794. color: #fff;
  1795. background-color: green;
  1796. padding: 0 1.25rem;
  1797. font-size: 0.875rem;
  1798. font-family: greycliff-cf, sans-serif;
  1799. border-radius: 1.875rem !important;
  1800. -webkit-border-radius: 1.875rem !important;
  1801. -moz-border-radius: 1.875rem !important;
  1802. -webkit-transition: all 0.3s ease-in-out;
  1803. -moz-transition: all 0.3s ease-in-out;
  1804. -o-transition: all 0.3s ease-in-out;
  1805. transition: all 0.3s ease-in-out;
  1806. border: none;
  1807. }
  1808. .btn--ui
  1809. {
  1810. -webkit-border-radius: 0.5rem !important;
  1811. background-color:#0C6197 !important;
  1812. font-weight:normal;
  1813. } */
  1814. .btn--ui.lightGrey, .btn--ui.extraLightGrey
  1815. {
  1816. -webkit-border-radius: 0.5rem !important;
  1817. background-color:#ffffff !important;
  1818. border: 1px solid grey;
  1819. color: black;
  1820. font-weight:normal;
  1821. }
  1822. .persistent-invalid
  1823. {
  1824. border-color: #dc3545 !important;
  1825. padding-right: calc(1.5em + 0.75rem) !important;
  1826. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") !important;
  1827. background-repeat: no-repeat !important;
  1828. background-position: right calc(0.375em + 0.1875rem) center !important;
  1829. background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
  1830. }
  1831. </style>
  1832. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  1833. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  1834. @endpush
  1835. @push('scripts')
  1836. <script>
  1837. function matchStart(params, data) {
  1838. params.term = params.term || '';
  1839. if (data.text.toUpperCase().indexOf(params.term.toUpperCase()) == 0) {
  1840. return data;
  1841. }
  1842. return false;
  1843. }
  1844. var nation_id = {{$nation_id > 0 ? $nation_id : 0}};
  1845. var province_id = 0;
  1846. /*
  1847. $('.nationClass').select2({
  1848. // theme: 'bootstrap4',
  1849. ajax: {
  1850. url: '/nations',
  1851. dataType: 'json'
  1852. }
  1853. });
  1854. $('.nationClass').on('change', function (e) {
  1855. nation_id = $('.nationClass').select2("val");
  1856. @this.set('nation_id', nation_id);
  1857. @this.set('province_id', 0);
  1858. @this.set('city_id', 0);
  1859. @this.checkIsItaly();
  1860. });
  1861. $('.provinceClass').select2({
  1862. ajax: {
  1863. url: '/provinces/' + nation_id,
  1864. dataType: 'json'
  1865. }
  1866. });
  1867. $('.cityClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});*/
  1868. var nation_birth_id = 0;
  1869. var province_birth_id = 0;
  1870. /*
  1871. $('.nationBirthClass').select2({
  1872. // theme: 'bootstrap4',
  1873. ajax: {
  1874. url: '/nations',
  1875. dataType: 'json'
  1876. }
  1877. });
  1878. $('.nationBirthClass').on('change', function (e) {
  1879. nation_birth_id = $('.nationBirthClass').select2("val");
  1880. @this.set('birth_nation_id', nation_birth_id);
  1881. @this.set('birth_province_id', 0);
  1882. @this.set('birth_city_id', 0);
  1883. @this.checkIsBirthItaly();
  1884. });
  1885. $('.provinceBirthClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1886. $('.cityBirthClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});*/
  1887. Livewire.on('load-select', () => {
  1888. loadCombo();
  1889. });
  1890. function updateBorsellino(verse)
  1891. {
  1892. var importoBorsellino = $("#importoBorsellino").val();
  1893. @this.updateBorsellino(importoBorsellino, verse);
  1894. }
  1895. Livewire.on('load-provinces', (nation_id, element) => {
  1896. $('.' + element).select2({
  1897. ajax: {
  1898. url: '/provinces/' + nation_id,
  1899. dataType: 'json'
  1900. }
  1901. });
  1902. });
  1903. Livewire.on('load-cities', (province_id, element) => {
  1904. $('.' + element).select2({
  1905. ajax: {
  1906. url: '/cities/' + province_id,
  1907. dataType: 'json'
  1908. }
  1909. });
  1910. });
  1911. Livewire.on('hide-search', () => {
  1912. //pcsh2();
  1913. });
  1914. Livewire.on('setIds', (nation_id_x, birth_nation_id_x) => {
  1915. nation_id = nation_id_x;
  1916. nation_birth_id = birth_nation_id_x;
  1917. });
  1918. function loadCombo()
  1919. {
  1920. $('.nationClass').select2({
  1921. ajax: {
  1922. url: '/nations',
  1923. dataType: 'json'
  1924. }
  1925. });
  1926. $('.nationClass').on('change', function (e) {
  1927. nation_id = $('.nationClass').select2("val");
  1928. province_id = 0;
  1929. @this.set('nation_id', nation_id);
  1930. @this.set('province_id', 0);
  1931. @this.set('city_id', 0);
  1932. @this.checkIsItaly();
  1933. });
  1934. $('.provinceClass').select2({
  1935. ajax: {
  1936. url: '/provinces/' + nation_id,
  1937. dataType: 'json'
  1938. }
  1939. });
  1940. $('.provinceClass').on('change', function (e) {
  1941. province_id = $('.provinceClass').select2("val");
  1942. @this.set('province_id', province_id);
  1943. @this.set('city_id', 0);
  1944. });
  1945. $('.cityClass').select2({
  1946. ajax: {
  1947. url: '/cities/' + province_id,
  1948. dataType: 'json'
  1949. }
  1950. });
  1951. $('.cityClass').on('change', function (e) {
  1952. var data = $('.cityClass').select2("val");
  1953. @this.set('city_id', data);
  1954. });
  1955. $('.nationBirthClass').select2({
  1956. ajax: {
  1957. url: '/nations',
  1958. dataType: 'json'
  1959. }
  1960. });
  1961. $('.nationBirthClass').on('change', function (e) {
  1962. nation_birth_id = $('.nationBirthClass').select2("val");
  1963. province_birth_id = 0;
  1964. @this.set('birth_nation_id', nation_birth_id);
  1965. @this.set('birth_province_id', 0);
  1966. @this.set('birth_city_id', 0);
  1967. @this.checkIsBirthItaly();
  1968. });
  1969. $('.provinceBirthClass').select2({
  1970. ajax: {
  1971. url: '/provinces/' + nation_birth_id,
  1972. dataType: 'json'
  1973. }
  1974. });
  1975. $('.provinceBirthClass').on('change', function (e) {
  1976. province_birth_id = $('.provinceBirthClass').select2("val");
  1977. @this.set('birth_province_id', province_birth_id);
  1978. @this.set('birth_city_id', 0);
  1979. });
  1980. $('.cityBirthClass').select2({
  1981. ajax: {
  1982. url: '/cities/' + province_birth_id,
  1983. dataType: 'json'
  1984. }
  1985. });
  1986. $('.cityBirthClass').on('change', function (e) {
  1987. var data = $('.cityBirthClass').select2("val");
  1988. @this.set('birth_city_id', data);
  1989. });
  1990. $('.card_card_id').select2({
  1991. matcher: function(params, data) {
  1992. return matchStart(params, data);
  1993. }
  1994. });
  1995. $('.card_card_id').on('change', function (e) {
  1996. var data = $('.card_card_id').select2("val");
  1997. @this.set('card_card_id', data);
  1998. });
  1999. $('.certificate_type').select2({
  2000. matcher: function(params, data) {
  2001. return matchStart(params, data);
  2002. }
  2003. });
  2004. $('.certificate_type').on('change', function (e) {
  2005. var data = $('.certificate_type').select2("val");
  2006. @this.set('certificate_type', data);
  2007. });
  2008. $('.categoriesClass').select2({
  2009. matcher: function(params, data) {
  2010. return matchStart(params, data);
  2011. }
  2012. });
  2013. $('.categoriesClass').on('change', function (e) {
  2014. var data = $('.categoriesClass').select2("val");
  2015. @this.set('category_category_id', data);
  2016. });
  2017. $('.coursesClass').select2({
  2018. matcher: function(params, data) {
  2019. return matchStart(params, data);
  2020. }
  2021. });
  2022. $('.coursesClass').on('change', function (e) {
  2023. var data = $('.coursesClass').select2("val");
  2024. @this.set('course_course_id', data);
  2025. });
  2026. }
  2027. @if($refreshAfter == 1)
  2028. setTimeout(() => {
  2029. loadCombo();
  2030. }, 100)
  2031. @endif
  2032. function onlyNumberAmount(input) {
  2033. let v = input.value.replace(/\D+/g, '');
  2034. if (v.length > 14) v = v.slice(0, 14);
  2035. input.value = "€ " + v.replace(/(\d)(\d\d)$/, "$1,$2").replace(/(^\d{1,3}|\d{3})(?=(?:\d{3})+(?:,|$))/g, '$1.');
  2036. }
  2037. </script>
  2038. @endpush
  2039. @push('scripts')
  2040. <link href="/css/datatables.css" rel="stylesheet" />
  2041. <script src="/assets/js/datatables.js"></script>
  2042. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  2043. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  2044. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  2045. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  2046. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  2047. @endpush
  2048. @push('scripts')
  2049. <script>
  2050. function showData(id)
  2051. {
  2052. @this.showDetailF(id);
  2053. }
  2054. function editData(id) {
  2055. if ($('#tablesaw-350').length && $.fn.DataTable.isDataTable('#tablesaw-350')) {
  2056. const dataTable = $('#tablesaw-350').DataTable();
  2057. const pageLength = dataTable.page.len();
  2058. const currentPage = dataTable.page.info().page;
  2059. const order = dataTable.order();
  2060. if (order && order.length > 0) {
  2061. localStorage.setItem('dtOrderColumn', order[0][0]);
  2062. localStorage.setItem('dtOrderDir', order[0][1]);
  2063. }
  2064. }
  2065. window.scrollTo({
  2066. top: 0,
  2067. behavior: 'smooth'
  2068. });
  2069. @this.edit(id);
  2070. }
  2071. function deleteData(id)
  2072. {
  2073. if (confirm('Sei sicuro?'))
  2074. @this.delete(id);
  2075. }
  2076. function archiveMultipleData()
  2077. {
  2078. var ids = [];
  2079. $(".chkIds").each(function () {
  2080. if (this.checked) ids.push($(this).val());
  2081. });
  2082. if (ids.length) {
  2083. if (confirm('Sei sicuro? Gli utenti non saranno più visibili ma potranno essere ripristinati dalla sezione Archivio.'))
  2084. @this.archiveMultiple(ids);
  2085. }
  2086. }
  2087. function archiveData(id)
  2088. {
  2089. if (confirm('Sei sicuro? L\'utente non sarà più visibile ma potrà essere ripristinato dalla sezione Archivio.'))
  2090. @this.archive(id);
  2091. }
  2092. var isFilter = false;
  2093. $(document).ready(function() {
  2094. $(document).on("click",".showHideFilter",function() {
  2095. if (isFilter)
  2096. {
  2097. isFilter = false;
  2098. $(".showFilter").hide();
  2099. }
  2100. else
  2101. {
  2102. isFilter = true;
  2103. $(".showFilter").show();
  2104. }
  2105. });
  2106. } );
  2107. $(document).ready(function() {
  2108. loadDataTable();
  2109. } );
  2110. Livewire.on('load-data-table', () => {
  2111. setTimeout(function() {loadDataTable()}, 100);
  2112. });
  2113. Livewire.on('destroy-data-table', () => {
  2114. $('#tablesaw-350').DataTable().destroy();
  2115. });
  2116. function destroyDataTable()
  2117. {
  2118. $('#tablesaw-350').DataTable().destroy();
  2119. }
  2120. $('.filterCards').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2121. $('.filterStatus').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2122. $('.filterScadenza').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2123. $('.filterCertificateType').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2124. $('.filterCategories').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2125. @if(isset($_GET["showFilters"]))
  2126. var filterStatus = localStorage.getItem("filterStatusMember");
  2127. if (filterStatus)
  2128. {
  2129. $('.filterStatus').val(filterStatus).trigger('change');
  2130. }
  2131. var filterCards = localStorage.getItem("filterCardsMember");
  2132. if (filterCards)
  2133. {
  2134. $('.filterCards').val(filterCards).trigger('change');
  2135. }
  2136. var filterScadenza = localStorage.getItem("filterScadenzaMember");
  2137. if (filterScadenza)
  2138. {
  2139. $('.filterScadenza').val(filterScadenza).trigger('change');
  2140. }
  2141. var filterCertificateType = localStorage.getItem("filterCertificateTypeMember");
  2142. if (filterCertificateType)
  2143. {
  2144. $('.filterCertificateType').val(filterCertificateType).trigger('change');
  2145. }
  2146. var filterCategories = localStorage.getItem("filterCategoriesMember");
  2147. if (filterCategories)
  2148. {
  2149. $('.filterCategories').val(filterCategories).trigger('change');
  2150. }
  2151. var fromYear = localStorage.getItem("fromYearMember");
  2152. if (fromYear)
  2153. {
  2154. $('input[name="txtFromYear"]').val(fromYear);
  2155. }
  2156. var toYear = localStorage.getItem("toYearMember");
  2157. if (toYear)
  2158. {
  2159. $('input[name="txtToYear"]').val(toYear);
  2160. }
  2161. var fromYearYear = localStorage.getItem("fromYearYearMember");
  2162. if (fromYearYear)
  2163. {
  2164. $('input[name="txtFromYearYear"]').val(fromYearYear);
  2165. }
  2166. var toYearYear = localStorage.getItem("toYearYearMember");
  2167. if (toYearYear)
  2168. {
  2169. $('input[name="txtToYearYear"]').val(toYearYear);
  2170. }
  2171. @endif
  2172. $(document).on("keypress", $('.filterCategories'), function (e) {
  2173. setTimeout(() => {
  2174. $(".select2-results__option").each(function(){
  2175. var txt = $(this).html();
  2176. var count = (txt.match(/-/g) || []).length;
  2177. $(this).addClass('paddingLeftSelect' + count);
  2178. });
  2179. }, 100);
  2180. });
  2181. $('.filterCategories').on('select2:open', function (e) {
  2182. setTimeout(() => {
  2183. $(".select2-results__option").each(function(){
  2184. var txt = $(this).html();
  2185. var count = (txt.match(/-/g) || []).length;
  2186. $(this).addClass('paddingLeftSelect' + count);
  2187. });
  2188. }, 100);
  2189. });
  2190. function reset()
  2191. {
  2192. $('.filterCards').val('').trigger('change');
  2193. $('.filterStatus').val('').trigger('change');
  2194. $('.filterScadenza').val('-1').trigger('change');
  2195. $('.filterCertificateType').val('-1').trigger('change');
  2196. $('.filterCategories').val('-1').trigger('change');
  2197. /*
  2198. $(".chkCertificateNormal").prop( "checked", false );
  2199. $(".chkCertificateAgonistico").prop( "checked", false );
  2200. $(".chkCertificateScadenza").prop( "checked", false );
  2201. $(".chkCertificateScaduti").prop( "checked", false );
  2202. */
  2203. $('input[name="txtFromYear"]').val('');
  2204. $('input[name="txtToYear"]').val('');
  2205. $('input[name="txtFromYearYear"]').val('');
  2206. $('input[name="txtToYearYear"]').val('');
  2207. //localStorage.clear();
  2208. loadDataTable();
  2209. }
  2210. function loadDataTable() {
  2211. if ($.fn.DataTable.isDataTable('#tablesaw-350')) {
  2212. $('#tablesaw-350').DataTable().destroy();
  2213. }
  2214. // Get saved filters from localStorage
  2215. var fromYear = $('input[name="txtFromYear"]').val();
  2216. localStorage.setItem("fromYearMember", fromYear);
  2217. var toYear = $('input[name="txtToYear"]').val();
  2218. localStorage.setItem("toYearMember", toYear);
  2219. var fromYearYear = $('input[name="txtFromYearYear"]').val();
  2220. localStorage.setItem("fromYearYearMember", fromYearYear);
  2221. var toYearYear = $('input[name="txtToYearYear"]').val();
  2222. localStorage.setItem("toYearYearMember", toYearYear);
  2223. var filterCards = $('.filterCards').val();
  2224. localStorage.setItem("filterCardsMember", filterCards);
  2225. var filterStatus = $('.filterStatus').val();
  2226. localStorage.setItem("filterStatusMember", filterStatus);
  2227. var filterScadenza = $('.filterScadenza').val();
  2228. localStorage.setItem("filterScadenzaMember", filterScadenza);
  2229. var filterCertificateType = $('.filterCertificateType').val();
  2230. localStorage.setItem("filterCertificateTypeMember", filterCertificateType);
  2231. var filterCategories = $('.filterCategories').val();
  2232. localStorage.setItem("filterCategoriesMember", filterCategories)
  2233. const pageLength = 10;
  2234. // Create DataTable with restored settings
  2235. const dataTable = $('#tablesaw-350').DataTable({
  2236. serverSide: true,
  2237. ajax: '/get_members?cards=' + filterCards + "&filterCategories=" + filterCategories + "&filterCertificateType=" + filterCertificateType + "&filterScadenza=" + filterScadenza + "&filterStatus=" + filterStatus + "&fromYear=" + fromYear + "&toYear=" + toYear + "&fromYearYear=" + fromYearYear + "&toYearYear=" + toYearYear,
  2238. columns: [
  2239. {
  2240. data: "member_id",
  2241. orderable: false,
  2242. render: function (data){
  2243. var ret = '<input type="checkbox" name="chk'+data+'" value="'+data+'" class="chkIds" onchange="updateMultipleSelection()">';
  2244. return ret;
  2245. }
  2246. },
  2247. {
  2248. data: "last_name",
  2249. render: function (data){
  2250. const d = data.split("|");
  2251. var ret = '<a style="cursor:pointer" onclick="showData(' + d[1] + ')">' + d[0] + '</a>';
  2252. return ret;
  2253. }
  2254. },
  2255. {
  2256. data: "first_name",
  2257. render: function (data){
  2258. const d = data.split("|");
  2259. var ret = '<a style="cursor:pointer" onclick="showData(' + d[1] + ')">' + d[0] + '</a>';
  2260. return ret;
  2261. }
  2262. },
  2263. { data: "phone"},
  2264. { data: "age", "type": "num",class:"numericCol"},
  2265. { data: "year",class:"numericCol"},
  2266. {
  2267. data: "status",
  2268. render: function (data){
  2269. const d = data.split("|");
  2270. var ret = '<span class="tablesaw-cell-content"><span class="badge tessera-badge ' + d[0] + '">' + d[1] + '</span></span>';
  2271. return ret;
  2272. }
  2273. },
  2274. {
  2275. data: "certificate",
  2276. render: function (data){
  2277. var ret = '';
  2278. if (data != "") {
  2279. const d = data.split("|");
  2280. ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
  2281. if (d[0] == "0") {
  2282. ret += '<i class="ico--ui check suspended me-2"></i>';
  2283. ret += 'Scaduto: ';
  2284. }
  2285. if (d[0] == "1") {
  2286. ret += '<i class="ico--ui check due me-2"></i>';
  2287. ret += 'In scadenza: ';
  2288. }
  2289. if (d[0] == "2") {
  2290. ret += '<i class="ico--ui check active me-2"></i>';
  2291. ret += 'Scadenza: ';
  2292. }
  2293. ret += d[1];
  2294. ret += '</span>';
  2295. }
  2296. if(data == ""){
  2297. ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
  2298. ret += 'Non Presente';
  2299. ret += '</span>';
  2300. }
  2301. return ret;
  2302. }
  2303. },
  2304. {
  2305. data: "action",
  2306. render: function (data){
  2307. 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;';
  2308. ret += '<button type="button" class="btn" onclick="archiveData(' + data + ')" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Archivia"><i class="fa-regular fa-folder-closed"></i></button>';
  2309. return ret;
  2310. }
  2311. },
  2312. ],
  2313. fixedHeader: false,
  2314. // Set initial order from saved state or default
  2315. thead: {
  2316. 'th': {'background-color': 'blue'}
  2317. },
  2318. layout: {
  2319. topStart : null,
  2320. topEnd : null,
  2321. top1A: {
  2322. buttons: [
  2323. {
  2324. extend: 'collection',
  2325. text: 'ESPORTA',
  2326. buttons: [
  2327. {
  2328. extend: 'excelHtml5',"action":newexportaction,
  2329. title: 'Utenti',
  2330. exportOptions: {
  2331. columns: ":not(':last')",
  2332. page: 'all'
  2333. }
  2334. },
  2335. {
  2336. extend: 'pdfHtml5',"action":newexportaction,
  2337. title: 'Utenti',
  2338. exportOptions: {
  2339. columns: ":not(':last')"
  2340. },
  2341. customize: function(doc) {
  2342. doc.styles.tableHeader.alignment = 'left';
  2343. }
  2344. },
  2345. {
  2346. extend: 'print',"action":newexportaction,
  2347. text: 'Stampa',
  2348. title: 'Utenti',
  2349. exportOptions: {
  2350. columns: ":not(':last')"
  2351. }
  2352. }
  2353. ],
  2354. dropup: true
  2355. },
  2356. {
  2357. text: '<i class="fa-regular fa-folder-closed"></i>',
  2358. attr: {
  2359. id: 'btnArchive',
  2360. style: 'display: none',
  2361. onclick: 'archiveMultipleData()',
  2362. class: 'btn archive-multiple-btn',
  2363. "data-bs-toggle":"popover",
  2364. "data-bs-trigger":"hover focus",
  2365. "data-bs-placement":"bottom",
  2366. "data-bs-content":"Archivia",
  2367. }
  2368. },
  2369. ]
  2370. },
  2371. top1B : {
  2372. pageLength: {
  2373. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  2374. }
  2375. },
  2376. top1C :'search',
  2377. },
  2378. pagingType: 'numbers',
  2379. "language": {
  2380. "url": "/assets/js/Italian.json"
  2381. },
  2382. "fnInitComplete": function (oSettings, json) {
  2383. var html = '&nbsp;<a style="cursor:pointer" class="showHideFilter btn--ui"><i class="fa-solid fa-sliders"></i></a>';
  2384. html += '&nbsp;<a style="cursor:pointer" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  2385. $(".dt-search").append(html);
  2386. }
  2387. });
  2388. $('#tablesaw-350 thead tr th').addClass('col');
  2389. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  2390. $('#tablesaw-350').on('draw.dt', function() {
  2391. $('[data-bs-toggle="popover"]').popover()
  2392. });
  2393. $(".chkAll").change(function () {
  2394. var check = this.checked;
  2395. var ok = false;
  2396. $(".chkIds").each(function () {
  2397. $(this).prop("checked", check);
  2398. ok = true;
  2399. });
  2400. if (check && ok) {
  2401. $("#btnArchive").show();
  2402. } else {
  2403. $("#btnArchive").hide();
  2404. }
  2405. });
  2406. }
  2407. function updateMultipleSelection() {
  2408. let checked = false;
  2409. $(".chkIds").each(function () {
  2410. if (this.checked) checked = true;
  2411. });
  2412. if (checked) {
  2413. $("#btnArchive").show();
  2414. } else {
  2415. $("#btnArchive").hide();
  2416. $(".chkAll").prop("checked", false);
  2417. }
  2418. }
  2419. $(document).ready(function() {
  2420. $(document).on("click",".addData",function() {
  2421. $(".title--section_addButton").trigger("click")
  2422. });
  2423. } );
  2424. var isEdit = false;
  2425. var isEditCorso = false;
  2426. Livewire.on('setEdit', (x) =>
  2427. {
  2428. isEdit = x;
  2429. console.log(isEdit);
  2430. });
  2431. Livewire.on('setEditCorso', (x) =>
  2432. {
  2433. isEditCorso = x;
  2434. console.log("Edit corso" + isEditCorso);
  2435. });
  2436. Livewire.on('setErrorMsg', (errors) =>
  2437. {
  2438. function msg(value)
  2439. {
  2440. const myArray = value.split("=");
  2441. if (myArray[1] == '0' || myArray[1] == '')
  2442. $("span").find("[aria-controls='select2-" + myArray[0] + "-container']").css('border', 'solid 3px #dc3545');
  2443. }
  2444. console.log(errors);
  2445. //window.location.href = "#top";
  2446. //$("span").find(`[aria-controls='select2-birth_nation_id-container']`).css('border', 'solid 3px red');
  2447. });
  2448. Livewire.on('reload', (x) =>
  2449. {
  2450. location.reload();
  2451. });
  2452. Livewire.on('goToTop', () => {
  2453. @this.set('type', 'dati');
  2454. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2455. });
  2456. function storeAction(type)
  2457. {
  2458. @this.change('dati');
  2459. if (isEditCorso)
  2460. {
  2461. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2462. @this.store(type);
  2463. }
  2464. else
  2465. {
  2466. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2467. //window.location.href = "#top";
  2468. }
  2469. }
  2470. function updateAction(type)
  2471. {
  2472. @this.change('dati');
  2473. if (isEditCorso)
  2474. {
  2475. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2476. @this.updateAAA(type);
  2477. }
  2478. else
  2479. {
  2480. @this.updateAAA(type);
  2481. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2482. }
  2483. }
  2484. function cancelAction()
  2485. {
  2486. if (isEditCorso)
  2487. {
  2488. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2489. @this.cancel();
  2490. }
  2491. else
  2492. @this.cancel();
  2493. }
  2494. function annulla()
  2495. {
  2496. window.onbeforeunload = null;
  2497. document.location.href = '/members';
  2498. }
  2499. function store(reload) {
  2500. window.onbeforeunload = null;
  2501. @this.store(reload)
  2502. }
  2503. function updateAAA(reload) {
  2504. window.onbeforeunload = null;
  2505. @this.updateAAA(reload)
  2506. }
  2507. window.onbeforeunload = function(){
  2508. if (isEdit)
  2509. return 'Cambiando pagina le eventuali modifiche andranno perse';
  2510. if (isEditCorso)
  2511. return 'Devi prima salvare i dati del corso';
  2512. };
  2513. window.livewire.on('saved', () => {
  2514. $('#userModal').modal('hide');
  2515. });
  2516. Livewire.on('goToAnchor', () =>
  2517. {
  2518. window.location.href = "#top";
  2519. });
  2520. /*$(window).on('popstate', function(event) {
  2521. document.location.href = '/members';
  2522. });*/
  2523. $(function() {
  2524. if (window.history && window.history.pushState) {
  2525. window.history.pushState('', null, './');
  2526. $(window).on('popstate', function() {
  2527. // alert('Back button was pressed.');
  2528. //document.location.href = '#';
  2529. document.location.href = '/members';
  2530. });
  2531. }
  2532. });
  2533. function setupBackButtonHandlers() {
  2534. const backButtons = document.querySelectorAll('a.btn--ui.lightGrey[href^="/"]');
  2535. backButtons.forEach(button => {
  2536. button.addEventListener('click', function(e) {
  2537. });
  2538. });
  2539. }
  2540. $(document).ready(function() {
  2541. setupBackButtonHandlers();
  2542. });
  2543. document.addEventListener('livewire:load', () => {
  2544. Livewire.on('focus-error-field', (fieldId) => {
  2545. console.log('Validation errors received:', fieldId);
  2546. let element;
  2547. if (typeof fieldId === 'string') {
  2548. element = document.getElementById(fieldId);
  2549. } else if (Array.isArray(fieldId) && fieldId.length > 0) {
  2550. const firstFieldId = fieldId[0];
  2551. element = document.getElementById(firstFieldId);
  2552. fieldId = firstFieldId; // Use the first fieldId for highlighting
  2553. }
  2554. if (element) {
  2555. element.focus();
  2556. element.scrollIntoView({
  2557. behavior: 'smooth',
  2558. block: 'center'
  2559. });
  2560. // Add the is-invalid class to highlight the field
  2561. element.classList.add('is-invalid');
  2562. // Also highlight the label
  2563. const label = document.querySelector(`label[for="${fieldId}"]`);
  2564. if (label) {
  2565. label.classList.add('text-danger');
  2566. }
  2567. // Prevent the class from being removed
  2568. const preserveInvalidClass = () => {
  2569. if (!element.classList.contains('is-invalid')) {
  2570. element.classList.add('is-invalid');
  2571. }
  2572. };
  2573. // Set an interval to ensure the class stays applied
  2574. const intervalId = setInterval(preserveInvalidClass, 100);
  2575. // Stop preserving after user interaction
  2576. element.addEventListener('input', () => {
  2577. clearInterval(intervalId);
  2578. // Optional: Remove the highlighting when user edits the field
  2579. // element.classList.remove('is-invalid');
  2580. // if (label) label.classList.remove('text-danger');
  2581. });
  2582. } else {
  2583. console.warn('Element with id ' + fieldId + ' not found');
  2584. }
  2585. });
  2586. });
  2587. function getNextTab(currentTab) {
  2588. const tabs = ['dati', 'tesseramento', 'corsi', 'gruppi'];
  2589. const currentIndex = tabs.indexOf(currentTab);
  2590. return currentIndex < tabs.length - 1 ? tabs[currentIndex + 1] : currentTab;
  2591. }
  2592. function scrollToFormTop() {
  2593. const formSection = document.querySelector('.section--tab, .form--wrapper, #card--resume');
  2594. if (formSection) {
  2595. formSection.scrollIntoView({
  2596. behavior: 'instant',
  2597. block: 'start',
  2598. inline: 'nearest'
  2599. });
  2600. return true;
  2601. }
  2602. return false;
  2603. }
  2604. Livewire.on('saved-and-close', (currentTab) => {
  2605. document.location.href = '/members';
  2606. });
  2607. Livewire.on('saved-and-continue', (currentTab) => {
  2608. const nextTab = getNextTab(currentTab);
  2609. if (nextTab !== currentTab) {
  2610. @this.change(nextTab);
  2611. }
  2612. setTimeout(() => {
  2613. if (!scrollToFormTop()) {
  2614. window.scrollTo({ top: 0, behavior: 'instant' });
  2615. document.body.scrollTop = 0;
  2616. document.documentElement.scrollTop = 0;
  2617. }
  2618. const firstInput = document.querySelector('#first_name');
  2619. if (firstInput) {
  2620. firstInput.focus();
  2621. }
  2622. }, 200);
  2623. });
  2624. function downloadChart(chartId) {
  2625. x.toBase64Image()
  2626. var a = document.createElement('a');
  2627. a.href = Chart.getChart(chartId).toBase64Image()
  2628. a.download = @this.first_name + " " + @this.last_name + ' - Grafico Presenze.png';
  2629. a.click();
  2630. a.remove();
  2631. }
  2632. Livewire.on('load-chart', (mesi, valori, chartData) => {
  2633. try {
  2634. const ctx = document.getElementById('presenzeChart');
  2635. try {
  2636. x.destroy();
  2637. }
  2638. catch (ee) {}
  2639. x = new Chart(ctx, {
  2640. type: 'bar',
  2641. data: {
  2642. labels: mesi,
  2643. // datasets: [
  2644. // {
  2645. // label: 'Presenze',
  2646. // data: valori,
  2647. // borderWidth: 1
  2648. // }
  2649. // ],
  2650. datasets: chartData,
  2651. },
  2652. options: {
  2653. responsive: true,
  2654. // maintainAspectRatio: false,
  2655. interaction: {
  2656. mode: 'index',
  2657. intersect: false,
  2658. },
  2659. scales: {
  2660. y: {
  2661. beginAtZero: true
  2662. }
  2663. },
  2664. plugins: {
  2665. legend: {
  2666. display: false,
  2667. },
  2668. tooltip: {
  2669. backgroundColor: 'rgba(255, 255, 255, 1)',
  2670. titleColor: '#212529',
  2671. bodyColor: '#495057',
  2672. borderColor: '#e9ecef',
  2673. borderWidth: 2,
  2674. cornerRadius: 0,
  2675. titleFont: {
  2676. size: 18,
  2677. weight: 'bold',
  2678. },
  2679. bodyFont: {
  2680. size: 16,
  2681. weight: '400',
  2682. },
  2683. },
  2684. },
  2685. }
  2686. }
  2687. );
  2688. }
  2689. catch(e) {
  2690. console.log(e);
  2691. }
  2692. });
  2693. </script>
  2694. @endpush