bigly-chat/libs/page.php

44 lines
1.6 KiB
PHP
Raw Normal View History

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