This commit is contained in:
3p01
2026-03-02 14:57:16 +01:00
parent ce64f7b284
commit 8b051b79d8
13 changed files with 119 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

View File

@@ -0,0 +1,4 @@
SELECT * FROM opony ORDER BY cena LIMIT 10;
SELECT producent, model, sezon, cena FROM opony WHERE nr_kat = 9;
SELECT id_zam, ilosc, model, cena FROM zamowienie JOIN opony USING(nr_kat) ORDER BY RAND() LIMIT 1;
UPDATE opony SET cena = cena * 0.75 WHERE sezon = 'letnia';

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -0,0 +1,66 @@
<?php
$db = mysqli_connect('localhost', 'root', '', 'opony');
header("Refresh: 10");
?>
<!doctype html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>OPONY</title>
<link rel="stylesheet" href="styl.css">
</head>
<body>
<main>
<aside>
<?php
$sql1 = "SELECT * FROM opony ORDER BY cena LIMIT 10;";
$result1 = mysqli_query($db, $sql1);
while ($row = mysqli_fetch_assoc($result1)) {
echo "<div class='opona'>";
if ($row['sezon'] == 'letnia') {
echo "<img src='lato.png' alt='letnia'>";
} elseif ($row['sezon'] == 'zimowa') {
echo "<img src='zima.png' alt='zimowa'>";
} elseif ($row['sezon'] == 'uniwersalna') {
echo "<img src='uniwer.png' alt='uniwersalna'>";
}
echo "<h4>Opona: {$row['producent']} {$row['model']}</h4>";
echo "<h3>Cena: {$row['cena']}</h3>";
echo "</div>";
}
?>
<a href="https://opona.pl">Więcej ofert</a>
</aside>
<section id="section-1">
<img src="opona.png" alt="Opona">
<h2>Opona dnia</h2>
<?php
$sql2 = "SELECT producent, model, sezon, cena FROM opony WHERE nr_kat = 9;";
$result2 = mysqli_query($db, $sql2);
$row = mysqli_fetch_assoc($result2);
echo "<h2>" . $row['producent'] . " model " . $row['model'] . "</h2>";
echo "<h2>Sezon: " . $row['sezon'] . "</h2>";
echo "<h2>Tylko " . $row['cena'] . " zł!</h2>";
?>
</section>
<section id="section-2">
<h3>Najnowsze zamówienie</h3>
<?php
$sql3 = "SELECT id_zam, ilosc, model, cena FROM zamowienie JOIN opony USING(nr_kat) ORDER BY RAND() LIMIT 1;";
$result3 = mysqli_query($db, $sql3);
$row = mysqli_fetch_assoc($result3);
echo "<h2>" . $row['id_zam'] . " " . $row['ilosc'] . " sztuki modelu " . $row['model'] . "</h2>";
$value = $row['ilosc'] * $row['cena'];
echo "<h2>Wartość zamówienia $value zł</h2>";
?>
</section>
</main>
<footer>
<p>Stronę wykonał: Jakub Grzegorczyk 3p/1</p>
</footer>
</body>
</html><?php

View File

@@ -0,0 +1,49 @@
* {
font-family: "Trebuchet MS", sans-serif;
}
aside {
background: #C5CAE9;
width: 40%;
height: 600px;
overflow: auto;
float: left;
}
section {
width: 60%;
height: 300px;
float: left;
}
#section-1 {
background: #9FA8DA;
}
#section-2 {
background: #7986CB;
}
footer {
background: #283593;
color: white;
padding: 20px;
clear: both;
}
.opona {
background: #9FA8DA;
margin: 40px;
border: 2px dotted #283593;
border-radius: 30px;
}
img {
padding: 20px;
float: left;
}
h2 {
text-align: center;
margin: 0;
padding: 15px;
}
h3 {
background: #7986CB;
color: white;
padding: 10px;
margin: 0;
font-size: 140%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB