member.blade.php 156 KB

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