2020-07-28 12:54:19 +00:00
|
|
|
@extends("admin.layout.base")
|
|
|
|
@extends("admin.layout.header")
|
|
|
|
|
|
|
|
@section("title")
|
|
|
|
Events - Tilmeldte
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("path")
|
|
|
|
<a href="{{ route("events.index") }}" class="text-white">Vis Events</a> / <a href="" class="text-white">Vis Tilmeldte - {{ $events[0]->name }}</a> /
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
2020-10-07 06:23:26 +00:00
|
|
|
<table class="tbl mt-1" id="table_id">
|
|
|
|
<thead>
|
2020-07-28 12:54:19 +00:00
|
|
|
<th>Tilmeldtes Fornavn</th>
|
|
|
|
<th>Tilmeldtes Efternavn</th>
|
|
|
|
<th>Tilmeldtes Tlf Nr</th>
|
2020-11-26 09:19:12 +00:00
|
|
|
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
2020-10-07 06:23:26 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach($events as $event)
|
2021-05-04 12:28:14 +00:00
|
|
|
@if($event->user_id != null)
|
|
|
|
<tr id="row_{{ $event->id }}">
|
2020-10-07 06:23:26 +00:00
|
|
|
<td>{{ $event->name_first }}</td>
|
|
|
|
<td>{{ $event->name_last }}</td>
|
|
|
|
<td>{{ $event->phone }}</td>
|
2021-05-04 12:28:14 +00:00
|
|
|
<td>
|
|
|
|
@csrf
|
|
|
|
<a class="w-100 nostyle" onclick="delete_userevent({{ $event->id }})"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a>
|
2020-10-07 06:23:26 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
2020-07-28 12:54:19 +00:00
|
|
|
</table>
|
2020-10-07 06:23:26 +00:00
|
|
|
@endsection
|
|
|
|
@section('scripts')
|
2020-07-28 12:54:19 +00:00
|
|
|
<script>
|
2020-10-07 06:23:26 +00:00
|
|
|
$(document).ready( function () {
|
|
|
|
$('#table_id').DataTable({
|
|
|
|
columnDefs: [
|
|
|
|
{ orderable: false, targets: [-1] }
|
|
|
|
]
|
2020-07-28 12:54:19 +00:00
|
|
|
});
|
2020-10-07 06:23:26 +00:00
|
|
|
});
|
2021-05-04 10:32:24 +00:00
|
|
|
|
2021-05-04 12:28:14 +00:00
|
|
|
function delete_userevent(id) {
|
2021-05-04 10:32:24 +00:00
|
|
|
var token = $("input[name='_token']").val();
|
|
|
|
|
|
|
|
Swal.fire({
|
|
|
|
title: 'Er du sikker?',
|
|
|
|
text: "Dette kan ikke blive ændret tilbage!",
|
|
|
|
icon: 'warning',
|
|
|
|
showCancelButton: true,
|
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
|
cancelButtonColor: '#d33',
|
2021-05-04 12:28:14 +00:00
|
|
|
confirmButtonText: 'Fjern brugeren fra aktiviteten',
|
2021-05-04 10:32:24 +00:00
|
|
|
cancelButtonText: 'Annuller'
|
|
|
|
}).then((result) => {
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
2021-05-04 12:28:14 +00:00
|
|
|
url: "/events/"+id,
|
|
|
|
data:{'_token':token, _method: 'DELETE', 'signup': true},
|
2021-05-04 10:32:24 +00:00
|
|
|
success: function () {
|
|
|
|
$('#table_id').DataTable().row($('#row_'+id)[0]).remove().draw();
|
|
|
|
|
|
|
|
Swal.fire(
|
2021-05-04 12:28:14 +00:00
|
|
|
'Brugeren er fjernet fra aktiviteten!',
|
2021-05-04 10:32:24 +00:00
|
|
|
'',
|
|
|
|
'success'
|
|
|
|
)
|
|
|
|
},
|
|
|
|
error:function (data) {
|
|
|
|
console.log(data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2020-07-28 12:54:19 +00:00
|
|
|
</script>
|
|
|
|
@endsection
|