member.blade.php 158 KB

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