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.
 
 
 

66 lines
1.8 KiB

<?php
//napojení na DB
$servername = "studenti.odbornaskola.cz";
$user = "u447";
$pw = "000000";
$dbname = "u447";
$conn = mysqli_connect($servername, $user, $pw, $dbname);
?>
<!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">
<title>Document</title>
<link rel="stylesheet" href="css/bootstrap.css">
</head>
<body>
<div class="container">
<header class="d-flex flex-wrap justify-content-center py-3 mb-4 border-bottom">
<a href="/" class="text-dark text-decoration-none">
<span class="fs-4">Prijmeni 2023</span>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="#" class="nav-link ">Home</a></li>
</ul>
</header>
<H1>TEST</H1>
<form action="todo_add.php" method="post">
<input type="text" name="todo" id="todo" class="form-control mb-2">
<input type="submit" value="Přidat Úkol" class="btn btn-primary">
</form>
<table class="table">
<thead>
<th>Ukol</th>
<th>Akce</th>
</thead>
<?php
$sql = "SELECT todo, id FROM todolist";
$result = mysqli_query($conn,$sql);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)){
echo "<tr>";
echo "<td>". $row["todo"]."</td>";
echo '<td><a href="todo_del.php?id='. $row["id"].'">DELETE</a></td>';
echo "</tr>";
}
}
?>
</table>
</div>
<script src="js/bootstrap.js"></script>
</body>
</html>