| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <div class="col card--ui" id="card--dashboard">
- <a class="btn--ui lightGrey" href="/presence_reports"><i class="fa-solid fa-arrow-left"></i></a><br>
- <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between">
- <div class="title--section_name d-flex align-items-center justify-content-between">
- <i class="ico--ui title_section utenti me-2"></i>
- <h2 class="primary">Lezioni da rimuovere</h2>
- </div>
- </header>
- <br>
- <div class="row">
- <div class="col-12 mb-3">
- <h3 class="primary">Lezioni inserite senza nessun iscritto</h3>
- </div>
- <div class="col-12">
- @foreach($groups as $idx => $grp)
- <a onclick="checkAll('{{$grp}}', {{$idx}})" class="btn btn-light bt{{$idx}}">{{$grp}}</a>
- @endforeach
- </div>
- <div class="col-12">
- <table class="report-table">
- <thead>
- <tr>
- <td></td>
- <td>Data</td>
- <td>Ora</td>
- <td>Corso</td>
- <td></td>
- </tr>
- </thead>
- <tbody>
- @foreach($records as $record)
- <tr>
- <td><input type="checkbox" value="{{$record["id"]}}" class="chk when_{{$record["name"]}}_{{$record["day"]}}_{{str_replace(":", "", $record["hour"])}}"></td>
- <td>{{$record["date"]}}</td>
- <td>{{$record["hour"]}}</td>
- <td>{{$record["name"]}}</td>
- <td><a href="/presences?calendarId={{$record["id"]}}" target="_blank">Visualizza</a></td>
- </tr>
- @endforeach
- </tbody>
- <span id="deleting" style="display:none">Eliminazione in corso...</span>
- <input type="button" class="btDelete btn--ui" value="Elimina selezionati">
- </table>
- </div>
- </div>
- </div>
- @push('css')
- <link href="/css/presence_report.css" rel="stylesheet" />
- @endpush
- @push('scripts')
- <link href="/css/datatables.css" rel="stylesheet" />
- <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
- @endpush
- @push('scripts')
- <script>
- var ids = [];
- var xxx = [];
- $(document).ready(function() {
- $('.chk').change(function() {
- if(this.checked)
- {
- ids.push($(this).val());
- }
- else
- {
- var index = ids.indexOf($(this).val());
- if (index > -1)
- {
- ids.splice(index, 1);
- }
- }
- });
-
- $(".btDelete").click(function(){
- $("#deleting").show();
- //$(this).hide();
- @this.removeSelected(ids);
- });
- });
- function checkAll(x, idx)
- {
- var checked = true;
- if ($(".bt" + idx).hasClass("btn-primary"))
- {
- $(".bt" + idx).removeClass("btn-primary");
- $(".bt" + idx).addClass("btn-light");
- checked = false;
- }
- else
- {
- $(".bt" + idx).removeClass("btn-light");
- $(".bt" + idx).addClass("btn-primary");
- }
- /*var index = xxx.indexOf(x);
- if (index > -1)
- {
- xxx.splice(index, 1);
- checked = false;
- }*/
- x = x.replaceAll(" ", "_");
- x = x.replaceAll(":", "");
- console.log(x);
- var xxx = $(".when_" + x).map(function() {
- console.log("CIAO");
- var val = $(this).val();
- $(this).prop('checked', checked);
- if (checked)
- ids.push(val);
- else
- {
- var index = ids.indexOf(val);
- if (index > -1)
- {
- ids.splice(index, 1);
- }
- }
- //return this.innerHTML;
- }).get();
- }
- </script>
- @endpush
|