2021-04-22 13:31:08 +00:00
|
|
|
@extends("admin.layout.base")
|
|
|
|
@extends("admin.layout.header")
|
|
|
|
|
|
|
|
@section("title")
|
2021-04-29 08:43:35 +00:00
|
|
|
ugentlige aktiviteter - Tilmeldte
|
2021-04-22 13:31:08 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("path")
|
2021-05-04 10:32:24 +00:00
|
|
|
<a href="{{ route("events.index") }}" class="text-white">Vis Events</a> / <a href="" class="text-white">Vis Tilmeldte</a> /
|
2021-04-22 13:31:08 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
2021-05-04 10:32:24 +00:00
|
|
|
@foreach($multiEvent as $event)
|
|
|
|
<h1 class="text-center">{{ $event->name }}</h1>
|
|
|
|
<table class="tbl mt-1" id="table_id{{ $event->id }}">
|
|
|
|
<thead>
|
2021-04-22 13:31:08 +00:00
|
|
|
<th>Tilmeldtes Fornavn</th>
|
|
|
|
<th>Tilmeldtes Efternavn</th>
|
|
|
|
<th>Tilmeldtes Tlf Nr</th>
|
|
|
|
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
2021-05-04 10:32:24 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (\App\UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->where('multiple_event_id', '=', $event->id)->select('user_events.*', 'users.name_first', 'users.name_last', 'users.phone')->get() as $ue)
|
|
|
|
<tr id="row_{{ $ue->id }}">
|
|
|
|
<td>{{ $ue->name_first }}</td>
|
|
|
|
<td>{{ $ue->name_last }}</td>
|
|
|
|
<td>{{ $ue->phone }}</td>
|
|
|
|
<td>
|
|
|
|
@csrf
|
|
|
|
<a class="w-100 nostyle" onclick="delete_userevent({{ $ue->id }}, {{ $event->id }})"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2021-04-22 13:31:08 +00:00
|
|
|
@endforeach
|
2021-05-04 10:32:24 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
@endforeach
|
2021-04-22 13:31:08 +00:00
|
|
|
@endsection
|
|
|
|
@section('scripts')
|
|
|
|
<script>
|
2021-05-04 10:32:24 +00:00
|
|
|
@foreach($multiEvent as $event)
|
|
|
|
$(document).ready( function () {
|
|
|
|
$('#table_id'+{{ $event->id }}).DataTable({
|
|
|
|
columnDefs: [
|
|
|
|
{ orderable: false, targets: [-1] }
|
|
|
|
]
|
|
|
|
});
|
2021-04-22 13:31:08 +00:00
|
|
|
});
|
2021-05-04 10:32:24 +00:00
|
|
|
@endforeach
|
|
|
|
|
|
|
|
function delete_userevent(id, tableid) {
|
|
|
|
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',
|
|
|
|
confirmButtonText: 'Fjern brugeren fra aktiviteten',
|
|
|
|
cancelButtonText: 'Annuller'
|
|
|
|
}).then((result) => {
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: "/multiple-events/"+id,
|
|
|
|
data:{'_token':token, _method: 'DELETE', 'signup': true},
|
|
|
|
success: function () {
|
|
|
|
$('#table_id'+tableid).DataTable().row($('#row_'+id)[0]).remove().draw();
|
|
|
|
|
|
|
|
Swal.fire(
|
|
|
|
'Brugeren er hermed fjernet fra aktiviteten!',
|
|
|
|
'',
|
|
|
|
'success'
|
|
|
|
)
|
|
|
|
},
|
|
|
|
error:function (data) {
|
|
|
|
console.log(data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2021-04-22 13:31:08 +00:00
|
|
|
</script>
|
|
|
|
@endsection
|