101 lines
4.8 KiB
PHP
101 lines
4.8 KiB
PHP
<div class="page-header">
|
|
<div>
|
|
<h1>Opportunities</h1>
|
|
<p>Grants, competitions, events, partnerships and investment opportunities</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filters -->
|
|
<div class="filters-bar">
|
|
<form method="GET" class="filters-form">
|
|
<input type="text" name="search" class="form-control" placeholder="Search opportunities..." value="<?= $this->escape($search) ?>">
|
|
<select name="type" class="form-control">
|
|
<option value="">All Types</option>
|
|
<?php foreach ($types as $t): ?>
|
|
<option value="<?= $t ?>" <?= $type === $t ? 'selected' : '' ?>><?= ucfirst($t) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<select name="status" class="form-control">
|
|
<option value="">All Statuses</option>
|
|
<?php foreach ($statuses as $s): ?>
|
|
<option value="<?= $s ?>" <?= $status === $s ? 'selected' : '' ?>><?= ucfirst($s) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<button type="submit" class="btn btn-secondary">Filter</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Type Summary -->
|
|
<div class="metrics-grid" style="margin-bottom: 20px;">
|
|
<div class="glass-panel metric-card">
|
|
<span class="metric-title">Total</span>
|
|
<span class="metric-value"><?= $total ?></span>
|
|
</div>
|
|
<?php foreach ($typeCounts as $t => $c): ?>
|
|
<div class="glass-panel metric-card">
|
|
<span class="metric-title"><?= ucfirst($t) ?></span>
|
|
<span class="metric-value"><?= $c ?></span>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<!-- Table -->
|
|
<div class="glass-panel" style="overflow-x: auto;">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Type</th>
|
|
<th>Source</th>
|
|
<th>Score</th>
|
|
<th>Status</th>
|
|
<th>Created</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (empty($opportunities)): ?>
|
|
<tr><td colspan="7" style="text-align: center; padding: 40px; color: var(--text-muted);">No opportunities yet. Run the collector first.</td></tr>
|
|
<?php else: ?>
|
|
<?php foreach ($opportunities as $opp): ?>
|
|
<tr>
|
|
<td>
|
|
<a href="/admin/opportunities/<?= $opp['id'] ?>" style="font-weight: 600;"><?= $this->escape(mb_substr($opp['title'], 0, 60)) ?></a>
|
|
<?php if ($opp['tag_names']): ?>
|
|
<br><small style="color: var(--text-muted);"><?= $this->escape(implode(', ', explode(',', $opp['tag_names']))) ?></small>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><span class="badge badge-type-<?= $opp['type'] ?>"><?= $this->escape($opp['type']) ?></span></td>
|
|
<td><?= $opp['org_name'] ? $this->escape($opp['org_name']) : '-' ?></td>
|
|
<td><span class="badge" style="background: rgba(251, 191, 36, 0.2); color: #fbbf24;"><?= $opp['score'] ?></span></td>
|
|
<td><?= $this->escape($opp['status']) ?></td>
|
|
<td><?= date('M j', strtotime($opp['created_at'])) ?></td>
|
|
<td><a href="<?= $this->escape($opp['url']) ?>" target="_blank" class="btn btn-sm btn-secondary">Open</a></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<?php if ($total > $perPage): ?>
|
|
<div class="pagination">
|
|
<?php for ($i = 1; $i <= ceil($total / $perPage); $i++): ?>
|
|
<a href="?page=<?= $i ?>&type=<?= $type ?>&status=<?= $status ?>&search=<?= urlencode($search) ?>" class="btn btn-sm <?= $i === $page ? 'btn-primary' : 'btn-secondary' ?>"><?= $i ?></a>
|
|
<?php endfor; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<style>
|
|
.data-table { width: 100%; border-collapse: collapse; }
|
|
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
|
|
.data-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
|
|
.data-table tr:hover { background: rgba(255,255,255,0.02); }
|
|
.badge-type-grant { background: rgba(52, 211, 153, 0.2); color: #34d399; }
|
|
.badge-type-competition { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
|
|
.badge-type-investment { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
|
|
.badge-type-event { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
|
|
.badge-type-demo_day { background: rgba(248, 113, 113, 0.2); color: #f87171; }
|
|
.badge-type-partnership { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
|
|
</style>
|