member.blade.php 172 KB

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