member.blade.php 161 KB

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