member.blade.php 143 KB

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