denbooru-php/include/header.php

62 lines
1.2 KiB
PHP

<style>
body{
background-color: black;
}
*{
color: white;
font-family: monospace;
}
input{
background-color: black;
padding: 5px;
border: 1px solid white;
}
a:visited{
color: grey;
}
#header{
text-align: center;
}
.alert{
margin: 20px;
padding: 5px;
color: orange;
border: solid orange 1px;
margin: auto;
width: 60vw;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div id="header">
<?php
//if($_SESSION["login"] === true) echo "You are logged in - <a href='/logout.php'>logout</a>";
print("<a href='" . $BASE_PATH . "/'>Home</a> ");
if($_SESSION["login"] === true){
echo "<a href='/logout.php'>logout</a>";
if($_SESSION["username"] == "admin"){
print(" <a href='" . $BASE_PATH . "/admin.php'>Admin</a>");
}
}
else{
echo "<a href='/login.php'>Login</a>";
}
?>
<h1>Dendy\'s Suckless Booru</h1>
<form method="GET" action="tag.php">
<input type="text" name="t" value="<?php if($_GET["t"]) echo $_GET["t"]; ?>">
<input type="submit">
</form>
<?php
if(isset($_SESSION["msg"]) and is_array($_SESSION["msg"])){
foreach($_SESSION["msg"] as $message){
echo("<div class='alert'>" . $message . "</div>");
$_SESSION["msg"] = array();
}
}
?>
</div>