member.blade.php 143 KB

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