v40
This commit is contained in:
parent
5e486a2b26
commit
620c82043f
@ -9,11 +9,24 @@ function hash_pass($p) {
|
|||||||
|
|
||||||
// Clear existing data to avoid conflicts during re-seed
|
// Clear existing data to avoid conflicts during re-seed
|
||||||
$db->exec("SET FOREIGN_KEY_CHECKS = 0");
|
$db->exec("SET FOREIGN_KEY_CHECKS = 0");
|
||||||
$db->exec("TRUNCATE TABLE messages");
|
$tables = [
|
||||||
$db->exec("TRUNCATE TABLE startup_followers");
|
'ai_chats',
|
||||||
$db->exec("TRUNCATE TABLE funding_rounds");
|
'blocked_users',
|
||||||
$db->exec("TRUNCATE TABLE startups");
|
'faqs',
|
||||||
$db->exec("TRUNCATE TABLE users");
|
'funding_rounds',
|
||||||
|
'investments',
|
||||||
|
'matches',
|
||||||
|
'messages',
|
||||||
|
'notifications',
|
||||||
|
'startup_followers',
|
||||||
|
'startup_updates',
|
||||||
|
'startups',
|
||||||
|
'swipes',
|
||||||
|
'users'
|
||||||
|
];
|
||||||
|
foreach ($tables as $table) {
|
||||||
|
$db->exec("TRUNCATE TABLE $table");
|
||||||
|
}
|
||||||
$db->exec("SET FOREIGN_KEY_CHECKS = 1");
|
$db->exec("SET FOREIGN_KEY_CHECKS = 1");
|
||||||
|
|
||||||
$founders = [
|
$founders = [
|
||||||
@ -158,8 +171,7 @@ $stmt_startup = $db->prepare("INSERT INTO startups (
|
|||||||
:cofounder_equity_pct, :cofounder_equity_type, :cofounder_responsibilities, :desired_cofounder_experience, :cofounder_commitment, :other_partnership_details,
|
:cofounder_equity_pct, :cofounder_equity_type, :cofounder_responsibilities, :desired_cofounder_experience, :cofounder_commitment, :other_partnership_details,
|
||||||
:current_cash_balance, :burn_rate, :outstanding_debt, :accounts_receivable_payable,
|
:current_cash_balance, :burn_rate, :outstanding_debt, :accounts_receivable_payable,
|
||||||
'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf',
|
'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf', 'assets/docs/financials/placeholder.pdf',
|
||||||
:recommended_return_rate, :founder_return_rate
|
:recommended_return_rate, :founder_return_rate");
|
||||||
)");
|
|
||||||
|
|
||||||
$stmt_round = $db->prepare("INSERT INTO funding_rounds (startup_id, funding_goal, status) VALUES (:startup_id, :funding_goal, 'Active')");
|
$stmt_round = $db->prepare("INSERT INTO funding_rounds (startup_id, funding_goal, status) VALUES (:startup_id, :funding_goal, 'Active')");
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,13 @@ if (!$isFounder && $startup['status'] === 'private' && !$isInvestor) {
|
|||||||
$canSeeHistory = $isFounder || $isInvestor;
|
$canSeeHistory = $isFounder || $isInvestor;
|
||||||
$fundingHistory = [];
|
$fundingHistory = [];
|
||||||
if ($canSeeHistory) {
|
if ($canSeeHistory) {
|
||||||
$stmt = db()->prepare("SELECT i.*, u.full_name as investor_name, u.id as investor_user_id FROM investments i JOIN users u ON i.investor_id = u.id WHERE i.startup_id = ? AND i.status != 'rejected' ORDER BY i.created_at DESC");
|
$stmt = db()->prepare("
|
||||||
|
SELECT i.*, u.full_name as investor_name, u.id as investor_user_id
|
||||||
|
FROM investments i
|
||||||
|
LEFT JOIN users u ON i.investor_id = u.id
|
||||||
|
WHERE i.startup_id = ? AND i.status != 'rejected'
|
||||||
|
ORDER BY i.created_at DESC
|
||||||
|
");
|
||||||
$stmt->execute([$startupId]);
|
$stmt->execute([$startupId]);
|
||||||
$fundingHistory = $stmt->fetchAll();
|
$fundingHistory = $stmt->fetchAll();
|
||||||
}
|
}
|
||||||
@ -90,8 +96,7 @@ $progress = ($goal > 0) ? round(($raised / $goal) * 100) : 0;
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
display: flex;
|
display: flex; align-items: center;
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
.data-label {
|
.data-label {
|
||||||
@ -347,16 +352,30 @@ $progress = ($goal > 0) ? round(($raised / $goal) * 100) : 0;
|
|||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div style="display: flex; flex-direction: column; gap: 15px;">
|
<div style="display: flex; flex-direction: column; gap: 15px;">
|
||||||
<?php foreach ($fundingHistory as $inv): ?>
|
<?php foreach ($fundingHistory as $inv):
|
||||||
|
$investorName = $inv['investor_name'] ?: 'Verified Investor';
|
||||||
|
?>
|
||||||
<div style="display: flex; align-items: center; justify-content: space-between; padding: 20px; background: rgba(255,255,255,0.03); border-radius: 18px; border: 1px solid var(--border-color);">
|
<div style="display: flex; align-items: center; justify-content: space-between; padding: 20px; background: rgba(255,255,255,0.03); border-radius: 18px; border: 1px solid var(--border-color);">
|
||||||
<div style="display: flex; align-items: center; gap: 15px;">
|
<div style="display: flex; align-items: center; gap: 15px;">
|
||||||
<a href="profile.php?id=<?= $inv['investor_user_id'] ?>" style="text-decoration: none;">
|
<?php if ($inv['investor_user_id']): ?>
|
||||||
|
<a href="profile.php?id=<?= $inv['investor_user_id'] ?>" style="text-decoration: none;">
|
||||||
|
<div style="width: 45px; height: 45px; border-radius: 12px; background: var(--surface-color); display: flex; align-items: center; justify-content: center;">
|
||||||
|
<span style="font-weight: 800; color: var(--accent-blue);"><?= substr($investorName, 0, 1) ?></span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
<?php else: ?>
|
||||||
<div style="width: 45px; height: 45px; border-radius: 12px; background: var(--surface-color); display: flex; align-items: center; justify-content: center;">
|
<div style="width: 45px; height: 45px; border-radius: 12px; background: var(--surface-color); display: flex; align-items: center; justify-content: center;">
|
||||||
<span style="font-weight: 800; color: var(--accent-blue);"><?= substr($inv['investor_name'], 0, 1) ?></span>
|
<span style="font-weight: 800; color: var(--accent-blue);"><?= substr($investorName, 0, 1) ?></span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
<?php endif; ?>
|
||||||
<div>
|
<div>
|
||||||
<div style="font-weight: 700;"><a href="profile.php?id=<?= $inv['investor_user_id'] ?>" style="color: inherit; text-decoration: none;"><?= htmlspecialchars($inv['investor_name']) ?></a></div>
|
<div style="font-weight: 700;">
|
||||||
|
<?php if ($inv['investor_user_id']): ?>
|
||||||
|
<a href="profile.php?id=<?= $inv['investor_user_id'] ?>" style="color: inherit; text-decoration: none;"><?= htmlspecialchars($investorName) ?></a>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= htmlspecialchars($investorName) ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
<div style="font-size: 12px; color: var(--text-secondary);"><?= date('M d, Y', strtotime($inv['created_at'])) ?></div>
|
<div style="font-size: 12px; color: var(--text-secondary);"><?= date('M d, Y', strtotime($inv['created_at'])) ?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user