member.blade.php 140 KB

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