mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-23 22:30:41 +01:00
added settings site (styling required , though...)
This commit is contained in:
parent
79538bbd88
commit
93a46fafe4
2 changed files with 42 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
|||
<link rel="stylesheet" href="/style/settings.css">
|
||||
<h1>Settings</h1>
|
||||
<h2>User</h2>
|
||||
<?php
|
||||
include $_SESSION["docroot"].'/php/connect.php';
|
||||
$token = $_COOKIE["token"];
|
||||
$query = "SELECT username, email, last_login FROM `users` WHERE `uid` = (SELECT user FROM `sessions` WHERE `session_id` = \"$token\")";
|
||||
$result = $mysqli->query($query);
|
||||
$user = $result->fetch_assoc();
|
||||
?>
|
||||
<div class="userprofile">
|
||||
<span><font class="attribute">Benutzername</font><font class="value"><input type="text" name="username" value="<?php echo $user["username"]; ?>"></font></span>
|
||||
<span><font class="attribute">Email</font><font class="value"><input type="text" name="username" value="<?php echo $user["email"]; ?>"></font></span>
|
||||
<span><font class="attribute">Letzter Login</font><font class="value"><?php echo $user["last_login"]; ?></font></span>
|
||||
</div>
|
||||
<button class="button" id="safeButton">Speichern</button>
|
26
style/settings.css
Normal file
26
style/settings.css
Normal file
|
@ -0,0 +1,26 @@
|
|||
.userprofile {
|
||||
width: 30em;
|
||||
max-width: 90%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid grey;
|
||||
border-radius: 5px;
|
||||
background-color: #ddd;
|
||||
}
|
||||
.userprofile span {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.attribute {
|
||||
width: 10em;
|
||||
padding: 1em;
|
||||
}
|
||||
.value {
|
||||
padding: 1em;
|
||||
}
|
||||
#safeButton {
|
||||
margin: 1em;
|
||||
width: min-content;
|
||||
float: right;
|
||||
}
|
Loading…
Reference in a new issue