member.blade.php 163 KB

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