v27
This commit is contained in:
parent
d9eba63b0d
commit
096a24971d
6
db/migrations/11_startup_financials.sql
Normal file
6
db/migrations/11_startup_financials.sql
Normal file
@ -0,0 +1,6 @@
|
||||
-- Migration: Add financial and return rate fields to startups table
|
||||
ALTER TABLE startups
|
||||
ADD COLUMN equity_structure TEXT AFTER description,
|
||||
ADD COLUMN financial_doc_path VARCHAR(255) AFTER industry,
|
||||
ADD COLUMN recommended_return_rate DECIMAL(5, 2) AFTER followers_count,
|
||||
ADD COLUMN founder_return_rate DECIMAL(5, 2) AFTER recommended_return_rate;
|
||||
@ -6,6 +6,7 @@ if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'founder') {
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
require_once __DIR__ . '/ai/LocalAIApi.php';
|
||||
|
||||
$error = '';
|
||||
$success = '';
|
||||
@ -35,37 +36,90 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$name = trim($_POST['name'] ?? '');
|
||||
$description = trim($_POST['description'] ?? '');
|
||||
$industry = trim($_POST['industry'] ?? '');
|
||||
$equity_structure = trim($_POST['equity_structure'] ?? '');
|
||||
$target = (float)($_POST['funding_target'] ?? 0);
|
||||
$status = $_POST['status'] ?? 'public';
|
||||
$founder_return_rate = isset($_POST['founder_return_rate']) && $_POST['founder_return_rate'] !== '' ? (float)$_POST['founder_return_rate'] : null;
|
||||
|
||||
if ((!$existingStartup && (empty($name) || empty($description) || empty($industry))) || $target < 50) {
|
||||
$error = "Please fill in all required fields. Minimum target is £50.";
|
||||
} else {
|
||||
db()->beginTransaction();
|
||||
try {
|
||||
if ($existingStartup) {
|
||||
// Just create a new round for existing startup
|
||||
$stmt = db()->prepare("INSERT INTO funding_rounds (startup_id, funding_goal, status) VALUES (?, ?, 'Active')");
|
||||
$stmt->execute([$existingStartup['id'], $target]);
|
||||
$final_id = $existingStartup['id'];
|
||||
} else {
|
||||
// 1. Insert startup
|
||||
$stmt = db()->prepare("INSERT INTO startups (name, description, industry, founder_id, funding_target, status) VALUES (?, ?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$name, $description, $industry, $_SESSION['user_id'], $target, $status]);
|
||||
$new_startup_id = db()->lastInsertId();
|
||||
|
||||
// 2. Insert initial funding round
|
||||
$stmt = db()->prepare("INSERT INTO funding_rounds (startup_id, funding_goal, status) VALUES (?, ?, 'Active')");
|
||||
$stmt->execute([$new_startup_id, $target]);
|
||||
$final_id = $new_startup_id;
|
||||
}
|
||||
// Financial Document Upload
|
||||
$financial_doc_path = '';
|
||||
if (isset($_FILES['financial_doc']) && $_FILES['financial_doc']['error'] === UPLOAD_ERR_OK) {
|
||||
$upload_dir = 'assets/docs/financials/';
|
||||
if (!is_dir($upload_dir)) {
|
||||
mkdir($upload_dir, 0775, true);
|
||||
}
|
||||
$file_ext = pathinfo($_FILES['financial_doc']['name'], PATHINFO_EXTENSION);
|
||||
$file_name = uniqid('fin_', true) . '.' . $file_ext;
|
||||
$dest_path = $upload_dir . $file_name;
|
||||
|
||||
if (move_uploaded_file($_FILES['financial_doc']['tmp_name'], $dest_path)) {
|
||||
$financial_doc_path = $dest_path;
|
||||
} else {
|
||||
$error = "Failed to upload financial documentation.";
|
||||
}
|
||||
} elseif (!$existingStartup) {
|
||||
$error = "Financial documentation is mandatory for new startups.";
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if ((!$existingStartup && (empty($name) || empty($description) || empty($industry) || empty($equity_structure) || empty($financial_doc_path))) || $target < 50) {
|
||||
$error = "Please fill in all required fields and upload financial documents. Minimum target is £50.";
|
||||
} else {
|
||||
// AI Calculation for Recommended Return Rate
|
||||
$recommended_return_rate = 5.0; // Default fallback
|
||||
|
||||
db()->commit();
|
||||
$success = "Funding round is now active!";
|
||||
header("refresh:2;url=startup_details.php?id=" . $final_id);
|
||||
} catch (PDOException $e) {
|
||||
db()->rollBack();
|
||||
$error = "Database error: " . $e->getMessage();
|
||||
$prompt = "As a financial analyst for a startup investment platform, calculate a recommended annual dividend yield (interest percentage) for the following startup.
|
||||
Startup Name: {$name}
|
||||
Industry: {$industry}
|
||||
Description: {$description}
|
||||
Funding Target: £{$target}
|
||||
Equity Structure: {$equity_structure}
|
||||
|
||||
Respond ONLY with a JSON object containing a single key 'recommended_rate' with a numeric value (percentage). Example: {\"recommended_rate\": 8.5}";
|
||||
|
||||
$aiResponse = LocalAIApi::createResponse([
|
||||
'input' => [['role' => 'system', 'content' => 'You are a professional financial analyst. Return JSON only.'],
|
||||
['role' => 'user', 'content' => $prompt],
|
||||
],
|
||||
]);
|
||||
|
||||
if (!empty($aiResponse['success'])) {
|
||||
$decoded = LocalAIApi::decodeJsonFromResponse($aiResponse);
|
||||
if (isset($decoded['recommended_rate'])) {
|
||||
$recommended_return_rate = (float)$decoded['recommended_rate'];
|
||||
}
|
||||
}
|
||||
|
||||
db()->beginTransaction();
|
||||
try {
|
||||
if ($existingStartup) {
|
||||
// Update existing startup with new return rates if provided
|
||||
$stmt = db()->prepare("UPDATE startups SET recommended_return_rate = ?, founder_return_rate = ? WHERE id = ?");
|
||||
$stmt->execute([$recommended_return_rate, $founder_return_rate, $existingStartup['id']]);
|
||||
|
||||
// Create a new round
|
||||
$stmt = db()->prepare("INSERT INTO funding_rounds (startup_id, funding_goal, status) VALUES (?, ?, 'Active')");
|
||||
$stmt->execute([$existingStartup['id'], $target]);
|
||||
$final_id = $existingStartup['id'];
|
||||
} else {
|
||||
// 1. Insert startup with new fields
|
||||
$stmt = db()->prepare("INSERT INTO startups (name, description, industry, equity_structure, financial_doc_path, founder_id, funding_target, status, recommended_return_rate, founder_return_rate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$name, $description, $industry, $equity_structure, $financial_doc_path, $_SESSION['user_id'], $target, $status, $recommended_return_rate, $founder_return_rate]);
|
||||
$new_startup_id = db()->lastInsertId();
|
||||
|
||||
// 2. Insert initial funding round
|
||||
$stmt = db()->prepare("INSERT INTO funding_rounds (startup_id, funding_goal, status) VALUES (?, ?, 'Active')");
|
||||
$stmt->execute([$new_startup_id, $target]);
|
||||
$final_id = $new_startup_id;
|
||||
}
|
||||
|
||||
db()->commit();
|
||||
$success = "Startup successfully listed with a recommended return rate of " . number_format($recommended_return_rate, 2) . "%!";
|
||||
header("refresh:3;url=startup_details.php?id=" . $final_id);
|
||||
} catch (PDOException $e) {
|
||||
db()->rollBack();
|
||||
$error = "Database error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -77,55 +131,70 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= $existingStartup ? 'Start New Round' : 'Start Funding Round' ?> — <?= htmlspecialchars($platformName) ?></title>
|
||||
<title><?= $existingStartup ? 'Start New Round' : 'Launch Startup' ?> — <?= 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 style="display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 20px;">
|
||||
|
||||
<div class="card" style="width: 100%; max-width: 600px;">
|
||||
<h2 style="margin-bottom: 10px;"><?= $existingStartup ? 'Start New Round for ' . htmlspecialchars($existingStartup['name']) : 'List Your Startup' ?></h2>
|
||||
<div class="card" style="width: 100%; max-width: 650px;">
|
||||
<h2 style="margin-bottom: 10px;"><?= $existingStartup ? 'Start New Round for ' . htmlspecialchars($existingStartup['name']) : 'Launch Your Startup' ?></h2>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 30px;">
|
||||
<?= $existingStartup ? 'Set a new funding goal for your existing venture.' : 'Kickstart your project with micro-investments from peers.' ?>
|
||||
<?= $existingStartup ? 'Update your funding goal and return rates.' : 'Complete the form below to list your startup and receive a platform-calculated return rate recommendation.' ?>
|
||||
</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div style="background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); color: #ff5555; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($error) ?>
|
||||
<i class="fas fa-exclamation-circle" style="margin-right: 8px;"></i> <?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($success): ?>
|
||||
<div style="background: rgba(0, 255, 0, 0.1); border: 1px solid rgba(0, 255, 0, 0.3); color: #55ff55; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($success) ?>
|
||||
<i class="fas fa-check-circle" style="margin-right: 8px;"></i> <?= htmlspecialchars($success) ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<form method="POST">
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
<?php if (!$existingStartup): ?>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Startup Name</label>
|
||||
<input type="text" name="name" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Startup Name *</label>
|
||||
<input type="text" name="name" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Industry *</label>
|
||||
<select name="industry" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<option value="">Select Industry</option>
|
||||
<option value="Fintech">Fintech</option>
|
||||
<option value="Healthtech">Healthtech</option>
|
||||
<option value="Edtech">Edtech</option>
|
||||
<option value="E-commerce">E-commerce</option>
|
||||
<option value="SaaS">SaaS</option>
|
||||
<option value="Clean Energy">Clean Energy</option>
|
||||
<option value="AI & Robotics">AI & Robotics</option>
|
||||
<option value="Other">Other</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Industry</label>
|
||||
<select name="industry" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<option value="">Select Industry</option>
|
||||
<option value="Fintech">Fintech</option>
|
||||
<option value="Healthtech">Healthtech</option>
|
||||
<option value="Edtech">Edtech</option>
|
||||
<option value="E-commerce">E-commerce</option>
|
||||
<option value="SaaS">SaaS</option>
|
||||
<option value="Clean Energy">Clean Energy</option>
|
||||
<option value="AI & Robotics">AI & Robotics</option>
|
||||
<option value="Other">Other</option>
|
||||
</select>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Description *</label>
|
||||
<textarea name="description" placeholder="What does your startup do?" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 100px; resize: none;"></textarea>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Description</label>
|
||||
<textarea name="description" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 120px; resize: none;"></textarea>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Equity Structure *</label>
|
||||
<textarea name="equity_structure" placeholder="Explain the distribution of ownership..." required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 80px; resize: none;"></textarea>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px;">
|
||||
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Financial Documentation * (PDF, Images)</label>
|
||||
<input type="file" name="financial_doc" required accept=".pdf,image/*" style="width: 100%; padding: 10px; border-radius: 12px; background: var(--surface-color); border: 1px dashed var(--border-color); color: #fff;">
|
||||
<span style="font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: block;">Upload revenue statements, projections, or balance sheets.</span>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Listing Type</label>
|
||||
<select name="status" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<option value="public">Public (Visible to all investors)</option>
|
||||
@ -134,17 +203,24 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Funding Target (£)</label>
|
||||
<input type="number" name="funding_target" min="50" step="50" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<span style="font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: block;">Min investment per user will be £50.</span>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px;">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Funding Target (£) *</label>
|
||||
<input type="number" name="funding_target" min="50" step="50" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Proposed Dividend (%) (Optional)</label>
|
||||
<input type="number" name="founder_return_rate" min="0" max="100" step="0.1" placeholder="e.g. 8.5" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;"><?= $existingStartup ? 'Launch New Round' : 'Launch Funding Round' ?></button>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px; font-weight: 600; font-size: 16px;">
|
||||
<i class="fas fa-rocket" style="margin-right: 8px;"></i> <?= $existingStartup ? 'Launch New Round' : 'Launch Startup' ?>
|
||||
</button>
|
||||
<a href="<?= $existingStartup ? 'startup_details.php?id=' . $startup_id : 'dashboard.php' ?>" class="btn btn-secondary" style="width: 100%; padding: 15px; margin-top: 10px; display: block; text-align: center; text-decoration: none;">Cancel</a>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@ -75,7 +75,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
|
||||
$title = $_POST['update_title'] ?? '';
|
||||
$content = $_POST['update_content'] ?? '';
|
||||
if ($title && $content) {
|
||||
// FIX: Added founder_id to the query to avoid 500 error
|
||||
$stmt = db()->prepare("INSERT INTO startup_updates (startup_id, founder_id, title, content) VALUES (?, ?, ?, ?)");
|
||||
$stmt->execute([$startup_id, $user_id, $title, $content]);
|
||||
|
||||
@ -99,21 +98,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
|
||||
} elseif ($_POST['action'] === 'cancel_round' && $user['role'] === 'founder' && $startup['founder_id'] == $user_id) {
|
||||
db()->beginTransaction();
|
||||
try {
|
||||
// Find active round
|
||||
$stmt = db()->prepare("SELECT id FROM funding_rounds WHERE startup_id = ? AND status = 'Active'");
|
||||
$stmt->execute([$startup_id]);
|
||||
$round = $stmt->fetch();
|
||||
|
||||
if ($round) {
|
||||
// Cancel round
|
||||
$stmt = db()->prepare("UPDATE funding_rounds SET status = 'Cancelled' WHERE id = ?");
|
||||
$stmt->execute([$round['id']]);
|
||||
|
||||
// Refund all investments in this round
|
||||
$stmt = db()->prepare("UPDATE investments SET status = 'Refunded' WHERE funding_round_id = ?");
|
||||
$stmt->execute([$round['id']]);
|
||||
|
||||
// Deduct from startup total raised
|
||||
$stmt = db()->prepare("SELECT SUM(amount) as total FROM investments WHERE funding_round_id = ? AND status = 'Refunded'");
|
||||
$stmt->execute([$round['id']]);
|
||||
$totalRefunded = $stmt->fetch()['total'] ?? 0;
|
||||
@ -124,7 +119,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
|
||||
db()->commit();
|
||||
$success = "Funding round cancelled and all investments marked for refund.";
|
||||
|
||||
// Refresh data
|
||||
$stmt = db()->prepare("SELECT * FROM startups WHERE id = ?");
|
||||
$stmt->execute([$startup_id]);
|
||||
$startup = $stmt->fetch();
|
||||
@ -143,10 +137,8 @@ $stmt = db()->prepare("SELECT * FROM funding_rounds WHERE startup_id = ? AND sta
|
||||
$stmt->execute([$startup_id]);
|
||||
$activeRound = $stmt->fetch();
|
||||
|
||||
// Permission check for Funding History: Founders see their own, Investors see all.
|
||||
$canSeeHistory = ($user['role'] === 'investor' || ($user['role'] === 'founder' && $startup['founder_id'] == $user_id));
|
||||
|
||||
// Fetch Funding History
|
||||
$fundingHistory = [];
|
||||
if ($canSeeHistory) {
|
||||
$stmt = db()->prepare("
|
||||
@ -224,6 +216,7 @@ if ($canSeeHistory) {
|
||||
<div style="flex: 1;">
|
||||
<h1 style="margin: 0; font-size: 36px;"><?= htmlspecialchars($startup['name']) ?></h1>
|
||||
<div style="color: var(--text-secondary); display: flex; align-items: center; gap: 10px;">
|
||||
<span><i class="fas fa-industry"></i> <?= htmlspecialchars($startup['industry'] ?? 'General') ?></span>
|
||||
<span><i class="fas fa-calendar-alt"></i> Founded <?= date('M Y', strtotime($startup['created_at'])) ?></span>
|
||||
<span class="badge" style="background: var(--accent-blue); color: #000; padding: 4px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; text-transform: uppercase;"><?= ucfirst($startup['status']) ?></span>
|
||||
</div>
|
||||
@ -246,6 +239,34 @@ if ($canSeeHistory) {
|
||||
<p style="font-size: 18px; line-height: 1.6; color: var(--text-secondary); white-space: pre-wrap;"><?= htmlspecialchars($startup['description']) ?></p>
|
||||
</section>
|
||||
|
||||
<?php if ($startup['equity_structure']): ?>
|
||||
<section class="card" style="margin-bottom: 40px;">
|
||||
<h2 style="margin-top: 0; margin-bottom: 20px;"><i class="fas fa-chart-pie" style="color: var(--accent-blue);"></i> Equity Structure</h2>
|
||||
<p style="font-size: 16px; line-height: 1.6; color: var(--text-secondary); white-space: pre-wrap;"><?= htmlspecialchars($startup['equity_structure']) ?></p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Return Rates Comparison -->
|
||||
<section class="card" style="margin-bottom: 40px; background: rgba(0, 242, 255, 0.03); border: 1px solid var(--accent-blue);">
|
||||
<h2 style="margin-top: 0; margin-bottom: 25px; display: flex; align-items: center; gap: 12px;">
|
||||
<i class="fas fa-percentage" style="color: var(--accent-blue);"></i> Expected Investor Returns
|
||||
</h2>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||
<div style="padding: 20px; background: rgba(0,0,0,0.2); border-radius: 16px; border: 1px solid var(--border-color); text-align: center;">
|
||||
<div style="font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;">Platform Recommendation</div>
|
||||
<div style="font-size: 32px; font-weight: 900; color: var(--accent-blue);"><?= number_format($startup['recommended_return_rate'] ?? 5.0, 1) ?>%</div>
|
||||
<div style="font-size: 11px; color: var(--text-secondary); margin-top: 5px;">Based on financial analysis & industry benchmarks</div>
|
||||
</div>
|
||||
<div style="padding: 20px; background: rgba(0,0,0,0.2); border-radius: 16px; border: 1px solid var(--border-color); text-align: center;">
|
||||
<div style="font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;">Founder's Proposal</div>
|
||||
<div style="font-size: 32px; font-weight: 900; color: #fff;">
|
||||
<?= $startup['founder_return_rate'] !== null ? number_format($startup['founder_return_rate'], 1) . '%' : 'N/A' ?>
|
||||
</div>
|
||||
<div style="font-size: 11px; color: var(--text-secondary); margin-top: 5px;">Target annual dividend yield set by founder</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Funding History Section -->
|
||||
<?php if ($canSeeHistory): ?>
|
||||
<section class="card" style="margin-bottom: 40px;">
|
||||
@ -359,7 +380,7 @@ if ($canSeeHistory) {
|
||||
<div style="font-size: 13px; color: var(--text-secondary);">Total Raised All-Time</div>
|
||||
</div>
|
||||
<div style="height: 1px; background: var(--border-color); margin: 20px 0;"></div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
||||
<div>
|
||||
<div style="font-weight: 700;"><?= count($fundingHistory) ?></div>
|
||||
<div style="font-size: 11px; color: var(--text-secondary);">Investments</div>
|
||||
@ -373,6 +394,12 @@ if ($canSeeHistory) {
|
||||
<div style="font-size: 11px; color: var(--text-secondary);">Stage</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($startup['financial_doc_path']): ?>
|
||||
<a href="<?= htmlspecialchars($startup['financial_doc_path']) ?>" target="_blank" class="btn btn-secondary" style="width: 100%; padding: 12px; font-size: 14px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 10px;">
|
||||
<i class="fas fa-file-invoice-dollar"></i> View Financial Docs
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<?php if ($activeRound): ?>
|
||||
@ -434,11 +461,11 @@ if ($canSeeHistory) {
|
||||
?>
|
||||
<div style="display: flex; align-items: center; gap: 15px; margin-top: 20px;">
|
||||
<div style="width: 50px; height: 50px; background: var(--surface-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #fff; border: 2px solid var(--accent-blue);">
|
||||
<?= substr($founder['full_name'], 0, 1) ?>
|
||||
<?= substr($founder['full_name'] ?? 'U', 0, 1) ?>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-weight: 700;"><?= htmlspecialchars($founder['full_name'] ?? 'Founder') ?></div>
|
||||
<div style="font-size: 13px; color: var(--text-secondary);"><?= htmlspecialchars($founder['university'] ?? 'Founder') ?></div>
|
||||
<div style="font-size: 13px; color: var(--text-secondary);"><?= htmlspecialchars($founder['university'] ?? 'University') ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="messages.php?chat_with=<?= $founder['id'] ?>" class="btn btn-secondary" style="width: 100%; margin-top: 20px; padding: 12px; border-radius: 12px;">Send Message</a>
|
||||
@ -459,4 +486,4 @@ if ($canSeeHistory) {
|
||||
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user