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.