finished some fixes

This commit is contained in:
ilmedova 2023-04-24 17:16:00 +05:00
parent 56af829037
commit 020b86949c
4 changed files with 9 additions and 7 deletions

View File

@ -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]);
}
}

View File

@ -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"

View File

@ -19,7 +19,7 @@
<br/><br/>
<p class="text-red-800">
*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.
</p><br/>
<input type="radio" id="is_attending" name="is_attending" required value="1">

View File

@ -3,8 +3,7 @@
@section('content')
<div class="flex justify-center items-center">
<div class="max-w-lg mt-4 rounded p-4 bg-green-200 border-green-500 border-2">
<h1 class="text-6xl text-green-600 font-bold">Thank you!</h1><br/>
<span class="text-base text-green-600 font-medium">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</span>
<h1 class="text-6xl text-green-600 font-bold">Thank you for response!</h1><br/>
</div>
</div>
@endsection