member.blade.php 163 KB

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