member.blade.php 163 KB

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