Can now see invite code from user settings

This commit is contained in:
Michał 2022-07-28 15:09:03 +01:00
parent e43e4dce1d
commit dc98d04b8a
2 changed files with 31 additions and 1 deletions

View file

@ -10,15 +10,31 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@500&amp;display=swap">
</head>
<body>
<?php include("../ui/header.php"); ?>
<?php
include("../ui/header.php");
include("../ui/conn.php");
?>
<div class="account-root default-window">
<h2>Account settings</h2>
<?php
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
echo "<p>O hi ".$_SESSION["username"].".</p>";
// Reset password
echo "<a class='btn alert-low space-top' href='https://superdupersecteteuploadtest.fluffybean.gay/account/password-reset.php'><img class='svg' src='../assets/icons/password.svg'>Reset Password</a>";
// Logout
echo "<a class='btn alert-low space-top' href='https://superdupersecteteuploadtest.fluffybean.gay/account/logout.php'><img class='svg' src='../assets/icons/sign-out.svg'>Logout</a>";
// Join code
if ($_SESSION["id"] == 1) {
echo "<h2 class='space-top-large'>Invite Code</h2>";
$token_request = mysqli_query($conn, "SELECT * FROM tokens WHERE used = 0");
while ($token = mysqli_fetch_array($token_request)) {
echo "<p class='text-box space-top center'>".$token['code']."</p>";
}
}
} else {
echo "<p class='space-bottom-large'>You must be logged in to change your account settings!</p>";
echo "<a class='btn alert-high space-top-large' href='https://superdupersecteteuploadtest.fluffybean.gay/account/login.php'>Login!</a>";

View file

@ -274,6 +274,20 @@ body {
display: inline;
}
.text-box {
padding: 0.5rem;
display: block;
font-size: 16px;
text-decoration: none;
background-color: var(--black);
border: none;
border-radius: var(--rad);
}
/*
-=-=-= ALERT =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
*/