50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="pl">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Planer</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body>
|
|
<?php
|
|
if(!isset($_GET['date'])) {
|
|
header("Location: ./");
|
|
exit();
|
|
}
|
|
|
|
$date = $_GET['date'];
|
|
$year = substr($date, 0, 4);
|
|
$month = substr($date, 5, 2);
|
|
$day = substr($date, 8, 2);
|
|
?>
|
|
|
|
<div class="container">
|
|
<form action="update.php" method="post">
|
|
<p>Na <?=$date?> zaplanowałem:</p>
|
|
|
|
<br>
|
|
|
|
<textarea name="plans" id="plans"><?php
|
|
include('./config.php');
|
|
$conn = mysqli_connect($host, $user, $pass, $dbnm);
|
|
|
|
$plany_q = $conn->prepare('SELECT value FROM wydarzenia WHERE `date` = ?;');
|
|
$plany_q->bind_param("s", $date);
|
|
$plany_q->execute();
|
|
|
|
$plany_r = $plany_q->get_result()->fetch_assoc();
|
|
echo @$plany_r['value'];
|
|
|
|
mysqli_close($conn);
|
|
?></textarea>
|
|
|
|
<br>
|
|
|
|
<button onclick="event.preventDefault(); window.location='./?year=<?=$year?>&month=<?=$month?>';">Anuluj</button>
|
|
<button formaction="delete.php">Skasuj</button>
|
|
<input type="submit" value="OK">
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</html>
|