This commit is contained in:
Flatlogic Bot 2026-02-28 22:27:30 +00:00
parent d9f48ce404
commit 113fd9f5f9
3 changed files with 7 additions and 7 deletions

View File

@ -68,7 +68,7 @@ if ($user['role'] === 'founder') {
SELECT s.*, fr.funding_goal as active_goal, fr.funding_raised as active_raised, fr.status as round_status, fr.id as round_id
FROM startups s
LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active'
WHERE s.user_id = ?
WHERE s.founder_id = ?
ORDER BY s.created_at DESC
");
$stmt->execute([$_SESSION['user_id']]);

View File

@ -14,7 +14,7 @@ if (!$startupId) {
}
$stmt = db()->prepare("
SELECT s.*, fr.id as round_id, fr.funding_goal, fr.funding_raised, fr.status as round_status, s.user_id as founder_id
SELECT s.*, fr.id as round_id, fr.funding_goal, fr.funding_raised, fr.status as round_status, s.founder_id as founder_id
FROM startups s
LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active'
WHERE s.id = ?

View File

@ -32,7 +32,7 @@ if (!$startup) {
}
// Check if user is the founder or an investor
$isFounder = ($_SESSION['user_id'] == $startup['user_id']);
$isFounder = ($_SESSION['user_id'] == $startup['founder_id']);
$isInvestor = ($user['role'] == 'investor');
// Basic permissions check
@ -69,8 +69,8 @@ if ($isFounder) {
}
// Fetch founders
$stmt = db()->prepare("SELECT id, full_name as name FROM users WHERE id = ?");
$stmt->execute([$startup['user_id']]);
$stmt = db()->prepare("SELECT id, full_name FROM users WHERE id = ?");
$stmt->execute([$startup['founder_id']]);
$founder = $stmt->fetch();
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
@ -318,13 +318,13 @@ function getNextDividendInfo($createdAt) {
<?= htmlspecialchars($startup['name']) ?>
</h1>
<p style="color: var(--text-secondary); margin-top: 10px; font-size: 16px;">
Founded by <a href="profile.php?id=<?= $founder['id'] ?>" style="color: #fff; font-weight: 700; text-decoration: none; border-bottom: 1px dashed var(--accent-blue);"><?= htmlspecialchars($founder['name']) ?></a>
Founded by <a href="profile.php?id=<?= $founder['id'] ?>" style="color: #fff; font-weight: 700; text-decoration: none; border-bottom: 1px dashed var(--accent-blue);"><?= htmlspecialchars($founder['full_name']) ?></a>
</p>
</div>
<?php if ($isInvestor): ?>
<div style="display: flex; gap: 15px;">
<a href="messages.php?chat_with=<?= $startup['user_id'] ?>" style="background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: #fff; padding: 16px 24px; border-radius: 14px; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 10px;">
<a href="messages.php?chat_with=<?= $startup['founder_id'] ?>" style="background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: #fff; padding: 16px 24px; border-radius: 14px; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 10px;">
<i class="far fa-comment-dots"></i> Message Founder
</a>
<a href="invest.php?id=<?= $startup['id'] ?>" class="invest-btn">