Files
scoutiq/resources/views/admin/opportunities/index.php
2026-06-05 17:47:27 +03:00

143 lines
7.1 KiB
PHP

<div class="page-header">
<div>
<h1>الفرص الاستثمارية</h1>
<p>المنح، المسابقات، الفعاليات، الشراكات وفرص الاستثمار</p>
</div>
</div>
<!-- Filters -->
<div class="filters-bar">
<form method="GET" class="filters-form">
<input type="text" name="search" class="form-control" placeholder="البحث عن الفرص..." value="<?= $this->escape($search) ?>">
<select name="type" class="form-control">
<option value="">جميع الأنواع</option>
<?php foreach ($types as $t_key): ?>
<?php
$trans = [
'grant' => 'المنح',
'competition' => 'المسابقات',
'demo_day' => 'أيام العروض',
'event' => 'الفعاليات',
'partnership' => 'الشراكات',
'investment' => 'الاستثمارات',
'other' => 'أخرى'
];
$transName = $trans[$t_key] ?? ucfirst($t_key);
?>
<option value="<?= $t_key ?>" <?= $type === $t_key ? 'selected' : '' ?>><?= $transName ?></option>
<?php endforeach; ?>
</select>
<select name="status" class="form-control">
<option value="">جميع الحالات</option>
<?php foreach ($statuses as $s_key): ?>
<option value="<?= $s_key ?>" <?= $status === $s_key ? 'selected' : '' ?>><?= $s_key === 'active' ? 'نشط' : ($s_key === 'inactive' ? 'غير نشط' : $s_key) ?></option>
<?php endforeach; ?>
</select>
<button type="submit" class="btn btn-secondary">تصفية</button>
</form>
</div>
<!-- Type Summary -->
<div class="metrics-grid" style="margin-bottom: 20px;">
<div class="glass-panel metric-card">
<span class="metric-title">الإجمالي</span>
<span class="metric-value"><?= $total ?></span>
</div>
<?php foreach ($typeCounts as $t_key => $c): ?>
<?php
$trans = [
'grant' => 'المنح',
'competition' => 'المسابقات',
'demo_day' => 'أيام العروض',
'event' => 'الفعاليات',
'partnership' => 'الشراكات',
'investment' => 'الاستثمارات',
'other' => 'أخرى'
];
$transName = $trans[$t_key] ?? ucfirst($t_key);
?>
<div class="glass-panel metric-card">
<span class="metric-title"><?= $transName ?></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>العنوان</th>
<th>النوع</th>
<th>المصدر/الشركة</th>
<th>التقييم</th>
<th>الحالة</th>
<th>تاريخ الإضافة</th>
<th></th>
</tr>
</thead>
<tbody>
<?php if (empty($opportunities)): ?>
<tr><td colspan="7" style="text-align: center; padding: 40px; color: var(--text-muted);">لا توجد فرص استثمارية حالياً. يرجى تشغيل جامع البيانات أولاً.</td></tr>
<?php else: ?>
<?php foreach ($opportunities as $opp): ?>
<?php
$trans = [
'grant' => 'المنح',
'competition' => 'المسابقات',
'demo_day' => 'أيام العروض',
'event' => 'الفعاليات',
'partnership' => 'الشراكات',
'investment' => 'الاستثمارات',
'other' => 'أخرى',
'vc_funding' => 'تمويل رأس مال جريء',
'accelerator' => 'مسرعة أعمال',
'incubator' => 'حاضنة أعمال'
];
$transType = $trans[$opp['type']] ?? $opp['type'];
?>
<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($transType) ?></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'] ?>/100</span></td>
<td><?= $opp['status'] === 'active' ? 'نشط' : 'غير نشط' ?></td>
<td><?= date('Y-m-d', strtotime($opp['created_at'])) ?></td>
<td><a href="<?= $this->escape($opp['url']) ?>" target="_blank" class="btn btn-sm btn-secondary">فتح</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; }
.badge-type-vc_funding { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.badge-type-accelerator { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.badge-type-incubator { background: rgba(52, 211, 153, 0.2); color: #34d399; }
</style>