diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index a6ca369..e7fbae1 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -34,9 +34,9 @@ public function submit(Request $request){ $data['consent_form'] = (bool)$data['consent_form']; $attender = Attender::create($data); - $attender->events()->attach($request->event_id); - if($attender){ + if($data['is_attending']){ + $attender->events()->attach($request->event_id); $attendance = DB::table('event_attenders') ->where('event_id', $request->event_id) ->where('attender_id', $attender->id) @@ -62,6 +62,6 @@ public function shownUp(Request $request){ $attender = Attender::find($attendance->attender_id); $attender->attended = true; $attender->save(); - return response()->json(['success' => true, 'message' => 'Scan successful!']); + return response()->json(['success' => true, 'data' => $attender]); } } diff --git a/resources/views/scan.blade.php b/resources/views/scan.blade.php index b8adb45..5c3e3a9 100644 --- a/resources/views/scan.blade.php +++ b/resources/views/scan.blade.php @@ -70,7 +70,10 @@ function onScanSuccess(decodedText, decodedResult) { }, success: function (response) { if(response.success == true){ - alert("Successfully scanned!"); + alert(response.data.name + " " + response.data.surname + ": " + "Allowed (photo and filming)"); + } + else{ + alert(response.data.name + " " + response.data.surname + ": " + "Not allowed (photo and filming)"); } }, dataType: "json" diff --git a/resources/views/signup.blade.php b/resources/views/signup.blade.php index 962e0fb..866a812 100644 --- a/resources/views/signup.blade.php +++ b/resources/views/signup.blade.php @@ -19,7 +19,7 @@

- *Upon your confirmation of the following, you will received a QR code to your e-mail which you must present at the registration together with your ID. + *Upon your confirmation of the following, you will receive a QR code to your e-mail which you must present at the registration together with your ID.


diff --git a/resources/views/success.blade.php b/resources/views/success.blade.php index 3fb4ec5..d1a7c4b 100644 --- a/resources/views/success.blade.php +++ b/resources/views/success.blade.php @@ -3,8 +3,7 @@ @section('content')
-

Thank you!


- We have sent you an email with attached QR code which you should use for this event! Check you email, if you haven't received anything contact us via: example@example.com +

Thank you for response!


@endsection