member.blade.php 163 KB

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