This commit is contained in:
3p01
2025-10-02 08:45:25 +02:00
parent e661105fff
commit 47e69caac7
2 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<!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>T60 - początek pracy z bazą danych</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Zadanie T60</h1>
<h2>Autor: Jakub Grzegorczyk</h2>
</header>
<div class="box">
<?php
$db = mysqli_connect('localhost', 'root', '', '3i_1_baza1');
$q = "SELECT imie, nazwisko, stanowisko, sekcja FROM pracownicy WHERE sekcja = 'drukarki'";
$result = mysqli_query($db, $q);
if ($result && mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
echo "<p>";
echo "Imię: " . htmlspecialchars($row['imie']) . "<br>";
echo "Nazwisko: " . htmlspecialchars($row['nazwisko']) . "<br>";
echo "Stanowisko: " . htmlspecialchars($row['stanowisko']) . "<br>";
echo "Sekcja: " . htmlspecialchars($row['sekcja']);
echo "</p>";
}
} else {
echo "<p>Brak wyników.</p>";
}
mysqli_close($db);
?>
</div>
</body>
</html>

View File

@@ -0,0 +1,68 @@
* {
box-sizing: border-box;
}
body {
font-family: Verdana, serif;
background: #ffffff;
margin: 15px;
font-size: 0.9em;
}
header {
border: 2px solid black;
border-radius: 1em;
padding: 10px 20px;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
background: #f0f0f0;
}
input {
margin-top: 5px;
margin-bottom: 5px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
height: 2em;
}
button {
padding: 5px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
font-weight: bold;
margin-top: 10px;
}
pre {
font-family: Verdana, serif;
}
.box {
border: 2px solid black;
padding: 15px 20px;
border-radius: 1em;
margin: 15px 0 10px 0;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
}
.box h3 {
cursor: pointer;
}
td {
width: 50px;
height: 50px;
margin: 0;
padding: 0;
}
tr {
padding: 0;
}
.y {
background: yellow;
}
.b {
background:blue;
}