diff --git a/@ b/@ new file mode 100644 index 0000000..c4053f7 --- /dev/null +++ b/@ @@ -0,0 +1,37 @@ +document.addEventListener('DOMContentLoaded', function() { + + //const imieSelect = document.getElementById('imie'); + + let usersData = []; + + imieSelect.addEventListener('focus', function() { + fetch('php/gget.php') + .then(response => response.json()) + .then(data => { + /* + usersData = data; + imieSelect.innerHTML = ""; + data.forEach(dane => { + const option = document.createElement('option'); + option.value = dane.id; + option.textContent = dane.imie + " " + dane.nazwisko; + imieSelect.appendChild(option); + }); +*/ + + console.log(data); + }) + .catch(error => console.error('Error fetching data:', error)); + }); +/* + imieSelect.addEventListener('change', function() { + const selectedId = imieSelect.value; + const selectedPerson = usersData.find(dane => dane.id == selectedId); + if (selectedPerson && selectedPerson.photo) { + photoDisplay.src = 'data:image/jpeg;base64,' + selectedPerson.photo; + } else { + photoDisplay.src = ''; + } + }); +*/ +}); diff --git a/index.html b/index.html index d52ae20..5fc77b9 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,9 @@