php repozitar
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
1.6 KiB

<?php
require("init.php");
$title = "Admin page";
//příprava k zobrazení dat
// $sql = "SELECT * FROM intro ORDER BY id DESC";
// $result = mysqli_query($conn,$sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.css">
<title><?php echo $title;?></title>
</head>
<body>
<div class="container">
<h1><?php echo $title;?></h1>
<table class="table table-striped table-bordered">
<thead>
<th>ID</th>
<th>Název knihy</th>
<th>Autor Knihy</th>
<th>Rok vydání</th>
<th>Akce</th>
</thead>
<?php
//příprava k zobrazení dat
$sql = "SELECT id, nazev, autor, rok_vydani FROM intro";
$result = mysqli_query($conn,$sql);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)){
echo "<tr>";
echo "<td>".$row["id"]."</td>";
echo "<td>".$row["nazev"]."</td>";
echo "<td>".$row["autor"]."</td>";
echo "<td>".$row["rok_vydani"]."</td>";
// odkaz na UPDATE data
echo "<td>"; //update.php?id=5
echo '<a href="update.php?id='.$row["id"].'">UPDATE</a>';
echo "</td>";
echo "</tr>";
}
}
?>
</table>
</div>
<script src="js/bootstrap.js"></script>
</body>
</html>