PCQRSCANER/index.php

118 lines
2.3 KiB
PHP
Raw Normal View History

2019-11-18 20:43:33 +01:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
2019-12-22 21:51:47 +01:00
<link rel="Stylesheet" href="style/style.css">
2019-11-18 20:43:33 +01:00
</head>
<body>
<?php
$conn = new mysqli("localhost", "root", "", "komputery") or die("B<EFBFBD><EFBFBD>d");
$wynik = $conn->query("SELECT * FROM parametry WHERE Id = 1 ");
echo "<h1>Dane twojego komputera: </h1>";
2019-12-22 21:51:47 +01:00
echo "<br>";
2019-11-18 20:43:33 +01:00
if($wynik->num_rows > 0){
echo "<table>";
echo "<tr>";
echo "<th>Id</th>";
echo "<th>Procesor</th>";
echo "<th>Plyta_Glowna</th>";
echo "<th>Pamiec_Ram</th>";
echo "<th>Dysk</th>";
echo "<th>Karta_Graficzna</th>";
echo "</tr>";
2019-12-22 21:51:47 +01:00
2019-11-18 20:43:33 +01:00
while( $wiersz = $wynik->fetch_assoc() ){
echo "<tr>";
echo "<td>" . $wiersz["Id"] . "</td>";
echo "<td>" . $wiersz["Procesor"] . "</td>";
echo "<td>" . $wiersz["Plyta_Glowna"] . "</td>";
echo "<td>" . $wiersz["Pamiec_Ram"] . "</td>";
echo "<td>" . $wiersz["Dysk"] . "</td>";
echo "<td>" . $wiersz["Karta_Graficzna"] . "</td>";
echo "</tr>";
2019-12-22 21:51:47 +01:00
2019-11-18 20:43:33 +01:00
}
2019-12-22 21:51:47 +01:00
echo "</table>";
echo "<br>";
}
else {
echo "Nie ma nic w bazie danych";
}
$wynik = $conn->query("SELECT * FROM uzytkownicy WHERE Id = 1 ");
echo "<h1>Informacje o uzytkowniku: </h1>";
if($wynik->num_rows > 0){
echo "<table>";
echo "<tr>";
echo "<th>Id</th>";
echo "<th>Imie</th>";
echo "<th>Nazwisko</th>";
echo "<th>Data wydania</th>";
echo "<th>Data zakonczenia leasingu</th>";
echo "<th>Dzial</th>";
echo "</tr>";
2019-11-18 20:43:33 +01:00
2019-12-22 21:51:47 +01:00
while( $wiersz = $wynik->fetch_assoc() ){
echo "<tr>";
echo "<td>" . $wiersz["Id"] . "</td>";
echo "<td>" . $wiersz["Imie"] . "</td>";
echo "<td>" . $wiersz["Nazwisko"] . "</td>";
echo "<td>" . $wiersz["Data_wydania"] . "</td>";
echo "<td>" . $wiersz["Data_zak_lea"] . "</td>";
echo "<td>" . $wiersz["Dzial"] . "</td>";
echo "</tr>";
}
2019-11-18 20:43:33 +01:00
echo "</table>";
2019-12-22 21:51:47 +01:00
}
else {
2019-11-18 20:43:33 +01:00
echo "Nie ma nic w bazie danych";
}
2019-12-22 21:51:47 +01:00
2019-11-18 20:43:33 +01:00
$conn->close();
?>
</body>
</html>