Skip to content

Commit

Permalink
Checkout/Checkin button
Browse files Browse the repository at this point in the history
  • Loading branch information
Manorie KAM-OON committed Nov 26, 2019
1 parent b231ab1 commit bbbd231
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
15 changes: 3 additions & 12 deletions app/Http/Controllers/EventCheckInController.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,10 @@ public function postCheckInAttendee(Request $request, $event_id)
'checked' => $checking,
'message' => (($checking == 'in') ? trans("Controllers.attendee_successfully_checked_in") : trans("Controllers.attendee_successfully_checked_out")),
'id' => $attendee->id,
// 'redirectUrl' => route('showCheckIn', [
// 'event_id' => $event_id,
// ]),
'redirectUrl' => route('showCheckIn', [
'event_id' => $event_id,
]),
]);

$data = [
'id' => $attendee->id,
'event' => $event,
'checked' => $checking,

];

return view('ManageEvent.CheckIn', $data);
}


Expand Down
11 changes: 11 additions & 0 deletions resources/views/ManageEvent/Modals/showCheckInModal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@
</div> <!-- /end modal body-->
<div class="modal-footer">

@if ($attendee->checking == 1)
<form method="post" action="{{route('postCheckInAttendee', ['event_id' => $event->id])}}" class="ajax" id="check-form">
@csrf
{!! Form::hidden('attendee_id', $attendee->id) !!}
{!! Form::hidden('has_arrived', $attendee->has_arrived) !!}
{!! Form::hidden('checking', $attendee->checking) !!}
<button type="submit" name="check-in" class="btn btn-danger">Check-out</button>

@else
<form method="post" action="{{route('postCheckInAttendee', ['event_id' => $event->id])}}" class="ajax" id="check-form">
@csrf
{!! Form::hidden('attendee_id', $attendee->id) !!}
Expand All @@ -201,6 +210,8 @@
<button type="submit" name="check-in" class="btn btn-success">Check-in</button>
</form>

@endif


</div>
</div><!-- /end modal content-->
Expand Down

0 comments on commit bbbd231

Please sign in to comment.