member.blade.php 188 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014
  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. <option value="">-- Stagione --</option>
  1018. @foreach($presenceYears as $y)
  1019. <option value="{{$y}}">{{$y}}</option>
  1020. @endforeach
  1021. </select>
  1022. </div>
  1023. <div class="col-md-6">
  1024. <select class="form-control" wire:model="presenceCourseFilter" @if(empty($presenceCourses)) disabled @endif>
  1025. <option value="">-- Corso --</option>
  1026. @foreach($presenceCourses as $c)
  1027. <option value="{{$c->id}}">
  1028. {{$c->getDetailsName()}}
  1029. </option>
  1030. @endforeach
  1031. </select>
  1032. </div>
  1033. </div>
  1034. <br>
  1035. <div class="row align-items-center">
  1036. <div class="col">
  1037. <div class="box-presenze">
  1038. <span><b>Presenze</b>: {{ $presenze }}</span>
  1039. </div>
  1040. </div>
  1041. <div class="col">
  1042. <div class="box-assenze">
  1043. <span><b>Assenze</b>: {{ $assenze }}</span>
  1044. </div>
  1045. </div>
  1046. <div class="col"@if (!empty($recuperi)) style="border-right: 1px solid gray"@endif>
  1047. <div class="box-annullate">
  1048. <span><b>Annullate</b>: {{ $annullate }}</span>
  1049. </div>
  1050. </div>
  1051. @if (!empty($recuperi))
  1052. <div class="col">
  1053. <div class="box-presenze text-start">
  1054. @foreach ($recuperi as $name => $count)
  1055. <span><b>{!! $name !!}</b>: {{ $count }}</span><br>
  1056. @endforeach
  1057. </div>
  1058. </div>
  1059. @endif
  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"
  1066. data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Scarica grafico">
  1067. <i class="fas fa-download"></i>
  1068. </button>
  1069. </div>
  1070. </div>
  1071. </div>
  1072. @if (!empty($member_presences))
  1073. <div class="row" style="height: 300px; overflow:auto;">
  1074. <div class="col-md-12">
  1075. <table class="table tablesaw tableHead tablesaw-stack tabella--presenze" style="min-width:700px">
  1076. <thead>
  1077. <tr>
  1078. <th style="width: 20%">Data</th>
  1079. <th style="width: 20%">Orario</th>
  1080. <th style="width: 15%">Stato</th>
  1081. <th style="width: 45%">Motivazione</th>
  1082. </tr>
  1083. </thead>
  1084. <tbody>
  1085. @foreach($member_presences as $mp)
  1086. <tr>
  1087. <td>{{ date("d/m/Y", strtotime($mp["from"])) }}</td>
  1088. <td>{{ date("H:i", strtotime($mp["from"])) }} - {{ date("H:i", strtotime($mp["to"])) }}</td>
  1089. <td>{!! $mp["status"] !!}</td>
  1090. <td>{!! $mp["motivation"] !!}</td>
  1091. </tr>
  1092. @endforeach
  1093. </tbody>
  1094. </table>
  1095. </div>
  1096. </div>
  1097. @endif
  1098. </div>
  1099. @endif
  1100. @if($type == 'corsi')
  1101. @if($dataId > 0)
  1102. @if(!$addCourse && !$updateCourse)
  1103. @if(false && $active["status"] != 2 && $active["status"] != 1 )
  1104. <div class="alert alert-warning" role="alert">
  1105. <strong>Attenzione:</strong> Per aggiungere corsi è necessario avere un tesseramento.
  1106. </div>
  1107. @endif
  1108. <table class="table tablesaw tableHead tablesaw-stack tabella--corsi" id="tablesaw-350-2" style="min-width:800px">
  1109. <tbody id="checkall-target">
  1110. @foreach($member_courses as $member_course)
  1111. <tr>
  1112. <td style="width:10%">
  1113. <b>{{$member_course->course->name}}</b><br>
  1114. </td>
  1115. <td style="width:10%">
  1116. {{$member_course->course->year}}<br>
  1117. </td>
  1118. <td style="width:5%">
  1119. {{$member_course->course->type->name ?? ""}}<br>
  1120. </td>
  1121. <td style="width:10%">
  1122. {{$member_course->course->level->name ?? ""}}<br>
  1123. </td>
  1124. <td style="width:25%">
  1125. @foreach(json_decode($member_course->when) as $xx => $x)
  1126. @if($xx > 0)
  1127. <br>
  1128. @endif
  1129. @foreach($x->day as $zz => $d)
  1130. {{$zz > 0 ? '-' : ''}}{{$d}}
  1131. @endforeach
  1132. h {{$x->from}} - {{$x->to}}
  1133. @endforeach
  1134. </td>
  1135. <td style="width:25%">
  1136. @php
  1137. $aMo = json_decode($member_course->months);
  1138. if (sizeof($aMo) == 1)
  1139. {
  1140. print($this->getMonth($aMo[0]->m));
  1141. }
  1142. if (sizeof($aMo) > 1)
  1143. {
  1144. print($this->getMonth($aMo[0]->m) . " - " . $this->getMonth($aMo[sizeof($aMo) - 1]->m));
  1145. }
  1146. @endphp
  1147. </td>
  1148. @if(false)
  1149. <td style="width:10%">Iscrizione:<br><b>{{$member_course->status == 1 ? 'Pagata' : ($member_course->status == 2 ? 'Da pagare' : 'Sospesa')}}</b></td>
  1150. @endif
  1151. <td style="text-align:right;width:15%">
  1152. <button type="button" class="btn" wire:click="showHideCourse({{ $member_course->id }})"><i class="fa-solid fa-chevron-down"></i></button>&nbsp;
  1153. </td>
  1154. </tr>
  1155. @if(in_array($member_course->id, $showCourse))
  1156. <tr>
  1157. <td colspan="6">
  1158. <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>
  1159. <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;
  1160. <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;
  1161. <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;
  1162. <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;
  1163. <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;
  1164. <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;
  1165. <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;
  1166. <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;
  1167. <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;
  1168. <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;
  1169. <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;
  1170. <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;
  1171. </td>
  1172. <td>
  1173. <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;
  1174. <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>
  1175. </td>
  1176. </tr>
  1177. <tr>
  1178. <td colspan="7">
  1179. @if($selectedCourseMember == $member_course->id)
  1180. @if(sizeof($payMonths) > 0 || $createSubscription)
  1181. <button class="btn--ui primary" style="color:white" wire:click="newPayment({{$member_course}})">Nuova entrata</button>&nbsp;
  1182. <button class="btn--ui primary" style="color:white" wire:click="block({{$member_course}})">Sospendi</button>
  1183. @endif
  1184. @if(sizeof($suspendedMonths) > 0)
  1185. <button class="btn--ui primary" style="color:white" wire:click="reactivate({{$member_course}})">Riattiva</button>&nbsp;
  1186. @endif<br>
  1187. @endif
  1188. @if($member_course->notes != '')
  1189. <br><b>Note</b><br>
  1190. {{$member_course->notes}}
  1191. @endif
  1192. </td>
  1193. </tr>
  1194. @endif
  1195. @endforeach
  1196. </tbody>
  1197. </table>
  1198. @if($dataId > 0)
  1199. <button class="btn--ui primary" wire:click.prevent="addCourse()" style="max-width:200px">Aggiungi</button>
  1200. @if(false)
  1201. @if ($active["status"] == 2 || $active["status"] == 1)
  1202. <button class="btn--ui primary" wire:click.prevent="addCourse()" style="max-width:200px">Aggiungi</button>
  1203. @else
  1204. <button class="btn--ui lightGrey" disabled style="max-width:200px">Aggiungi corso (non disponibile)</button>
  1205. <small class="text-muted d-block mt-1">Completa prima il tesseramento per abilitare l'aggiunta di corsi</small>
  1206. @endif
  1207. @endif
  1208. @endif
  1209. @else
  1210. <div class="form--wrapper">
  1211. <form class="form--utente">
  1212. @if(false)
  1213. <div class="row ">
  1214. <div class="col-md-6">
  1215. <label for="course_course_id" class="form-label">Corso</label>
  1216. <select id="course_course_id" class="form-select @error('course_course_id') is-invalid @enderror" aria-label="Corso" wire:model="course_course_id" >
  1217. <option value="">
  1218. @foreach($courses as $course)
  1219. <option value="{{$course->id}}">{{$course->name}} - {{$course->level->name ?? ""}} - {{$course->type->name ?? ""}} - {{$course->frequency->name ?? ""}}
  1220. @endforeach
  1221. </select>
  1222. @if($course_exist)
  1223. <small style="color:red">Attenzione: il corso selezionato è già associato all'utente</small>
  1224. @endif
  1225. </div>
  1226. </div>
  1227. @endif
  1228. <div class="row ">
  1229. <div class="col-md-3">
  1230. <label for="course_name" class="form-label">Corso</label>
  1231. <select id="course_name" class="form-select @error('course_course_id') is-invalid @enderror" aria-label="Corso" wire:model="course_name" >
  1232. <option value="">
  1233. @foreach($course_names as $n)
  1234. <option value="{{$n}}">{{$n}}
  1235. @endforeach
  1236. </select>
  1237. @error('course_course_id')
  1238. <div class="invalid-feedback">Devi selezionare un corso (corso, livello, tipologia e frequenza)</div>
  1239. @enderror
  1240. @if($course_exist)
  1241. <small style="color:red">Attenzione: il corso selezionato è già associato all'utente</small>
  1242. @endif
  1243. </div>
  1244. @if($course_name != '')
  1245. <div class="col-md-3">
  1246. <label for="course_level_id" class="form-label">Livello</label>
  1247. <select id="course_level_id" class="form-select" aria-label="Livello" wire:model="course_level_id" >
  1248. <option value="">
  1249. @foreach($course_levels as $l)
  1250. <option value="{{$l->id}}">{{$l->name}}
  1251. @endforeach
  1252. </select>
  1253. </div>
  1254. @endif
  1255. @if($course_level_id != '')
  1256. <div class="col-md-3">
  1257. <label for="course_type_id" class="form-label">Tipologia</label>
  1258. <select id="course_type_id" class="form-select" aria-label="Tipologia" wire:model="course_type_id" >
  1259. <option value="">
  1260. @foreach($course_types as $t)
  1261. <option value="{{$t->id}}">{{$t->name}}
  1262. @endforeach
  1263. </select>
  1264. </div>
  1265. @endif
  1266. @if($course_type_id != '')
  1267. <div class="col-md-3">
  1268. <label for="course_frequency_id" class="form-label">Frequenza</label>
  1269. <select id="course_frequency_id" class="form-select" aria-label="Tipologia" wire:model="course_frequency_id" >
  1270. <option value="">
  1271. @foreach($course_frequencies as $f)
  1272. <option value="{{$f->id}}">{{$f->name}}
  1273. @endforeach
  1274. </select>
  1275. </div>
  1276. @endif
  1277. </div>
  1278. <div class="row mt-4">
  1279. <div class="col-md-6">
  1280. <label for="course_course_subscription_id" class="form-label">Abbonamento</label>
  1281. <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">
  1282. <option value="">
  1283. @foreach($course_subscriptions as $t)
  1284. <option value="{{$t["id"]}}">{{$t["name"]}}
  1285. @endforeach
  1286. </select>
  1287. </div>
  1288. <div class="col-md-6">
  1289. <label for="course_price" class="form-label">Costo mensile</label>
  1290. <input class="form-control" type="text" id="course_price" placeholder="Costo mensile" wire:model="course_price" onkeyup="onlyNumberAmount(this)">
  1291. </div>
  1292. @if(false)
  1293. <div class="col-md-6">
  1294. <label for="course_status" class="form-label">Stato iscrizione</label>
  1295. <select id="course_status" class="form-select @error('course_status') is-invalid @enderror" aria-label="Stato" wire:model="course_status">
  1296. <option value="">
  1297. <option value="1">Pagata
  1298. <option value="2">Da pagare
  1299. <option value="3">Sospesa
  1300. </select>
  1301. </div>
  1302. @endif
  1303. </div>
  1304. <div class="row mt-4 course--duration">
  1305. <div class="col-md-12">
  1306. <label for="duration" class="form-label">Durata del corso</label>
  1307. <div class="d-flex course--duration_mounth">
  1308. <a class="{{$this->checkMonth(9) ? 'selected' : 'notSelected'}}" wire:click="setMonth(9)">Set</a>
  1309. <a class="{{$this->checkMonth(10) ? 'selected' : 'notSelected'}}" wire:click="setMonth(10)">Ott</a>
  1310. <a class="{{$this->checkMonth(11) ? 'selected' : 'notSelected'}}" wire:click="setMonth(11)">Nov</a>
  1311. <a class="{{$this->checkMonth(12) ? 'selected' : 'notSelected'}}" wire:click="setMonth(12)">Dic</a>
  1312. <a class="{{$this->checkMonth(1) ? 'selected' : 'notSelected'}}" wire:click="setMonth(1)">Gen</a>
  1313. <a class="{{$this->checkMonth(2) ? 'selected' : 'notSelected'}}" wire:click="setMonth(2)">Feb</a>
  1314. <a class="{{$this->checkMonth(3) ? 'selected' : 'notSelected'}}" wire:click="setMonth(3)">Mar</a>
  1315. <a class="{{$this->checkMonth(4) ? 'selected' : 'notSelected'}}" wire:click="setMonth(4)">Apr</a>
  1316. <a class="{{$this->checkMonth(5) ? 'selected' : 'notSelected'}}" wire:click="setMonth(5)">Mag</a>
  1317. <a class="{{$this->checkMonth(6) ? 'selected' : 'notSelected'}}" wire:click="setMonth(6)">Giu</a>
  1318. <a class="{{$this->checkMonth(7) ? 'selected' : 'notSelected'}}" wire:click="setMonth(7)">Lug</a>
  1319. <a class="{{$this->checkMonth(8) ? 'selected' : 'notSelected'}}" wire:click="setMonth(8)">Ago</a>
  1320. </div>
  1321. </div>
  1322. </div>
  1323. <div class="row mt-4">
  1324. <div class="col-md-6">
  1325. <label for="course_subscription_price" class="form-label">Costo iscrizione</label>
  1326. <input class="form-control" type="text" id="course_subscription_price" placeholder="Costo iscrizione" wire:model="course_subscription_price" onkeyup="onlyNumberAmount(this)">
  1327. </div>
  1328. </div>
  1329. <div class="row mt-4">
  1330. <div class="col-md-6">
  1331. <label for="course_date_from" class="form-label">Dal</label>
  1332. <input class="form-control" type="date" id="course_date_from" placeholder="Dal" wire:model="course_date_from">
  1333. </div>
  1334. <div class="col-md-6">
  1335. <label for="course_date_to" class="form-label">Al</label>
  1336. <input class="form-control" type="date" id="course_date_to" placeholder="Al" wire:model="course_date_to">
  1337. </div>
  1338. </div>
  1339. @foreach($course_when as $idW => $when)
  1340. <div class="row">
  1341. <div class="col-12">
  1342. <div class="day durata--corso d-flex">
  1343. <label for="" class="form-label">Giorno</label>
  1344. <div class="durata--corso_days mb-3">
  1345. <a class="{{in_array('lun', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'lun')">Lun</a>
  1346. <a class="{{in_array('mar', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'mar')">Mar</a>
  1347. <a class="{{in_array('mer', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'mer')">Mer</a>
  1348. <a class="{{in_array('gio', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'gio')">Gio</a>
  1349. <a class="{{in_array('ven', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'ven')">Ven</a>
  1350. <a class="{{in_array('sab', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'sab')">Sab</a>
  1351. <a class="{{in_array('dom', $course_when[$idW]["day"]) ? 'selected' : 'notSelected'}}" wire:click="setDay({{$idW}}, 'dom')">Dom</a>
  1352. </div>
  1353. <div class="durata--corso_select">
  1354. <div class="from--h me-3">
  1355. <label for="" class="form-label">Dalle</label>
  1356. <select class="form-select" wire:model="course_when.{{$idW}}.from">
  1357. <option value="">--Seleziona--
  1358. @for($c=6;$c<=23;$c++)
  1359. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00
  1360. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30
  1361. @endfor
  1362. </select>
  1363. </div>
  1364. <div class="to--h">
  1365. <label for="" class="form-label">Alle</label>
  1366. <select class="form-select" wire:model="course_when.{{$idW}}.to">
  1367. <option value="">--Seleziona--
  1368. @for($c=6;$c<=23;$c++)
  1369. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:00
  1370. <option value="{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30">{{str_pad($c, 2, "0", STR_PAD_LEFT)}}:30
  1371. @endfor
  1372. </select>
  1373. </div>
  1374. </div>
  1375. <button class="btn--ui primary remove--day position-absolute" wire:click.prevent="delRow({{$idW}})"><i class="fa-solid fa-minus"></i></button>
  1376. <button class="btn--ui primary add--day position-absolute" wire:click.prevent="addRow()"><i class="fa-solid fa-plus"></i></button>
  1377. </div>
  1378. </div>
  1379. </div>
  1380. @endforeach
  1381. <div class="row mt-2">
  1382. <div class="col-md-12">
  1383. <label for="course_date_from" class="form-label">Note</label>
  1384. <input class="form-control" type="text" id="course_note" placeholder="Note" wire:model="course_note">
  1385. </div>
  1386. </div>
  1387. </form>
  1388. </div>
  1389. <br>
  1390. <div class="row mt-2">
  1391. <div class="col-md-12">
  1392. <button class="btn--ui lightGrey" wire:click.prevent="cancelCourse()">Annulla</button>
  1393. @if($addCourse)
  1394. @if(!$course_exist)
  1395. <button class="btn--ui primary" wire:click.prevent="storeCourse()">Salva corso</button>
  1396. @endif
  1397. @endif
  1398. @if($updateCourse)
  1399. <button class="btn--ui primary" wire:click.prevent="updateCourse()">Salva corso</button>
  1400. @endif
  1401. </div>
  1402. </div>
  1403. @endif
  1404. @endif
  1405. @endif
  1406. </div>
  1407. </div>
  1408. <div class="col-md-5 col-xl-4 p-3">
  1409. <div id="card--resume" class="primary card--ui ms-3 user--resume">
  1410. <header>
  1411. <div class="username d-flex align-items-start">
  1412. <i class="ico--ui utenti light me-2"></i>
  1413. <div class="user--resume_name d-flex flex-column">
  1414. <span class="user-name">{{ strtoupper($first_name) }} {{ strtoupper($last_name) }}</span>
  1415. <span class="user-email">{{ $birth_date ? date("d/m/Y", strtotime($birth_date)) : '' }}{!!$age != '' ? ' (' . $age . ')' : ''!!}</span>
  1416. </div>
  1417. </div>
  1418. </header>
  1419. <div class="card--resume_body">
  1420. <ul class="user-address mb-4 p-0">
  1421. <li><i class="ico--ui resume--ico phone me-2"></i><span>Tel. {{ $phone }}</span></li>
  1422. <li><i class="ico--ui resume--ico mail light me-2"></i><span>{{ $email }}</span></li>
  1423. </ul>
  1424. <ul class="user-residence p-0">
  1425. <li><i class="ico--ui resume--ico residence me-2"></i>
  1426. <span>
  1427. @if($city_id > 0)
  1428. {{$this->getCity($city_id)}}
  1429. @if($province_id > 0)
  1430. ( {{$this->getProvince($province_id)}} ) -
  1431. @endif
  1432. @endif
  1433. {{ $zip_code }}<br>
  1434. {{ $address }}
  1435. </span>
  1436. </li>
  1437. </ul>
  1438. <div class="resume--tab_info credito">
  1439. <h2 class="mb-3">Borsellino MAD</h2>
  1440. <span class="value">{{formatPrice($money)}}</span>
  1441. </div>
  1442. <div class="resume--tab_info gruppi corsi">
  1443. <h2 class="mb-3">Corsi</h2>
  1444. @foreach($member_courses as $member_course)
  1445. <div class="resume--info d-flex align-items-center">
  1446. <div class="row" style="margin-top:10px">
  1447. <div class="row">
  1448. <strong>{{$member_course->course->getTree()}} <span style="font-weight:lighter">({{$member_course->course->year}})</span></strong></span><br>
  1449. </div>
  1450. <div class="row">
  1451. <span class="title-detail">
  1452. @php
  1453. $aMo = json_decode($member_course->months);
  1454. if (sizeof($aMo) == 1)
  1455. {
  1456. print($this->getMonth($aMo[0]->m));
  1457. }
  1458. if (sizeof($aMo) > 1)
  1459. {
  1460. print($this->getMonth($aMo[0]->m) . " - " . $this->getMonth($aMo[sizeof($aMo) - 1]->m));
  1461. }
  1462. @endphp
  1463. </span>
  1464. </div>
  1465. <div class="row">
  1466. <span class="title-detail">
  1467. @foreach(json_decode($member_course->when) as $xx => $x)
  1468. @if($xx > 0)
  1469. <br>
  1470. @endif
  1471. @foreach($x->day as $d)
  1472. {{$d}}
  1473. @endforeach
  1474. {{$x->from}} - {{$x->to}}
  1475. @endforeach
  1476. </span>
  1477. </div>
  1478. </div>
  1479. </div>
  1480. @endforeach
  1481. </div>
  1482. <div class="resume--tab_info tesseramento">
  1483. <h2 class="mb-3">Tesseramento</h2>
  1484. @foreach($member_cards as $member_card)
  1485. @if($member_card->expire_date . " 23:59:59" > date("Y-m-d"))
  1486. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1487. <div class="resume--info d-flex align-items-start">
  1488. <i class="ico--ui tessera me-2"></i>
  1489. <div class="title--tessera_added">
  1490. <h4>{{$member_card->card->name}}</h4>
  1491. <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>
  1492. @if($member_card->discipline_1)
  1493. </br>
  1494. <span class="title-detail">Disciplina: <b>{{$member_card->discipline_1->name}}</b></span>
  1495. @endif
  1496. @if($member_card->discipline_2)
  1497. </br>
  1498. <span class="title-detail">Disciplina: <b>{{$member_card->discipline_2->name}}</b></span>
  1499. @endif
  1500. @if($member_card->discipline_3)
  1501. </br>
  1502. <span class="title-detail">Disciplina: <b>{{$member_card->discipline_3->name}}</b></span>
  1503. @endif
  1504. </div>
  1505. </div>
  1506. <span class="badge tessera-badge active">attiva</span>
  1507. </div>
  1508. @endif
  1509. @endforeach
  1510. </div>
  1511. <div class="resume--tab_info tesseramento">
  1512. <h2 class="mb-3">Certificato</h2>
  1513. @if(sizeof($member_certificates) > 0)
  1514. @php
  1515. $cert = $member_certificates[0]
  1516. @endphp
  1517. @if($cert->expire_date . " 23:59:59" > date("Y-m-d"))
  1518. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1519. <div class="resume--info d-flex align-items-start">
  1520. <i class="fa-regular fa-file-lines me-2"></i>
  1521. <div class="title--tessera_added">
  1522. <h4>{{$cert->type == 'A' ? 'Agonistico' : 'Non agonistico'}}</h4>
  1523. <span class="title-detail">Scadenza: <span class="title-detail_date">{{$cert->expire_date ? date("d/m/Y", strtotime($cert->expire_date)) : ''}}</span></span></small>
  1524. </div>
  1525. </div>
  1526. @if($cert->expire_date . " 23:59:59" < date("Y-m-d"))
  1527. <span class="badge tessera-badge suspended">scaduto</span>
  1528. @endif
  1529. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d") && $cert->expire_date < date("Y-m-d", strtotime("+1 month")))
  1530. <span class="badge tessera-badge due">in scadenza</span>
  1531. @endif
  1532. @if($cert->expire_date . " 23:59:59" >= date("Y-m-d", strtotime("+1 month")))
  1533. <span class="badge tessera-badge active">valido</span>
  1534. @endif
  1535. </div>
  1536. @endif
  1537. @endif
  1538. <!--
  1539. <div class="resume--wrapper d-flex align-items-start justify-content-between mb-2">
  1540. <div class="resume--info d-flex align-items-start">
  1541. <i class="ico--ui tessera me-2"></i>
  1542. <div class="title--tessera_added">
  1543. <h4>Tennis/Corso Tennis/Adulti/Bisettimanale</h4>
  1544. <span class="title-detail">Iscrizione: <span class="title-detail_date">12 marzo 2022</span></span></small>
  1545. </div>
  1546. </div>
  1547. <span class="badge tessera-badge active">attiva</span>
  1548. </div>-->
  1549. </div>
  1550. <div class="resume--tab_info gruppi">
  1551. <h2 class="mb-3">Gruppi di appartenenza</h2>
  1552. @foreach($member_categories as $member_category)
  1553. <div class="resume--info d-flex align-items-center">
  1554. <i class="ico--ui gruppi me-2"></i><span><strong>{{$member_category->category->getTree()}}</strong></span>
  1555. </div>
  1556. @endforeach
  1557. </div>
  1558. </div>
  1559. </div>
  1560. </div>
  1561. </div>
  1562. </div>
  1563. <!-- save & continue section -->
  1564. <section class="save--section d-flex justify-content-start">
  1565. <div class="container">
  1566. <div class="row">
  1567. <div class="col-md-7 col-xl-8 d-flex gx-0">
  1568. @if($add)
  1569. <button class="btn--ui primary d-flex order-1 me-2" wire:click="store(false)">salva e continua</button>
  1570. <button class="btn--ui primary d-flex order-3 ms-auto" onclick="store(true)">salva e chiudi</button>
  1571. @endif
  1572. @if($update)
  1573. <button class="btn--ui primary d-flex order-1 me-2" wire:click="updateAAA(false)">salva e continua</button>
  1574. <button class="btn--ui primary d-flex order-3 ms-auto" onclick="updateAAA(true)">salva e chiudi</button>
  1575. @endif
  1576. <button class="btn--ui lightGrey" onclick="annulla()" style="margin-right:10px">annulla</button><br><br>
  1577. </div>
  1578. <div class="col-md-5 col-xl-4"></div>
  1579. </div>
  1580. </div>
  1581. </section>
  1582. @endif
  1583. </div>
  1584. @endif
  1585. <div wire:ignore.self class="modal fade" id="userModal" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
  1586. <div class="modal-dialog">
  1587. <div class="modal-content">
  1588. <div class="modal-header">
  1589. <h5 class="modal-title" id="userModalLabel">Modifica borsellino</h5>
  1590. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1591. </div>
  1592. <div class="modal-body">
  1593. <div class="row">
  1594. <div class="col-md-6">
  1595. <label for="newMemberFirstName" class="form-label">Importo</label>
  1596. <input class="form-control " type="text" id="importoBorsellino" >
  1597. </div>
  1598. </div>
  1599. </div>
  1600. <div class="modal-footer">
  1601. <button type="button" class="btn--ui lightGrey" data-bs-dismiss="modal">Annulla</button>
  1602. <button type="button" class="btn--ui btn-primary" onclick="updateBorsellino('-')">Decrementa</button>
  1603. <button type="button" class="btn--ui btn-primary" onclick="updateBorsellino('+')">Aumenta</button>
  1604. </div>
  1605. </div>
  1606. </div>
  1607. </div>
  1608. </div>
  1609. @push('scripts')
  1610. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  1611. <style>
  1612. table.tableHead thead {
  1613. /* Important */
  1614. position: sticky;
  1615. z-index: 100;
  1616. top: 0;
  1617. }
  1618. .select2-container--default .select2-selection--single{
  1619. background-color: #E9F0F5;
  1620. border: 0.0625rem solid #DFE5EB;
  1621. font-size: 0.75rem;
  1622. }
  1623. .select2-selection
  1624. {
  1625. height: 38px !important;
  1626. }
  1627. .select2-selection__rendered
  1628. {
  1629. padding-top:3px;
  1630. }
  1631. .select2
  1632. {
  1633. width:100% !important;
  1634. }
  1635. a.notSelected
  1636. {
  1637. display: flex;
  1638. margin-right:10px;
  1639. float:left;
  1640. height: 2.5rem !important;
  1641. width:50px;
  1642. align-items: center;
  1643. justify-content: center;
  1644. color: #006099;
  1645. background-color: #d3dce1 !important;
  1646. padding: 0 1.25rem;
  1647. font-size: 0.875rem;
  1648. font-family: greycliff-cf, sans-serif;
  1649. border-radius: 1.875rem !important;
  1650. -webkit-border-radius: 1.875rem !important;
  1651. -moz-border-radius: 1.875rem !important;
  1652. -webkit-transition: all 0.3s ease-in-out;
  1653. -moz-transition: all 0.3s ease-in-out;
  1654. -o-transition: all 0.3s ease-in-out;
  1655. transition: all 0.3s ease-in-out;
  1656. border: none;
  1657. }
  1658. a.selected
  1659. {
  1660. display: flex;
  1661. margin-right:10px;
  1662. float:left;
  1663. height: 2.5rem !important;
  1664. width:50px;
  1665. align-items: center;
  1666. justify-content: center;
  1667. color: #fff;
  1668. background-color: #006099 !important;
  1669. padding: 0 1.25rem;
  1670. font-size: 0.875rem;
  1671. font-family: greycliff-cf, sans-serif;
  1672. border-radius: 1.875rem !important;
  1673. -webkit-border-radius: 1.875rem !important;
  1674. -moz-border-radius: 1.875rem !important;
  1675. -webkit-transition: all 0.3s ease-in-out;
  1676. -moz-transition: all 0.3s ease-in-out;
  1677. -o-transition: all 0.3s ease-in-out;
  1678. transition: all 0.3s ease-in-out;
  1679. border: none;
  1680. }
  1681. div.day
  1682. {
  1683. margin-top:20px;
  1684. color: #006099;
  1685. background-color: #ffffff !important;
  1686. padding: 20px;
  1687. border-radius: 1.875rem !important;
  1688. -webkit-border-radius: 1.875rem !important;
  1689. -moz-border-radius: 1.875rem !important;
  1690. -webkit-transition: all 0.3s ease-in-out;
  1691. -moz-transition: all 0.3s ease-in-out;
  1692. -o-transition: all 0.3s ease-in-out;
  1693. transition: all 0.3s ease-in-out;
  1694. border: 2px solid #d3dce1;
  1695. }
  1696. /* a.grey
  1697. {
  1698. display: flex;
  1699. margin-right:10px;
  1700. float:left;
  1701. height: 2.5rem !important;
  1702. width:50px;
  1703. align-items: center;
  1704. justify-content: center;
  1705. color: #006099;
  1706. background-color: #d3dce1 !important;
  1707. padding: 0 1.25rem;
  1708. font-size: 0.875rem;
  1709. font-family: greycliff-cf, sans-serif;
  1710. border-radius: 1.875rem !important;
  1711. -webkit-border-radius: 1.875rem !important;
  1712. -moz-border-radius: 1.875rem !important;
  1713. -webkit-transition: all 0.3s ease-in-out;
  1714. -moz-transition: all 0.3s ease-in-out;
  1715. -o-transition: all 0.3s ease-in-out;
  1716. transition: all 0.3s ease-in-out;
  1717. border: none;
  1718. }
  1719. a.blue
  1720. {
  1721. display: flex;
  1722. margin-right:10px;
  1723. float:left;
  1724. height: 2.5rem !important;
  1725. width:50px;
  1726. align-items: center;
  1727. justify-content: center;
  1728. color: #fff;
  1729. background-color: #006099 !important;
  1730. padding: 0 1.25rem;
  1731. font-size: 0.875rem;
  1732. font-family: greycliff-cf, sans-serif;
  1733. border-radius: 1.875rem !important;
  1734. -webkit-border-radius: 1.875rem !important;
  1735. -moz-border-radius: 1.875rem !important;
  1736. -webkit-transition: all 0.3s ease-in-out;
  1737. -moz-transition: all 0.3s ease-in-out;
  1738. -o-transition: all 0.3s ease-in-out;
  1739. transition: all 0.3s ease-in-out;
  1740. border: none;
  1741. }
  1742. a.yellow
  1743. {
  1744. display: flex;
  1745. margin-right:10px;
  1746. float:left;
  1747. height: 2.5rem !important;
  1748. width:50px;
  1749. align-items: center;
  1750. justify-content: center;
  1751. color: #fff;
  1752. background-color: #ffe238;
  1753. padding: 0 1.25rem;
  1754. font-size: 0.875rem;
  1755. font-family: greycliff-cf, sans-serif;
  1756. border-radius: 1.875rem !important;
  1757. -webkit-border-radius: 1.875rem !important;
  1758. -moz-border-radius: 1.875rem !important;
  1759. -webkit-transition: all 0.3s ease-in-out;
  1760. -moz-transition: all 0.3s ease-in-out;
  1761. -o-transition: all 0.3s ease-in-out;
  1762. transition: all 0.3s ease-in-out;
  1763. border: none;
  1764. }
  1765. a.orange
  1766. {
  1767. display: flex;
  1768. margin-right:10px;
  1769. float:left;
  1770. height: 2.5rem !important;
  1771. width:50px;
  1772. align-items: center;
  1773. justify-content: center;
  1774. color: #fff;
  1775. background-color: #FF7E38;
  1776. padding: 0 1.25rem;
  1777. font-size: 0.875rem;
  1778. font-family: greycliff-cf, sans-serif;
  1779. border-radius: 1.875rem !important;
  1780. -webkit-border-radius: 1.875rem !important;
  1781. -moz-border-radius: 1.875rem !important;
  1782. -webkit-transition: all 0.3s ease-in-out;
  1783. -moz-transition: all 0.3s ease-in-out;
  1784. -o-transition: all 0.3s ease-in-out;
  1785. transition: all 0.3s ease-in-out;
  1786. border: none;
  1787. }
  1788. a.green
  1789. {
  1790. display: flex;
  1791. margin-right:10px;
  1792. float:left;
  1793. height: 2.5rem !important;
  1794. width:50px;
  1795. align-items: center;
  1796. justify-content: center;
  1797. color: #fff;
  1798. background-color: green;
  1799. padding: 0 1.25rem;
  1800. font-size: 0.875rem;
  1801. font-family: greycliff-cf, sans-serif;
  1802. border-radius: 1.875rem !important;
  1803. -webkit-border-radius: 1.875rem !important;
  1804. -moz-border-radius: 1.875rem !important;
  1805. -webkit-transition: all 0.3s ease-in-out;
  1806. -moz-transition: all 0.3s ease-in-out;
  1807. -o-transition: all 0.3s ease-in-out;
  1808. transition: all 0.3s ease-in-out;
  1809. border: none;
  1810. }
  1811. .btn--ui
  1812. {
  1813. -webkit-border-radius: 0.5rem !important;
  1814. background-color:#0C6197 !important;
  1815. font-weight:normal;
  1816. } */
  1817. .btn--ui.lightGrey, .btn--ui.extraLightGrey
  1818. {
  1819. -webkit-border-radius: 0.5rem !important;
  1820. background-color:#ffffff !important;
  1821. border: 1px solid grey;
  1822. color: black;
  1823. font-weight:normal;
  1824. }
  1825. .persistent-invalid
  1826. {
  1827. border-color: #dc3545 !important;
  1828. padding-right: calc(1.5em + 0.75rem) !important;
  1829. 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;
  1830. background-repeat: no-repeat !important;
  1831. background-position: right calc(0.375em + 0.1875rem) center !important;
  1832. background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
  1833. }
  1834. </style>
  1835. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  1836. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  1837. @endpush
  1838. @push('scripts')
  1839. <script>
  1840. function matchStart(params, data) {
  1841. params.term = params.term || '';
  1842. if (data.text.toUpperCase().indexOf(params.term.toUpperCase()) == 0) {
  1843. return data;
  1844. }
  1845. return false;
  1846. }
  1847. var nation_id = {{$nation_id > 0 ? $nation_id : 0}};
  1848. var province_id = 0;
  1849. /*
  1850. $('.nationClass').select2({
  1851. // theme: 'bootstrap4',
  1852. ajax: {
  1853. url: '/nations',
  1854. dataType: 'json'
  1855. }
  1856. });
  1857. $('.nationClass').on('change', function (e) {
  1858. nation_id = $('.nationClass').select2("val");
  1859. @this.set('nation_id', nation_id);
  1860. @this.set('province_id', 0);
  1861. @this.set('city_id', 0);
  1862. @this.checkIsItaly();
  1863. });
  1864. $('.provinceClass').select2({
  1865. ajax: {
  1866. url: '/provinces/' + nation_id,
  1867. dataType: 'json'
  1868. }
  1869. });
  1870. $('.cityClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});*/
  1871. var nation_birth_id = 0;
  1872. var province_birth_id = 0;
  1873. /*
  1874. $('.nationBirthClass').select2({
  1875. // theme: 'bootstrap4',
  1876. ajax: {
  1877. url: '/nations',
  1878. dataType: 'json'
  1879. }
  1880. });
  1881. $('.nationBirthClass').on('change', function (e) {
  1882. nation_birth_id = $('.nationBirthClass').select2("val");
  1883. @this.set('birth_nation_id', nation_birth_id);
  1884. @this.set('birth_province_id', 0);
  1885. @this.set('birth_city_id', 0);
  1886. @this.checkIsBirthItaly();
  1887. });
  1888. $('.provinceBirthClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  1889. $('.cityBirthClass').select2({"language": {"noResults": function(){return "Nessun risultato";}}});*/
  1890. Livewire.on('load-select', () => {
  1891. loadCombo();
  1892. });
  1893. function updateBorsellino(verse)
  1894. {
  1895. var importoBorsellino = $("#importoBorsellino").val();
  1896. @this.updateBorsellino(importoBorsellino, verse);
  1897. }
  1898. Livewire.on('load-provinces', (nation_id, element) => {
  1899. $('.' + element).select2({
  1900. ajax: {
  1901. url: '/provinces/' + nation_id,
  1902. dataType: 'json'
  1903. }
  1904. });
  1905. });
  1906. Livewire.on('load-cities', (province_id, element) => {
  1907. $('.' + element).select2({
  1908. ajax: {
  1909. url: '/cities/' + province_id,
  1910. dataType: 'json'
  1911. }
  1912. });
  1913. });
  1914. Livewire.on('hide-search', () => {
  1915. //pcsh2();
  1916. });
  1917. Livewire.on('setIds', (nation_id_x, birth_nation_id_x) => {
  1918. nation_id = nation_id_x;
  1919. nation_birth_id = birth_nation_id_x;
  1920. });
  1921. function loadCombo()
  1922. {
  1923. $('.nationClass').select2({
  1924. ajax: {
  1925. url: '/nations',
  1926. dataType: 'json'
  1927. }
  1928. });
  1929. $('.nationClass').on('change', function (e) {
  1930. nation_id = $('.nationClass').select2("val");
  1931. province_id = 0;
  1932. @this.set('nation_id', nation_id);
  1933. @this.set('province_id', 0);
  1934. @this.set('city_id', 0);
  1935. @this.checkIsItaly();
  1936. });
  1937. $('.provinceClass').select2({
  1938. ajax: {
  1939. url: '/provinces/' + nation_id,
  1940. dataType: 'json'
  1941. }
  1942. });
  1943. $('.provinceClass').on('change', function (e) {
  1944. province_id = $('.provinceClass').select2("val");
  1945. @this.set('province_id', province_id);
  1946. @this.set('city_id', 0);
  1947. });
  1948. $('.cityClass').select2({
  1949. ajax: {
  1950. url: '/cities/' + province_id,
  1951. dataType: 'json'
  1952. }
  1953. });
  1954. $('.cityClass').on('change', function (e) {
  1955. var data = $('.cityClass').select2("val");
  1956. @this.set('city_id', data);
  1957. });
  1958. $('.nationBirthClass').select2({
  1959. ajax: {
  1960. url: '/nations',
  1961. dataType: 'json'
  1962. }
  1963. });
  1964. $('.nationBirthClass').on('change', function (e) {
  1965. nation_birth_id = $('.nationBirthClass').select2("val");
  1966. province_birth_id = 0;
  1967. @this.set('birth_nation_id', nation_birth_id);
  1968. @this.set('birth_province_id', 0);
  1969. @this.set('birth_city_id', 0);
  1970. @this.checkIsBirthItaly();
  1971. });
  1972. $('.provinceBirthClass').select2({
  1973. ajax: {
  1974. url: '/provinces/' + nation_birth_id,
  1975. dataType: 'json'
  1976. }
  1977. });
  1978. $('.provinceBirthClass').on('change', function (e) {
  1979. province_birth_id = $('.provinceBirthClass').select2("val");
  1980. @this.set('birth_province_id', province_birth_id);
  1981. @this.set('birth_city_id', 0);
  1982. });
  1983. $('.cityBirthClass').select2({
  1984. ajax: {
  1985. url: '/cities/' + province_birth_id,
  1986. dataType: 'json'
  1987. }
  1988. });
  1989. $('.cityBirthClass').on('change', function (e) {
  1990. var data = $('.cityBirthClass').select2("val");
  1991. @this.set('birth_city_id', data);
  1992. });
  1993. $('.card_card_id').select2({
  1994. matcher: function(params, data) {
  1995. return matchStart(params, data);
  1996. }
  1997. });
  1998. $('.card_card_id').on('change', function (e) {
  1999. var data = $('.card_card_id').select2("val");
  2000. @this.set('card_card_id', data);
  2001. });
  2002. $('.certificate_type').select2({
  2003. matcher: function(params, data) {
  2004. return matchStart(params, data);
  2005. }
  2006. });
  2007. $('.certificate_type').on('change', function (e) {
  2008. var data = $('.certificate_type').select2("val");
  2009. @this.set('certificate_type', data);
  2010. });
  2011. $('.categoriesClass').select2({
  2012. matcher: function(params, data) {
  2013. return matchStart(params, data);
  2014. }
  2015. });
  2016. $('.categoriesClass').on('change', function (e) {
  2017. var data = $('.categoriesClass').select2("val");
  2018. @this.set('category_category_id', data);
  2019. });
  2020. $('.coursesClass').select2({
  2021. matcher: function(params, data) {
  2022. return matchStart(params, data);
  2023. }
  2024. });
  2025. $('.coursesClass').on('change', function (e) {
  2026. var data = $('.coursesClass').select2("val");
  2027. @this.set('course_course_id', data);
  2028. });
  2029. }
  2030. @if($refreshAfter == 1)
  2031. setTimeout(() => {
  2032. loadCombo();
  2033. }, 100)
  2034. @endif
  2035. function onlyNumberAmount(input) {
  2036. let v = input.value.replace(/\D+/g, '');
  2037. if (v.length > 14) v = v.slice(0, 14);
  2038. input.value = "€ " + v.replace(/(\d)(\d\d)$/, "$1,$2").replace(/(^\d{1,3}|\d{3})(?=(?:\d{3})+(?:,|$))/g, '$1.');
  2039. }
  2040. </script>
  2041. @endpush
  2042. @push('scripts')
  2043. <link href="/css/datatables.css" rel="stylesheet" />
  2044. <script src="/assets/js/datatables.js"></script>
  2045. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  2046. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  2047. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  2048. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  2049. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  2050. @endpush
  2051. @push('scripts')
  2052. <script>
  2053. function showData(id)
  2054. {
  2055. @this.showDetailF(id);
  2056. }
  2057. function editData(id) {
  2058. if ($('#tablesaw-350').length && $.fn.DataTable.isDataTable('#tablesaw-350')) {
  2059. const dataTable = $('#tablesaw-350').DataTable();
  2060. const pageLength = dataTable.page.len();
  2061. const currentPage = dataTable.page.info().page;
  2062. const order = dataTable.order();
  2063. if (order && order.length > 0) {
  2064. localStorage.setItem('dtOrderColumn', order[0][0]);
  2065. localStorage.setItem('dtOrderDir', order[0][1]);
  2066. }
  2067. }
  2068. window.scrollTo({
  2069. top: 0,
  2070. behavior: 'smooth'
  2071. });
  2072. @this.edit(id);
  2073. }
  2074. function deleteData(id)
  2075. {
  2076. if (confirm('Sei sicuro?'))
  2077. @this.delete(id);
  2078. }
  2079. function archiveMultipleData()
  2080. {
  2081. var ids = [];
  2082. $(".chkIds").each(function () {
  2083. if (this.checked) ids.push($(this).val());
  2084. });
  2085. if (ids.length) {
  2086. if (confirm('Sei sicuro? Gli utenti non saranno più visibili ma potranno essere ripristinati dalla sezione Archivio.'))
  2087. @this.archiveMultiple(ids);
  2088. }
  2089. }
  2090. function archiveData(id)
  2091. {
  2092. if (confirm('Sei sicuro? L\'utente non sarà più visibile ma potrà essere ripristinato dalla sezione Archivio.'))
  2093. @this.archive(id);
  2094. }
  2095. var isFilter = false;
  2096. $(document).ready(function() {
  2097. $(document).on("click",".showHideFilter",function() {
  2098. if (isFilter)
  2099. {
  2100. isFilter = false;
  2101. $(".showFilter").hide();
  2102. }
  2103. else
  2104. {
  2105. isFilter = true;
  2106. $(".showFilter").show();
  2107. }
  2108. });
  2109. } );
  2110. $(document).ready(function() {
  2111. loadDataTable();
  2112. } );
  2113. Livewire.on('load-data-table', () => {
  2114. setTimeout(function() {loadDataTable()}, 100);
  2115. });
  2116. Livewire.on('destroy-data-table', () => {
  2117. $('#tablesaw-350').DataTable().destroy();
  2118. });
  2119. function destroyDataTable()
  2120. {
  2121. $('#tablesaw-350').DataTable().destroy();
  2122. }
  2123. $('.filterCards').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2124. $('.filterStatus').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2125. $('.filterScadenza').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2126. $('.filterCertificateType').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2127. $('.filterCategories').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
  2128. @if(isset($_GET["showFilters"]))
  2129. var filterStatus = localStorage.getItem("filterStatusMember");
  2130. if (filterStatus)
  2131. {
  2132. $('.filterStatus').val(filterStatus).trigger('change');
  2133. }
  2134. var filterCards = localStorage.getItem("filterCardsMember");
  2135. if (filterCards)
  2136. {
  2137. $('.filterCards').val(filterCards).trigger('change');
  2138. }
  2139. var filterScadenza = localStorage.getItem("filterScadenzaMember");
  2140. if (filterScadenza)
  2141. {
  2142. $('.filterScadenza').val(filterScadenza).trigger('change');
  2143. }
  2144. var filterCertificateType = localStorage.getItem("filterCertificateTypeMember");
  2145. if (filterCertificateType)
  2146. {
  2147. $('.filterCertificateType').val(filterCertificateType).trigger('change');
  2148. }
  2149. var filterCategories = localStorage.getItem("filterCategoriesMember");
  2150. if (filterCategories)
  2151. {
  2152. $('.filterCategories').val(filterCategories).trigger('change');
  2153. }
  2154. var fromYear = localStorage.getItem("fromYearMember");
  2155. if (fromYear)
  2156. {
  2157. $('input[name="txtFromYear"]').val(fromYear);
  2158. }
  2159. var toYear = localStorage.getItem("toYearMember");
  2160. if (toYear)
  2161. {
  2162. $('input[name="txtToYear"]').val(toYear);
  2163. }
  2164. var fromYearYear = localStorage.getItem("fromYearYearMember");
  2165. if (fromYearYear)
  2166. {
  2167. $('input[name="txtFromYearYear"]').val(fromYearYear);
  2168. }
  2169. var toYearYear = localStorage.getItem("toYearYearMember");
  2170. if (toYearYear)
  2171. {
  2172. $('input[name="txtToYearYear"]').val(toYearYear);
  2173. }
  2174. @endif
  2175. $(document).on("keypress", $('.filterCategories'), function (e) {
  2176. setTimeout(() => {
  2177. $(".select2-results__option").each(function(){
  2178. var txt = $(this).html();
  2179. var count = (txt.match(/-/g) || []).length;
  2180. $(this).addClass('paddingLeftSelect' + count);
  2181. });
  2182. }, 100);
  2183. });
  2184. $('.filterCategories').on('select2:open', function (e) {
  2185. setTimeout(() => {
  2186. $(".select2-results__option").each(function(){
  2187. var txt = $(this).html();
  2188. var count = (txt.match(/-/g) || []).length;
  2189. $(this).addClass('paddingLeftSelect' + count);
  2190. });
  2191. }, 100);
  2192. });
  2193. function reset()
  2194. {
  2195. $('.filterCards').val('').trigger('change');
  2196. $('.filterStatus').val('').trigger('change');
  2197. $('.filterScadenza').val('-1').trigger('change');
  2198. $('.filterCertificateType').val('-1').trigger('change');
  2199. $('.filterCategories').val('-1').trigger('change');
  2200. /*
  2201. $(".chkCertificateNormal").prop( "checked", false );
  2202. $(".chkCertificateAgonistico").prop( "checked", false );
  2203. $(".chkCertificateScadenza").prop( "checked", false );
  2204. $(".chkCertificateScaduti").prop( "checked", false );
  2205. */
  2206. $('input[name="txtFromYear"]').val('');
  2207. $('input[name="txtToYear"]').val('');
  2208. $('input[name="txtFromYearYear"]').val('');
  2209. $('input[name="txtToYearYear"]').val('');
  2210. //localStorage.clear();
  2211. loadDataTable();
  2212. }
  2213. function loadDataTable() {
  2214. if ($.fn.DataTable.isDataTable('#tablesaw-350')) {
  2215. $('#tablesaw-350').DataTable().destroy();
  2216. }
  2217. // Get saved filters from localStorage
  2218. var fromYear = $('input[name="txtFromYear"]').val();
  2219. localStorage.setItem("fromYearMember", fromYear);
  2220. var toYear = $('input[name="txtToYear"]').val();
  2221. localStorage.setItem("toYearMember", toYear);
  2222. var fromYearYear = $('input[name="txtFromYearYear"]').val();
  2223. localStorage.setItem("fromYearYearMember", fromYearYear);
  2224. var toYearYear = $('input[name="txtToYearYear"]').val();
  2225. localStorage.setItem("toYearYearMember", toYearYear);
  2226. var filterCards = $('.filterCards').val();
  2227. localStorage.setItem("filterCardsMember", filterCards);
  2228. var filterStatus = $('.filterStatus').val();
  2229. localStorage.setItem("filterStatusMember", filterStatus);
  2230. var filterScadenza = $('.filterScadenza').val();
  2231. localStorage.setItem("filterScadenzaMember", filterScadenza);
  2232. var filterCertificateType = $('.filterCertificateType').val();
  2233. localStorage.setItem("filterCertificateTypeMember", filterCertificateType);
  2234. var filterCategories = $('.filterCategories').val();
  2235. localStorage.setItem("filterCategoriesMember", filterCategories)
  2236. const pageLength = 10;
  2237. // Create DataTable with restored settings
  2238. const dataTable = $('#tablesaw-350').DataTable({
  2239. serverSide: true,
  2240. ajax: '/get_members?cards=' + filterCards + "&filterCategories=" + filterCategories + "&filterCertificateType=" + filterCertificateType + "&filterScadenza=" + filterScadenza + "&filterStatus=" + filterStatus + "&fromYear=" + fromYear + "&toYear=" + toYear + "&fromYearYear=" + fromYearYear + "&toYearYear=" + toYearYear,
  2241. columns: [
  2242. {
  2243. data: "member_id",
  2244. orderable: false,
  2245. render: function (data){
  2246. var ret = '<input type="checkbox" name="chk'+data+'" value="'+data+'" class="chkIds" onchange="updateMultipleSelection()">';
  2247. return ret;
  2248. }
  2249. },
  2250. {
  2251. data: "last_name",
  2252. render: function (data){
  2253. const d = data.split("|");
  2254. var ret = '<a style="cursor:pointer" onclick="showData(' + d[1] + ')">' + d[0] + '</a>';
  2255. return ret;
  2256. }
  2257. },
  2258. {
  2259. data: "first_name",
  2260. render: function (data){
  2261. const d = data.split("|");
  2262. var ret = '<a style="cursor:pointer" onclick="showData(' + d[1] + ')">' + d[0] + '</a>';
  2263. return ret;
  2264. }
  2265. },
  2266. { data: "phone"},
  2267. { data: "age", "type": "num",class:"numericCol"},
  2268. { data: "year",class:"numericCol"},
  2269. {
  2270. data: "status",
  2271. render: function (data){
  2272. const d = data.split("|");
  2273. var ret = '<span class="tablesaw-cell-content"><span class="badge tessera-badge ' + d[0] + '">' + d[1] + '</span></span>';
  2274. return ret;
  2275. }
  2276. },
  2277. {
  2278. data: "certificate",
  2279. render: function (data){
  2280. var ret = '';
  2281. if (data != "") {
  2282. const d = data.split("|");
  2283. ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
  2284. if (d[0] == "0") {
  2285. ret += '<i class="ico--ui check suspended me-2"></i>';
  2286. ret += 'Scaduto: ';
  2287. }
  2288. if (d[0] == "1") {
  2289. ret += '<i class="ico--ui check due me-2"></i>';
  2290. ret += 'In scadenza: ';
  2291. }
  2292. if (d[0] == "2") {
  2293. ret += '<i class="ico--ui check active me-2"></i>';
  2294. ret += 'Scadenza: ';
  2295. }
  2296. ret += d[1];
  2297. ret += '</span>';
  2298. }
  2299. if(data == ""){
  2300. ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
  2301. ret += 'Non Presente';
  2302. ret += '</span>';
  2303. }
  2304. return ret;
  2305. }
  2306. },
  2307. {
  2308. data: "action",
  2309. render: function (data){
  2310. 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;';
  2311. 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>';
  2312. return ret;
  2313. }
  2314. },
  2315. ],
  2316. fixedHeader: false,
  2317. // Set initial order from saved state or default
  2318. thead: {
  2319. 'th': {'background-color': 'blue'}
  2320. },
  2321. layout: {
  2322. topStart : null,
  2323. topEnd : null,
  2324. top1A: {
  2325. buttons: [
  2326. {
  2327. extend: 'collection',
  2328. text: 'ESPORTA',
  2329. buttons: [
  2330. {
  2331. extend: 'excelHtml5',"action":newexportaction,
  2332. title: 'Utenti',
  2333. exportOptions: {
  2334. columns: ":not(':last')",
  2335. page: 'all'
  2336. }
  2337. },
  2338. {
  2339. extend: 'pdfHtml5',"action":newexportaction,
  2340. title: 'Utenti',
  2341. exportOptions: {
  2342. columns: ":not(':last')"
  2343. },
  2344. customize: function(doc) {
  2345. doc.styles.tableHeader.alignment = 'left';
  2346. }
  2347. },
  2348. {
  2349. extend: 'print',"action":newexportaction,
  2350. text: 'Stampa',
  2351. title: 'Utenti',
  2352. exportOptions: {
  2353. columns: ":not(':last')"
  2354. }
  2355. }
  2356. ],
  2357. dropup: true
  2358. },
  2359. {
  2360. text: '<i class="fa-regular fa-folder-closed"></i>',
  2361. attr: {
  2362. id: 'btnArchive',
  2363. style: 'display: none',
  2364. onclick: 'archiveMultipleData()',
  2365. class: 'btn archive-multiple-btn',
  2366. "data-bs-toggle":"popover",
  2367. "data-bs-trigger":"hover focus",
  2368. "data-bs-placement":"bottom",
  2369. "data-bs-content":"Archivia",
  2370. }
  2371. },
  2372. ]
  2373. },
  2374. top1B : {
  2375. pageLength: {
  2376. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  2377. }
  2378. },
  2379. top1C :'search',
  2380. bottomEnd: {
  2381. paging: {
  2382. boundaryNumbers: false
  2383. }
  2384. }
  2385. },
  2386. pagingType: 'first_last_numbers',
  2387. language: {
  2388. "url": "/assets/js/Italian.json",
  2389. paginate: {
  2390. first: '<i class="fa-solid fa-angles-left"></i>',
  2391. last: '<i class="fa-solid fa-angles-right"></i>',
  2392. }
  2393. },
  2394. "fnInitComplete": function (oSettings, json) {
  2395. var html = '&nbsp;<a style="cursor:pointer" class="showHideFilter btn--ui"><i class="fa-solid fa-sliders"></i></a>';
  2396. html += '&nbsp;<a style="cursor:pointer" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  2397. $(".dt-search").append(html);
  2398. }
  2399. });
  2400. $('#tablesaw-350 thead tr th').addClass('col');
  2401. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  2402. $('#tablesaw-350').on('draw.dt', function() {
  2403. $('[data-bs-toggle="popover"]').popover()
  2404. });
  2405. $(".chkAll").change(function () {
  2406. var check = this.checked;
  2407. var ok = false;
  2408. $(".chkIds").each(function () {
  2409. $(this).prop("checked", check);
  2410. ok = true;
  2411. });
  2412. if (check && ok) {
  2413. $("#btnArchive").show();
  2414. } else {
  2415. $("#btnArchive").hide();
  2416. }
  2417. });
  2418. }
  2419. function updateMultipleSelection() {
  2420. let checked = false;
  2421. $(".chkIds").each(function () {
  2422. if (this.checked) checked = true;
  2423. });
  2424. if (checked) {
  2425. $("#btnArchive").show();
  2426. } else {
  2427. $("#btnArchive").hide();
  2428. $(".chkAll").prop("checked", false);
  2429. }
  2430. }
  2431. $(document).ready(function() {
  2432. $(document).on("click",".addData",function() {
  2433. $(".title--section_addButton").trigger("click")
  2434. });
  2435. } );
  2436. var isEdit = false;
  2437. var isEditCorso = false;
  2438. Livewire.on('setEdit', (x) =>
  2439. {
  2440. isEdit = x;
  2441. console.log(isEdit);
  2442. });
  2443. Livewire.on('setEditCorso', (x) =>
  2444. {
  2445. isEditCorso = x;
  2446. console.log("Edit corso" + isEditCorso);
  2447. });
  2448. Livewire.on('setErrorMsg', (errors) =>
  2449. {
  2450. function msg(value)
  2451. {
  2452. const myArray = value.split("=");
  2453. if (myArray[1] == '0' || myArray[1] == '')
  2454. $("span").find("[aria-controls='select2-" + myArray[0] + "-container']").css('border', 'solid 3px #dc3545');
  2455. }
  2456. console.log(errors);
  2457. //window.location.href = "#top";
  2458. //$("span").find(`[aria-controls='select2-birth_nation_id-container']`).css('border', 'solid 3px red');
  2459. });
  2460. Livewire.on('reload', (x) =>
  2461. {
  2462. location.reload();
  2463. });
  2464. Livewire.on('goToTop', () => {
  2465. @this.set('type', 'dati');
  2466. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2467. });
  2468. function storeAction(type)
  2469. {
  2470. @this.change('dati');
  2471. if (isEditCorso)
  2472. {
  2473. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2474. @this.store(type);
  2475. }
  2476. else
  2477. {
  2478. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2479. //window.location.href = "#top";
  2480. }
  2481. }
  2482. function updateAction(type)
  2483. {
  2484. @this.change('dati');
  2485. if (isEditCorso)
  2486. {
  2487. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2488. @this.updateAAA(type);
  2489. }
  2490. else
  2491. {
  2492. @this.updateAAA(type);
  2493. document.body.scrollTop = document.documentElement.scrollTop = 0;
  2494. }
  2495. }
  2496. function cancelAction()
  2497. {
  2498. if (isEditCorso)
  2499. {
  2500. if (confirm('Non hai concluso l\' inserimento/modifica del corso, vuoi comunque procedere?'))
  2501. @this.cancel();
  2502. }
  2503. else
  2504. @this.cancel();
  2505. }
  2506. function annulla()
  2507. {
  2508. window.onbeforeunload = null;
  2509. document.location.href = '/members';
  2510. }
  2511. function store(reload) {
  2512. window.onbeforeunload = null;
  2513. @this.store(reload)
  2514. }
  2515. function updateAAA(reload) {
  2516. window.onbeforeunload = null;
  2517. @this.updateAAA(reload)
  2518. }
  2519. window.onbeforeunload = function(){
  2520. if (isEdit)
  2521. return 'Cambiando pagina le eventuali modifiche andranno perse';
  2522. if (isEditCorso)
  2523. return 'Devi prima salvare i dati del corso';
  2524. };
  2525. window.livewire.on('saved', () => {
  2526. $('#userModal').modal('hide');
  2527. });
  2528. Livewire.on('goToAnchor', () =>
  2529. {
  2530. window.location.href = "#top";
  2531. });
  2532. /*$(window).on('popstate', function(event) {
  2533. document.location.href = '/members';
  2534. });*/
  2535. $(function() {
  2536. if (window.history && window.history.pushState) {
  2537. window.history.pushState('', null, './');
  2538. $(window).on('popstate', function() {
  2539. // alert('Back button was pressed.');
  2540. //document.location.href = '#';
  2541. document.location.href = '/members';
  2542. });
  2543. }
  2544. });
  2545. function setupBackButtonHandlers() {
  2546. const backButtons = document.querySelectorAll('a.btn--ui.lightGrey[href^="/"]');
  2547. backButtons.forEach(button => {
  2548. button.addEventListener('click', function(e) {
  2549. });
  2550. });
  2551. }
  2552. $(document).ready(function() {
  2553. setupBackButtonHandlers();
  2554. });
  2555. document.addEventListener('livewire:load', () => {
  2556. Livewire.on('focus-error-field', (fieldId) => {
  2557. console.log('Validation errors received:', fieldId);
  2558. let element;
  2559. if (typeof fieldId === 'string') {
  2560. element = document.getElementById(fieldId);
  2561. } else if (Array.isArray(fieldId) && fieldId.length > 0) {
  2562. const firstFieldId = fieldId[0];
  2563. element = document.getElementById(firstFieldId);
  2564. fieldId = firstFieldId; // Use the first fieldId for highlighting
  2565. }
  2566. if (element) {
  2567. element.focus();
  2568. element.scrollIntoView({
  2569. behavior: 'smooth',
  2570. block: 'center'
  2571. });
  2572. // Add the is-invalid class to highlight the field
  2573. element.classList.add('is-invalid');
  2574. // Also highlight the label
  2575. const label = document.querySelector(`label[for="${fieldId}"]`);
  2576. if (label) {
  2577. label.classList.add('text-danger');
  2578. }
  2579. // Prevent the class from being removed
  2580. const preserveInvalidClass = () => {
  2581. if (!element.classList.contains('is-invalid')) {
  2582. element.classList.add('is-invalid');
  2583. }
  2584. };
  2585. // Set an interval to ensure the class stays applied
  2586. const intervalId = setInterval(preserveInvalidClass, 100);
  2587. // Stop preserving after user interaction
  2588. element.addEventListener('input', () => {
  2589. clearInterval(intervalId);
  2590. // Optional: Remove the highlighting when user edits the field
  2591. // element.classList.remove('is-invalid');
  2592. // if (label) label.classList.remove('text-danger');
  2593. });
  2594. } else {
  2595. console.warn('Element with id ' + fieldId + ' not found');
  2596. }
  2597. });
  2598. });
  2599. function getNextTab(currentTab) {
  2600. const tabs = ['dati', 'tesseramento', 'corsi', 'gruppi'];
  2601. const currentIndex = tabs.indexOf(currentTab);
  2602. return currentIndex < tabs.length - 1 ? tabs[currentIndex + 1] : currentTab;
  2603. }
  2604. function scrollToFormTop() {
  2605. const formSection = document.querySelector('.section--tab, .form--wrapper, #card--resume');
  2606. if (formSection) {
  2607. formSection.scrollIntoView({
  2608. behavior: 'instant',
  2609. block: 'start',
  2610. inline: 'nearest'
  2611. });
  2612. return true;
  2613. }
  2614. return false;
  2615. }
  2616. Livewire.on('saved-and-close', (currentTab) => {
  2617. document.location.href = '/members';
  2618. });
  2619. Livewire.on('saved-and-continue', (currentTab) => {
  2620. const nextTab = getNextTab(currentTab);
  2621. if (nextTab !== currentTab) {
  2622. @this.change(nextTab);
  2623. }
  2624. setTimeout(() => {
  2625. if (!scrollToFormTop()) {
  2626. window.scrollTo({ top: 0, behavior: 'instant' });
  2627. document.body.scrollTop = 0;
  2628. document.documentElement.scrollTop = 0;
  2629. }
  2630. const firstInput = document.querySelector('#first_name');
  2631. if (firstInput) {
  2632. firstInput.focus();
  2633. }
  2634. }, 200);
  2635. });
  2636. function downloadChart(chartId) {
  2637. x.toBase64Image()
  2638. var a = document.createElement('a');
  2639. a.href = Chart.getChart(chartId).toBase64Image()
  2640. a.download = @this.first_name + " " + @this.last_name + ' - Grafico Presenze.png';
  2641. a.click();
  2642. a.remove();
  2643. }
  2644. Livewire.on('load-chart', (mesi, valori, chartData) => {
  2645. try {
  2646. const ctx = document.getElementById('presenzeChart');
  2647. try {
  2648. x.destroy();
  2649. }
  2650. catch (ee) {}
  2651. x = new Chart(ctx, {
  2652. type: 'bar',
  2653. data: {
  2654. labels: mesi,
  2655. // datasets: [
  2656. // {
  2657. // label: 'Presenze',
  2658. // data: valori,
  2659. // borderWidth: 1
  2660. // }
  2661. // ],
  2662. datasets: chartData,
  2663. },
  2664. options: {
  2665. responsive: true,
  2666. // maintainAspectRatio: false,
  2667. interaction: {
  2668. mode: 'index',
  2669. intersect: false,
  2670. },
  2671. scales: {
  2672. y: {
  2673. beginAtZero: true
  2674. }
  2675. },
  2676. plugins: {
  2677. legend: {
  2678. display: false,
  2679. },
  2680. tooltip: {
  2681. backgroundColor: 'rgba(255, 255, 255, 1)',
  2682. titleColor: '#212529',
  2683. bodyColor: '#495057',
  2684. borderColor: '#e9ecef',
  2685. borderWidth: 2,
  2686. cornerRadius: 0,
  2687. titleFont: {
  2688. size: 18,
  2689. weight: 'bold',
  2690. },
  2691. bodyFont: {
  2692. size: 16,
  2693. weight: '400',
  2694. },
  2695. },
  2696. },
  2697. }
  2698. }
  2699. );
  2700. }
  2701. catch(e) {
  2702. console.log(e);
  2703. }
  2704. });
  2705. </script>
  2706. @endpush