ready for testing

This commit is contained in:
ilmedova 2023-05-03 02:59:16 +05:00
parent eaa5e49b66
commit 888cde47a9
24 changed files with 202 additions and 15 deletions

View File

@ -65,6 +65,22 @@ protected function setupListOperation()
'1' => 'Yes'
]
],
[
'name' => 'consent_form_second',
'type' => 'select_from_array',
'options' => [
'0' => 'No',
'1' => 'Yes'
]
],
[
'name' => 'consent_form_third',
'type' => 'select_from_array',
'options' => [
'0' => 'No',
'1' => 'Yes'
]
],
[
'name' => 'attended',
'type' => 'select_from_array',

View File

@ -28,10 +28,12 @@ public function apply($id){
}
public function submit(Request $request){
$data = $request->only(['name', 'surname', 'email', 'file', 'organization', 'is_attending', 'consent_form']);
$data = $request->only(['name', 'surname', 'email', 'file', 'organization', 'is_attending', 'consent_form', 'consent_form_second', 'consent_form_third']);
$data['attended'] = 0;
$data['is_attending'] = (bool)$data['is_attending'];
$data['consent_form'] = (bool)$data['consent_form'] ?? false;
$data['consent_form'] = $data['consent_form'] ?? false;
$data['consent_form_second'] = $data['consent_form_second'] ?? false;
$data['consent_form_third'] = $data['consent_form_third'] ?? false;
$attender = Attender::create($data);

View File

@ -27,7 +27,9 @@ class Attender extends Model
'email',
'is_attending',
'attended',
'consent_form'
'consent_form',
'consent_form_second',
'consent_form_third'
];
// protected $hidden = [];
// protected $dates = [];

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('attenders', function (Blueprint $table) {
$table->boolean('consent_form_second')->default(1);
$table->boolean('consent_form_third')->default(1);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('attenders', function (Blueprint $table) {
//
});
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 KiB

BIN
public/qr/64516f96b0235.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
public/qr/645170527b66d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
public/qr/64517070c04ec.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
public/qr/6451875423939.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
public/qr/6451876b6b33c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
public/qr/645187967dcb1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<title>Scanner</title>
<script src="/js/html5-qrcode.min.js"></script>
<script src="/js/tailwind.js"></script>
<style>
@ -70,10 +70,15 @@ function onScanSuccess(decodedText, decodedResult) {
},
success: function (response) {
if(response.success == true){
alert(response.data.name + " - " + response.data.organization + ": " + "Allowed (photo and filming)");
if(response.data.consent_form == 1){
alert(response.data.name + " - " + response.data.organization + ": " + "Allowed (photo and filming)");
}
else{
alert(response.data.name + " - " + response.data.organization + ": " + "Not allowed (photo and filming)");
}
}
else{
alert(response.data.name + " - " + response.data.organization + ": " + "Not allowed (photo and filming)");
alert("Internal server error");
}
},
dataType: "json"

View File

@ -27,22 +27,22 @@
<div class="grid grid-cols-2 gap-2">
<div>
<label for="name"><b>Name and surname <span class="text-blue-600">(as on your photo ID)</span></b></label>
<input type="text" id="name" name="name" required placeholder="Aman Amanov">
<input type="text" id="name" name="name" required>
</div>
<div>
<label for="name"><b>Organization</b></label>
<input type="text" id="name" name="ogranization" placeholder="European Union">
<input type="text" id="name" name="ogranization">
</div>
<div>
<label for="name"><b>City and country</b></label>
<input type="text" id="name" name="name" required placeholder="Ashgabat, Turkmenistan">
<input type="text" id="name" name="name" required>
</div>
<div>
<label for="email"><b>Email</b></label>
<input type="email" id="mail" name="email" placeholder="test.tps@gmail.com">
<input type="email" id="mail" name="email">
</div>
</div>
@ -116,18 +116,97 @@
<br/>
</div>
<button style="width: fit-content" class="p-2 px-8 bg-blue-800 text-gray-100 mb-2" type="submit">Submit</button>
<button id="right_sender" style="display: none" class="p-2 px-8 bg-blue-800 hover:bg-blue-600 text-gray-100 mb-2 font-bold submit-form" type="submit">Submit</button>
<button id="modal_opener" style="width: fit-content; cursor: pointer; display: block" class="p-2 px-8 bg-blue-800 hover:bg-blue-600 text-gray-100 mb-2 font-bold submit-form modal-open" type="button">Submit</button>
<!--Modal-->
<div class="modal opacity-0 transition-opacity ease-in duration-100 pointer-events-none fixed w-full h-full top-0 left-0 flex items-center justify-center">
<div class="modal-overlay absolute w-full h-full bg-gray-900 opacity-50"></div>
<div class="modal-container bg-white w-11/12 md:max-w-md mx-auto rounded shadow-lg z-50 overflow-y-auto">
<div class="modal-close absolute top-0 right-0 cursor-pointer flex flex-col items-center mt-4 mr-4 text-white text-sm z-50">
<svg class="fill-current text-white" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<path d="M14.53 4.53l-1.06-1.06L9 7.94 4.53 3.47 3.47 4.53 7.94 9l-4.47 4.47 1.06 1.06L9 10.06l4.47 4.47 1.06-1.06L10.06 9z"></path>
</svg>
<span class="text-sm">(Esc)</span>
</div>
<!-- Add margin if you want to see some of the overlay behind the modal-->
<div class="modal-content py-8 text-left px-8">
<!--Title-->
<div class="flex justify-between items-center pb-3">
<p class="text-2xl font-bold">Are you sure you do not want to sign off the consent forms?</p>
</div>
<!--Footer-->
<div class="flex justify-end pt-6">
<button type="submit" class="px-4 bg-transparent p-3 rounded-lg text-blue-500 hover:bg-gray-100 hover:text-blue-400 mr-2">Yes</button>
<button class="modal-close px-4 bg-blue-500 p-3 rounded-lg text-white hover:bg-blue-400">No</button>
</div>
</div>
</div>
</div>
<div class="w-full text-center">
<img class="w-2/3 pt-5 m-auto" src="/img/disclaimer.png" alt="EU-Delegation"><br/><br/>
<h4><b>Our sponsors</b></h4>
<img class="w-2/3 pt-5 m-auto" src="/img/disclaimer.png" alt="EU-Delegation"><br/><br/><br/>
<div class="pt-4 pb-4">
<h4><b>Our sponsors</b></h4><br/>
<div class="grid grid-cols-2 gap-8 pt-3">
<div class="p-2">
<img src="/img/sponsors/bomca.png" alt="Bomca" class="w-full">
</div>
<div class="p-2">
<img src="/img/sponsors/ynamdar.png" alt="Ynamdar" class="w-4/5">
</div>
</div>
<div class="flex pt-8" style="justify-content:space-between">
<div class="w-1/4">
<img class="p-2" src="/img/sponsors/france.png" alt="France">
</div>
<div class="w-2/5">
<img class="p-2" src="/img/sponsors/germany.png" alt="Germany">
</div>
<div class="w-1/4">
<img class="p-2" src="/img/sponsors/meno.png" alt="Meno Logistics">
</div>
</div>
<div class="flex pt-2" style="justify-content:space-between">
<div class="w-1/3">
<img class="p-2" src="/img/sponsors/detoxbox.png" alt="Detoxbox">
</div>
<div class="w-1/4">
<img class="p-4" src="/img/sponsors/tylla_nal.png" alt="Tylla nal">
</div>
<div class="w-1/3">
<img class="p-2 pl-12 w-4/5" src="/img/sponsors/gyzgala.png" alt="Gyzgala">
</div>
</div>
<div class="flex pt-2 pb-4" style="justify-content:space-evenly">
<div class="w-1/2">
<img class="p-6" src="/img/sponsors/hilli_tilsimat.png" alt="Hilli tilsimat">
</div>
<div class="w-1/3">
<img class="p-6" src="/img/sponsors/dessange.png" alt="Dessange">
</div>
</div>
<div class="flex pt-8" style="justify-content:space-evenly">
<div class="w-1/3">
<img class="p-6" src="/img/sponsors/owadan.png" alt="Owadan tourism">
</div>
<div class="w-1/5">
<img class="p-6" src="/img/sponsors/turkish_airlines.png" alt="Turkish Airlines">
</div>
</div>
</div>
</div>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script>
<script>
function hideConsent(){
var elem = document.getElementById('consent_form');
elem.setAttribute('checked', true);
$('#right_sender').attr('style', 'display:block; width: fit-content; cursor: pointer;');
$('#modal_opener').hide();
var hideblock = document.getElementById('hideBlock');
hideblock.setAttribute('style', 'display:none');
}
@ -135,9 +214,63 @@ function hideConsent(){
function showConsent(){
var elem = document.getElementById('consent_form');
elem.removeAttribute('checked');
var elem_second = document.getElementById('consent_form_second');
elem_second.removeAttribute('checked');
var elem_third = document.getElementById('consent_form_third');
elem_third.removeAttribute('checked');
$('#modal_opener').attr('style', 'display:block; width: fit-content; cursor: pointer;');
$('#right_sender').hide();
var hideblock = document.getElementById('hideBlock');
hideblock.setAttribute('style', 'display:block');
}
$(".modal-open").on('click', function (event) {
if($("#consent_form").prop('checked') || $("#consent_form_second").prop('checked') || $("#consent_form_third").prop('checked')){
if($("#consent_form").prop('checked')){
$("#consent_form").attr('value', 1);
}
if($("#consent_form_second").prop('checked')){
$("#consent_form_second").attr('value', 1);
}
if($("#consent_form_third").prop('checked')){
$("#consent_form_third").attr('value', 1);
}
$('form').submit();
}
else{
event.preventDefault();
toggleModal();
}
});
const overlay = document.querySelector(".modal-overlay");
overlay.addEventListener("click", toggleModal);
var closemodal = document.querySelectorAll(".modal-close");
for (var i = 0; i < closemodal.length; i++) {
closemodal[i].addEventListener("click", toggleModal);
}
document.onkeydown = function (evt) {
evt = evt || window.event;
var isEscape = false;
if ("key" in evt) {
isEscape = evt.key === "Escape" || evt.key === "Esc";
} else {
isEscape = evt.keyCode === 27;
}
if (isEscape && document.body.classList.contains("modal-active")) {
toggleModal();
}
};
function toggleModal() {
const body = document.querySelector("body");
const modal = document.querySelector(".modal");
modal.classList.toggle("opacity-0");
modal.classList.toggle("pointer-events-none");
body.classList.toggle("modal-active");
}
</script>
</body>