member.blade.php 160 KB

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