v51
This commit is contained in:
parent
fb4133a854
commit
378fa008c6
@ -79,11 +79,6 @@ if ($user['role'] === 'founder') {
|
|||||||
$myInvestments = $stmt->fetchAll();
|
$myInvestments = $stmt->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch Wallet Transactions
|
|
||||||
$stmt = db()->prepare("SELECT * FROM wallet_transactions WHERE user_id = ? ORDER BY created_at DESC LIMIT 5");
|
|
||||||
$stmt->execute([$_SESSION['user_id']]);
|
|
||||||
$transactions = $stmt->fetchAll();
|
|
||||||
|
|
||||||
function number_get_formatted($num) {
|
function number_get_formatted($num) {
|
||||||
return number_format((float)$num, 0, '.', ',');
|
return number_format((float)$num, 0, '.', ',');
|
||||||
}
|
}
|
||||||
@ -99,31 +94,6 @@ function number_get_formatted($num) {
|
|||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
<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">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
<style>
|
|
||||||
.trending-pill {
|
|
||||||
background: linear-gradient(45deg, #FFD700, #FFA500);
|
|
||||||
color: #000;
|
|
||||||
padding: 4px 12px;
|
|
||||||
border-radius: 50px;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 800;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
.transaction-item {
|
|
||||||
padding: 12px 0;
|
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.transaction-item:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body style="background: #000; color: #fff; font-family: 'Inter', sans-serif;">
|
<body style="background: #000; color: #fff; font-family: 'Inter', sans-serif;">
|
||||||
|
|
||||||
@ -270,28 +240,6 @@ function number_get_formatted($num) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Recent Transactions -->
|
|
||||||
<div style="margin-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px;">
|
|
||||||
<h4 style="font-size: 12px; font-weight: 800; color: #999; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px;">Recent Transactions</h4>
|
|
||||||
<?php if (empty($transactions)): ?>
|
|
||||||
<p style="font-size: 12px; color: var(--text-secondary); text-align: center; opacity: 0.5;">No transactions yet.</p>
|
|
||||||
<?php else: ?>
|
|
||||||
<div id="transaction-list">
|
|
||||||
<?php foreach ($transactions as $tx): ?>
|
|
||||||
<div class="transaction-item">
|
|
||||||
<div>
|
|
||||||
<div style="font-size: 13px; font-weight: 700; color: #fff;"><?= htmlspecialchars($tx['description']) ?></div>
|
|
||||||
<div style="font-size: 11px; color: #666;"><?= date('M d, H:i', strtotime($tx['created_at'])) ?></div>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 14px; font-weight: 900; color: <?= in_array($tx['type'], ['add', 'investment_in']) ? '#4cd964' : '#ff3b30' ?>;">
|
|
||||||
<?= in_array($tx['type'], ['add', 'investment_in']) ? '+' : '-' ?>£<?= number_format($tx['amount'], 2) ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p style="font-size: 11px; color: var(--text-secondary); margin-top: 15px; text-align: center; opacity: 0.6;">
|
<p style="font-size: 11px; color: var(--text-secondary); margin-top: 15px; text-align: center; opacity: 0.6;">
|
||||||
<?php if ($user['role'] === 'founder'): ?>
|
<?php if ($user['role'] === 'founder'): ?>
|
||||||
Manage your startup capital and dividend funds.
|
Manage your startup capital and dividend funds.
|
||||||
@ -401,10 +349,10 @@ document.getElementById('wallet-form').addEventListener('submit', function(e) {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
document.getElementById('wallet-balance').innerText = '£' + parseFloat(data.new_balance).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
const formattedBalance = '£' + parseFloat(data.new_balance).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
||||||
document.getElementById('header-wallet-balance').innerText = '£' + parseFloat(data.new_balance).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
document.getElementById('wallet-balance').innerText = formattedBalance;
|
||||||
|
document.getElementById('header-wallet-balance').innerText = formattedBalance;
|
||||||
closeWalletModal();
|
closeWalletModal();
|
||||||
location.reload(); // Reload to show new transaction
|
|
||||||
} else {
|
} else {
|
||||||
alert('Error: ' + data.error);
|
alert('Error: ' + data.error);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,11 +64,6 @@ if ($isFounder) {
|
|||||||
");
|
");
|
||||||
$stmt->execute([$startupId]);
|
$stmt->execute([$startupId]);
|
||||||
$approvedInvestments = $stmt->fetchAll();
|
$approvedInvestments = $stmt->fetchAll();
|
||||||
|
|
||||||
// Fetch Wallet Transactions for Founder
|
|
||||||
$stmt = db()->prepare("SELECT * FROM wallet_transactions WHERE user_id = ? ORDER BY created_at DESC LIMIT 5");
|
|
||||||
$stmt->execute([$_SESSION['user_id']]);
|
|
||||||
$transactions = $stmt->fetchAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextDividendInfo($investmentDate) {
|
function getNextDividendInfo($investmentDate) {
|
||||||
@ -89,18 +84,6 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
|||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
<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">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
<style>
|
|
||||||
.transaction-item {
|
|
||||||
padding: 12px 0;
|
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.transaction-item:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body style="background: #000; color: #fff; font-family: 'Inter', sans-serif;">
|
<body style="background: #000; color: #fff; font-family: 'Inter', sans-serif;">
|
||||||
|
|
||||||
@ -226,28 +209,6 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Recent Transactions -->
|
|
||||||
<div style="border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px;">
|
|
||||||
<h4 style="font-size: 12px; font-weight: 800; color: #999; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px;">Recent Pot Transactions</h4>
|
|
||||||
<?php if (empty($transactions)): ?>
|
|
||||||
<p style="font-size: 12px; color: var(--text-secondary); text-align: center; opacity: 0.5;">No transactions yet.</p>
|
|
||||||
<?php else: ?>
|
|
||||||
<div id="transaction-list">
|
|
||||||
<?php foreach ($transactions as $tx): ?>
|
|
||||||
<div class="transaction-item">
|
|
||||||
<div>
|
|
||||||
<div style="font-size: 13px; font-weight: 700; color: #fff;"><?= htmlspecialchars($tx['description']) ?></div>
|
|
||||||
<div style="font-size: 11px; color: #666;"><?= date('M d, H:i', strtotime($tx['created_at'])) ?></div>
|
|
||||||
</div>
|
|
||||||
<div style="font-size: 14px; font-weight: 900; color: <?= in_array($tx['type'], ['add', 'investment_in']) ? '#4cd964' : '#ff3b30' ?>;">
|
|
||||||
<?= in_array($tx['type'], ['add', 'investment_in']) ? '+' : '-' ?>£<?= number_format($tx['amount'], 2) ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p style="margin-top: 20px; color: var(--text-secondary); font-size: 13px; opacity: 0.8;">
|
<p style="margin-top: 20px; color: var(--text-secondary); font-size: 13px; opacity: 0.8;">
|
||||||
<i class="fas fa-info-circle"></i> This pot holds all investments received. You can withdraw funds for business operations or add funds to cover investor dividends.
|
<i class="fas fa-info-circle"></i> This pot holds all investments received. You can withdraw funds for business operations or add funds to cover investor dividends.
|
||||||
</p>
|
</p>
|
||||||
@ -460,7 +421,6 @@ document.getElementById('wallet-form').addEventListener('submit', function(e) {
|
|||||||
document.getElementById('startup-wallet-balance').innerText = formattedBalance;
|
document.getElementById('startup-wallet-balance').innerText = formattedBalance;
|
||||||
}
|
}
|
||||||
closeWalletModal();
|
closeWalletModal();
|
||||||
location.reload(); // Reload to show new transaction
|
|
||||||
} else {
|
} else {
|
||||||
alert('Error: ' + data.error);
|
alert('Error: ' + data.error);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user