death-notifier/src/main/index.php

153 lines
5.5 KiB
PHP

<?php
session_start();
$_SESSION["token"] = bin2hex(random_bytes(32));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Florine W. Dekker" />
<meta name="application-name" content="Death Notifier" />
<meta name="description" content="Get notified when a famous person dies." />
<meta name="theme-color" content="#0033cc" />
<title>Death Notifier | FWDekker</title>
<link rel="stylesheet" href="https://static.fwdekker.com/fonts/roboto/roboto.css" />
<link rel="stylesheet" href="https://static.fwdekker.com/lib/template/2.x.x/template.css" />
<!--suppress HtmlUnknownTarget -->
<!-- <link rel="stylesheet" href="main.css?v=%%VERSION_NUMBER%%" />-->
<script async src="https://stats.fwdekker.com/count.js"
data-goatcounter="https://stats.fwdekker.com/count"></script>
</head>
<body>
<noscript>
<img src="https://stats.fwdekker.com/count?p=/tools/death-notifier/" alt="Counting pixel" />
<p>
This website does not function if JavaScript is disabled.
Please check the
<a href="https://www.enable-javascript.com/">instructions on how to enable JavaScript in your web browser</a>.
</p>
</noscript>
<main class="hidden">
<div id="nav"></div>
<div id="contents">
<div id="header"></div>
<section class="container">
<h1>Register</h1>
<form action="api.php" method="post">
<input type="hidden" name="action" value="register" />
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>" />
<label>
Email
<input type="email" name="email" />
</label>
<label>
Password
<input type="password" name="password" />
</label>
<label>
Confirm password
<input type="password" name="password_confirm" />
</label>
<input type="submit" />
</form>
<h1>Log in</h1>
<form action="api.php" method="post">
<input type="hidden" name="action" value="login" />
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>" />
<label>
Email
<input type="email" name="email" />
</label>
<label>
Password
<input type="password" name="password" />
</label>
<input type="submit" />
</form>
<h1>Log out</h1>
<form action="api.php" method="post">
<input type="hidden" name="action" value="logout" />
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>" />
<input type="submit" />
</form>
<h1>Login status</h1>
<?= isset($_SESSION["uuid"]) ? "logged in" : "not logged in"; ?>
<h1>Change email</h1>
<form action="api.php" method="post">
<input type="hidden" name="action" value="user-update-email" />
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>" />
<label>
Email
<input type="email" name="email" />
</label>
<input type="submit" />
</form>
<h1>Change password</h1>
<form action="api.php" method="post">
<input type="hidden" name="action" value="user-update-password" />
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>" />
<label>
Old password
<input type="password" name="password_old" />
</label>
<label>
New password
<input type="password" name="password_new" />
</label>
<label>
Confirm new password
<input type="password" name="password_confirm" />
</label>
<input type="submit" />
</form>
<h1>Add tracking</h1>
<form action="api.php" method="post">
<input type="hidden" name="action" value="add-tracking" />
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>" />
<label>
Person name
<input name="person_name" />
</label>
<input type="submit" />
</form>
<h1>Remove tracking</h1>
<form action="api.php" method="post">
<input type="hidden" name="action" value="delete-tracking" />
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>" />
<label>
Person name
<input name="person_name" />
</label>
<input type="submit" />
</form>
<h1>Trackings</h1>
<pre id="trackings">
</pre>
</section>
</div>
<div id="footer"></div>
</main>
<script src="https://static.fwdekker.com/lib/template/2.x.x/template.js"></script>
<!--suppress HtmlUnknownTarget -->
<script src="bundle.js?v=%%VERSION_NUMBER%%"></script>
</body>
</html>