-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_badges.php
More file actions
34 lines (28 loc) · 971 Bytes
/
Copy pathtest_badges.php
File metadata and controls
34 lines (28 loc) · 971 Bytes
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
<?php
// Simple test script to check badge functionality
echo "Testing badge functionality...\n";
// Try to include the bootstrap
@include 'app/bootstrap.php';
if (class_exists('Database')) {
echo "Database class loaded successfully\n";
$db = new Database();
$db->query('SELECT COUNT(*) as count FROM badges WHERE status = "active"');
$result = $db->single();
if ($result) {
echo "Found " . $result->count . " active badges in database\n";
if ($result->count > 0) {
$db->query('SELECT id, name, icon FROM badges WHERE status = "active" LIMIT 3');
$badges = $db->resultSet();
echo "Sample badges:\n";
foreach ($badges as $badge) {
echo " ID: {$badge->id}, Name: {$badge->name}, Icon: {$badge->icon}\n";
}
}
} else {
echo "Could not query badges\n";
}
} else {
echo "Database class not loaded\n";
}
echo "Test completed\n";
?>