83 lines
3.9 KiB
PHP
83 lines
3.9 KiB
PHP
<?php
|
|
session_start();
|
|
if (!isset($_SESSION['user_id'])) {
|
|
header("Location: login.php");
|
|
exit;
|
|
}
|
|
|
|
require_once __DIR__ . '/db/config.php';
|
|
|
|
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
|
$stmt->execute([$_SESSION['user_id']]);
|
|
$user = $stmt->fetch();
|
|
|
|
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
|
|
|
$stmt = db()->prepare("SELECT * FROM notifications WHERE user_id = ? ORDER BY created_at DESC LIMIT 20");
|
|
$stmt->execute([$_SESSION['user_id']]);
|
|
$notifications = $stmt->fetchAll();
|
|
?>
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Notifications — <?= htmlspecialchars($platformName) ?></title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
|
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
|
<nav class="nav-links">
|
|
<?php if ($user['role'] === 'founder'): ?>
|
|
<a href="startups.php">My Startups</a>
|
|
<a href="partners.php">Find Partners</a>
|
|
<?php else: ?>
|
|
<a href="discover.php">Discover</a>
|
|
<a href="portfolio.php">Portfolio</a>
|
|
<?php endif; ?>
|
|
<a href="messages.php">Messages</a>
|
|
<a href="notifications.php" class="active">Notifications</a>
|
|
</nav>
|
|
<div style="display: flex; align-items: center; gap: 15px;">
|
|
<a href="dashboard.php" style="color: var(--text-secondary);"><i class="fas fa-th-large"></i></a>
|
|
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="container" style="padding-top: 50px;">
|
|
<h1>Notifications</h1>
|
|
<p style="color: var(--text-secondary); margin-bottom: 40px;">Stay up to date with your network's latest updates.</p>
|
|
|
|
<div style="max-width: 800px; margin: 0 auto;">
|
|
<?php if (empty($notifications)): ?>
|
|
<div class="card" style="text-align: center; padding: 60px 20px;">
|
|
<i class="fas fa-bell-slash" style="font-size: 64px; color: var(--accent-blue); opacity: 0.1; margin-bottom: 30px;"></i>
|
|
<h3>No new notifications</h3>
|
|
<p style="color: var(--text-secondary);">We'll alert you here when something important happens.</p>
|
|
<a href="discover.php" class="btn btn-secondary" style="margin-top: 25px;">Explore the Network</a>
|
|
</div>
|
|
<?php else: ?>
|
|
<?php foreach ($notifications as $note): ?>
|
|
<div class="card" style="margin-bottom: 15px; padding: 20px; display: flex; gap: 20px; align-items: flex-start; <?= $note['is_read'] ? 'opacity: 0.6;' : 'border-left: 4px solid var(--accent-blue);' ?>">
|
|
<div style="width: 40px; height: 40px; background: rgba(0, 242, 255, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent-blue);">
|
|
<i class="fas fa-info-circle"></i>
|
|
</div>
|
|
<div>
|
|
<div style="font-size: 14px; margin-bottom: 5px; color: #fff; line-height: 1.5;"><?= htmlspecialchars($note['content']) ?></div>
|
|
<div style="font-size: 12px; color: var(--text-secondary);"><?= date('M d, Y • H:i', strtotime($note['created_at'])) ?></div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</main>
|
|
|
|
</body>
|
|
</html>
|