This commit is contained in:
Fabian Kowalski 2025-09-17 09:22:36 +02:00
commit d41a77a2b1
5 changed files with 157 additions and 0 deletions

1
INF.03-01-25.01-SG Submodule

@ -0,0 +1 @@
Subproject commit e30d313d987cfab61d317ce6edba20a3f4b47ed4

68
css/layout.css Normal file
View File

@ -0,0 +1,68 @@
body {
font-family: Helvetica;
background-color: #EAEAEA;
margin: 0;
padding: 0;
}
header {
position: relative;
text-align: center;
}
header img {
width: 100%;
}
.header-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 48px;
font-weight: bold;
}
nav, footer {
background-color: #625B5B;
color: white;
padding: 20px;
text-align: center;
}
nav a {
font-weight: bold;
background-color: #EAEAEA;
color: #625B5B;
padding: 10px;
margin: 50px;
border-radius: 20px;
text-decoration: none;
}
nav a:hover {
background-color: #625B5B;
color: #EAEAEA;
border: 1px solid #EAEAEA;
}
ul {
margin-left: 40px;
list-style-type: circle;
}
table {
border: 1px dashed #625B5B;
width: 60%;
margin-left: 40px;
text-align: center;
}
.kontrolki {
margin: 5px;
}
main {
padding: 20px;
}

42
i1.html Normal file
View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Kursy komputerowe</title>
<link rel="stylesheet" href="css/layout.css">
<script src="js/skrypt.js" defer> </script>
</head>
<body>
<header>
<img src="imgs/baner.png" alt="kursy komputerowe">
<div class="header-text">hello</div>
</header>
<nav>
<a href="i1.html">Strona główna</a>
<a href="raty.html">Koszt rat</a>
<a href="https://moje-szkolenia.pl/">Nasz partner</a>
</nav>
<main>
<h3>Kursy komputerowe - programowanie</h3>
<table id="tab">
<tr>
<th>Kurs</th>
<th>Czas trwania</th>
<th>Cena</th>
</tr>
</table>
<h3>Adres do korespondencji</h3>
<ul>
<li>Adres: Katowice, ul. Mariacka 5</li>
<li>Telefon: 32 888 88 88</li>
</ul>
<a href="mailto:kursy@komputerowe.pl">skontaktuj się</a>
</main>
<footer>
<p>Autor strony: 99010101010</p>
</footer>
</body>
</html>

33
js/skrypt.js Normal file
View File

@ -0,0 +1,33 @@
document.addEventListener("DOMContentLoaded", function() {
console.log("zaladowano...")
function getData() {
return fetch('./php/get.php')
.then(res => {
console.log("Res:", res)
return res.json()
})
.then(data => {
console.log("Data:", data)
renderTable(data)
})
.catch(error => {
console.log("Error:", error)
})
}
function renderTable(data) {
let table = document.getElementById('tab')
data.forEach(row => {
let tr = document.createElement('tr');
tr.innerHTML=
`<td>${row.nazwa}</td>
<td>${row.czas_trwania}</td>
<td>${row.cena}</td>`
table.appendChild(tr)
})
}
getData()
})

13
php/get.php Normal file
View File

@ -0,0 +1,13 @@
<?php
$baza = mysqli_connect("localhost", "root", "", "szkolenia");
$res = mysqli_query($baza, "SELECT * FROM `kursy` WHERE 1");
$array = array();
while($row = mysqli_fetch_assoc($res)) {
array_push($array, $row);
}
echo json_encode($array);
?>