bigly-chat/libs/page.php

46 lines
1.6 KiB
PHP
Raw Normal View History

2024-11-26 11:38:28 -05:00
<?php
2025-02-05 01:27:45 -05:00
require(__DIR__ . "/auth.php");
global $username;
function page_header()
{
global $db;
2024-11-26 23:37:16 -05:00
global $username;
2025-02-05 01:27:45 -05:00
$stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC");
$stmt->execute([
"notification",
$username,
]);
2025-01-20 16:50:22 -05:00
2025-02-05 01:27:45 -05:00
$posts2 = $stmt->fetchAll(PDO::FETCH_DEFAULT);
$edge = count($posts2);
?>
<!DOCTYPE html>
<html>
<head>
<title>BiglyChat</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1">
<link rel="icon" href="/img/bgc.svg">
2025-01-28 17:09:23 -05:00
<link rel="stylesheet" href="/css/main.css">
2025-02-05 01:27:45 -05:00
</head>
<body>
<div class="header">
<a href="/"><img class="header-img header-link" src="/img/bgc.svg">BiglyChat</a>
<?php if (isset($username)) { ?>
<a href="/user.php?id=<?php echo $username ?>"><img class="header-img header-link" src="/pfp/<?php echo $username ?>.png">Wall</a>
<a href="/notif.php"> <img class="header-img header-link" src="/img/mail.svg"><span>Mail<sub> <?php echo $edge?></sub></span></a>
<a href="/stats.php?username=<?php echo $username ?>"><img class="header-img header-link" src="/img/home.svg">Users</a>
<a href="/logout.php"><img class="header-img header-link" src="/img/logout.svg">Leave</a>
<?php } else { ?>
<a href="/login.php"><img class="header-img header-link" src="/img/home.svg">Join</a>
<a href="/stats.php"><img class="header-img header-link" src="/img/home.svg">Users</a>
<?php }
?>
</div>
<?php }
function page_footer()
{ ?>
</body>
</html>
<?php }
2024-12-07 09:10:36 -05:00
?>