forked from Scorpio-4488/Ethos_Product_Development
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
144 lines (134 loc) · 6.78 KB
/
Copy pathindex.php
File metadata and controls
144 lines (134 loc) · 6.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
session_start();
require_once 'config/database.php';
require_once 'models/Entity.php';
$database = new Database();
$db = $database->getConnection();
$entity = new Entity($db);
// Get dashboard stats (simplified for performance)
$stats = $entity->getDashboardStats();
// Get recent entities (limited for performance)
$recentEntities = $entity->getAll(10, 0);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Campus Entity Resolution System</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body class="bg-gray-100">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
<h1 class="text-3xl font-bold text-gray-800 mb-2">Campus Entity Resolution System</h1>
<p class="text-gray-600">Cross-source entity tracking and security monitoring</p>
</div>
<!-- Stats -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 bg-blue-100 rounded-lg">
<i class="fas fa-users text-blue-600 text-xl"></i>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">Total Entities</h3>
<p class="text-2xl font-bold text-gray-900"><?= number_format($stats['total_entities']) ?></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 bg-green-100 rounded-lg">
<i class="fas fa-user-check text-green-600 text-xl"></i>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">Active (7 days)</h3>
<p class="text-2xl font-bold text-gray-900"><?= number_format($stats['active_today']) ?></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 bg-red-100 rounded-lg">
<i class="fas fa-exclamation-triangle text-red-600 text-xl"></i>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">Potentially Inactive</h3>
<p class="text-2xl font-bold text-gray-900"><?= number_format($stats['inactive_alerts']) ?></p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 bg-purple-100 rounded-lg">
<i class="fas fa-database text-purple-600 text-xl"></i>
</div>
<div class="ml-4">
<h3 class="text-sm font-medium text-gray-500">Data Sources</h3>
<p class="text-2xl font-bold text-gray-900">7</p>
</div>
</div>
</div>
</div>
<!-- Search Section -->
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
<h2 class="text-xl font-bold text-gray-800 mb-4">Entity Search</h2>
<form action="search.php" method="GET" class="flex gap-4">
<div class="flex-1">
<input type="text" name="q" placeholder="Search by ID, name, email, card, device..."
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<div>
<select name="type" class="px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="all">All Types</option>
<option value="student">Students</option>
<option value="staff">Staff</option>
</select>
</div>
<button type="submit" class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
<i class="fas fa-search mr-2"></i>Search
</button>
</form>
</div>
<!-- Quick Actions -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<a href="alerts.php" class="bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow">
<div class="flex items-center justify-between">
<div>
<h3 class="text-lg font-semibold text-gray-800">View All Entities</h3>
<p class="text-gray-600 mt-1">Browse all <?= number_format($stats['total_entities']) ?> entities</p>
</div>
<div class="text-blue-600">
<i class="fas fa-list text-2xl"></i>
</div>
</div>
</a>
<div class="bg-white rounded-lg shadow-md p-6">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Recent Entities</h3>
<div class="space-y-3">
<?php foreach($recentEntities as $entity_item): ?>
<div class="flex items-center justify-between py-2 border-b border-gray-100">
<div>
<p class="font-medium text-gray-800"><?= htmlspecialchars($entity_item['name']) ?></p>
<p class="text-sm text-gray-500"><?= $entity_item['role'] ?> • <?= $entity_item['department'] ?></p>
</div>
<a href="entity.php?id=<?= $entity_item['entity_id'] ?>"
class="px-3 py-1 bg-blue-100 text-blue-600 rounded-full text-sm hover:bg-blue-200 transition-colors">
View
</a>
</div>
<?php endforeach; ?>
</div>
<div class="mt-4 text-center">
<a href="browse.php" class="text-blue-600 hover:text-blue-800 text-sm font-medium">
View All Entities →
</a>
</div>
</div>
</div>
</div>
</body>
</html>