Compare commits
No commits in common. "72452e9a3ae6cb597019d07ebba7e8ef3dc6ed40" and "0f7635329d4ca752700fe7c5b2b44c2b4777a80c" have entirely different histories.
72452e9a3a
...
0f7635329d
34
1
Normal file
34
1
Normal file
@ -0,0 +1,34 @@
|
||||
const listOfUsers = [];
|
||||
|
||||
function getData() {
|
||||
|
||||
fetch('./php/get.php')
|
||||
.then(response => {
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
// Dodaj pobrane dane do tablicy
|
||||
|
||||
listOfUsers.push(...data);
|
||||
|
||||
// Wyświetl dane w konsoli
|
||||
console.log("Lista użytkowników:", listOfUsers);
|
||||
|
||||
// Wyświetl imiona na stronie
|
||||
const resultDiv = document.getElementById('orderTables');
|
||||
|
||||
|
||||
let html = '<h3>Znalezieni użytkownicy:</h3><ul>';
|
||||
|
||||
data.forEach(user => {
|
||||
html += `<li>${user.cena}</li>`;
|
||||
});
|
||||
html += '</ul>';
|
||||
resultDiv.innerHTML = html;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Wystąpił błąd podczas pobierania danych:", error);
|
||||
const resultDiv = document.getElementById('result');
|
||||
resultDiv.innerHTML = '<p>Błąd podczas pobierania danych. Sprawdź konsolę.</p>';
|
||||
});
|
||||
}
|
44
js/tabs.js
44
js/tabs.js
@ -1,44 +0,0 @@
|
||||
// tabs.js
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Pobierz wszystkie linki zakładek i sekcje zawartości
|
||||
const tabLinks = document.querySelectorAll('.tab-link');
|
||||
const tabContents = document.querySelectorAll('.tab-content');
|
||||
|
||||
// Funkcja do przełączania zakładek
|
||||
function switchTab(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Usuń klasę 'active' ze wszystkich linków zakładek
|
||||
tabLinks.forEach(link => link.classList.remove('active'));
|
||||
|
||||
// Usuń klasę 'active' ze wszystkich sekcji zawartości
|
||||
tabContents.forEach(content => content.classList.remove('active'));
|
||||
|
||||
// Dodaj klasę 'active' do klikniętego linku
|
||||
const clickedLink = event.currentTarget;
|
||||
clickedLink.classList.add('active');
|
||||
|
||||
// Pobierz ID sekcji, którą należy aktywować (z atrybutu data-tab)
|
||||
const tabId = clickedLink.getAttribute('data-tab');
|
||||
|
||||
// Aktywuj odpowiednią sekcję zawartości
|
||||
const activeContent = document.getElementById(tabId);
|
||||
if (activeContent) {
|
||||
activeContent.classList.add('active');
|
||||
}
|
||||
}
|
||||
|
||||
// Dodaj nasłuchiwanie zdarzeń do każdego linku zakładki
|
||||
tabLinks.forEach(link => {
|
||||
// Obsługa kliknięcia myszą
|
||||
link.addEventListener('click', switchTab);
|
||||
|
||||
// Obsługa klawiatury (Enter lub Spacja)
|
||||
link.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Enter' || event.key === ' ') {
|
||||
event.preventDefault();
|
||||
switchTab(event);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$polaczenie = mysqli_connect("192.168.175.71", "root", "secret", "db");
|
||||
$polaczenie = mysqli_connect("192.168.94.71", "root", "secret", "db");
|
||||
|
||||
$kwerenda = mysqli_query($polaczenie, "SELECT * FROM zamowienia1 ORDER BY id ASC");
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$dbhost="192.168.175.71";
|
||||
$dbhost="192.168.94.71";
|
||||
//$dbhost="172.18.0.2";
|
||||
$dbuser="root";
|
||||
$dbpass="secret";
|
||||
|
Loading…
Reference in New Issue
Block a user