135 lines
5.8 KiB
PHP
Executable File
135 lines
5.8 KiB
PHP
Executable File
<?php
|
|
error_reporting(E_ALL);
|
|
try {
|
|
$pdo = new PDO("pgsql:host=localhost;dbname=adx_system", "admin", "admin123");
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
} catch(Exception $e) {
|
|
die("DB Error: " . $e->getMessage());
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>KPI Dashboard - WEVAL</title>
|
|
<meta charset="UTF-8">
|
|
<style>
|
|
body{font-family:Arial,sans-serif;background:#0a0a1a;color:#fff;padding:20px;margin:0}
|
|
h1{color:#00d4ff;margin-bottom:20px}
|
|
h2{color:#4ade80;margin:30px 0 15px;font-size:1.2em}
|
|
table{width:100%;border-collapse:collapse;margin-bottom:20px;background:#16213e;border-radius:8px;overflow:hidden}
|
|
th,td{padding:12px 15px;text-align:left;border-bottom:1px solid #2a2a5e}
|
|
th{background:#0f3460;color:#00d4ff;font-weight:500}
|
|
tr:hover{background:#1a1a4e}
|
|
.stat{display:inline-block;background:#16213e;padding:20px 30px;border-radius:10px;margin:10px;text-align:center;border:1px solid #2a2a5e}
|
|
.stat-value{font-size:2em;color:#00d4ff;font-weight:bold}
|
|
.stat-label{color:#888;font-size:0.9em;margin-top:5px}
|
|
.status-active,.status-validated{color:#4ade80}
|
|
.status-testing{color:#ffa500}
|
|
.status-failed{color:#ff4757}
|
|
.targets{font-size:0.85em;color:#888}
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
<h1>📊 KPI Dashboard</h1>
|
|
|
|
<!-- Quick Stats -->
|
|
<div>
|
|
<?php
|
|
$stats = [
|
|
'O365 Accounts' => $pdo->query("SELECT COUNT(*) FROM admin.office_accounts WHERE status = 'Active'")->fetchColumn(),
|
|
'Seeds' => $pdo->query("SELECT COUNT(*) FROM admin.brain_seeds WHERE is_active = true")->fetchColumn(),
|
|
'Procedures' => $pdo->query("SELECT COUNT(*) FROM admin.sending_procedures")->fetchColumn(),
|
|
'Combos' => $pdo->query("SELECT COUNT(*) FROM admin.discovered_combos")->fetchColumn(),
|
|
'Domains' => $pdo->query("SELECT COUNT(*) FROM admin.domain_pool WHERE status = 'active'")->fetchColumn(),
|
|
];
|
|
foreach($stats as $label => $value): ?>
|
|
<div class="stat">
|
|
<div class="stat-value"><?=number_format($value)?></div>
|
|
<div class="stat-label"><?=$label?></div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<h2>🎯 ISP Sending Procedures</h2>
|
|
<table>
|
|
<tr><th>ISP</th><th>Method</th><th>Country</th><th>Volume/Server</th><th>Filter</th><th>Status</th></tr>
|
|
<?php
|
|
// Adapter selon les vraies colonnes - essayer plusieurs variantes
|
|
try {
|
|
$rows = $pdo->query("SELECT * FROM admin.sending_procedures ORDER BY id LIMIT 20");
|
|
foreach($rows as $r):
|
|
// Gérer les différents noms de colonnes possibles
|
|
$isp = $r['isp'] ?? $r['isp_name'] ?? $r['target_isp'] ?? 'N/A';
|
|
$method = $r['method_type'] ?? $r['method'] ?? 'N/A';
|
|
$country = $r['country_code'] ?? $r['country'] ?? '-';
|
|
$volume = $r['volume_per_server'] ?? $r['volume'] ?? $r['daily_volume'] ?? 0;
|
|
$filter = $r['filter_provider'] ?? $r['spam_filter'] ?? '-';
|
|
$status = $r['status'] ?? 'active';
|
|
?>
|
|
<tr>
|
|
<td><strong><?=htmlspecialchars($isp)?></strong></td>
|
|
<td><?=htmlspecialchars($method)?></td>
|
|
<td><?=htmlspecialchars($country)?></td>
|
|
<td><?=number_format($volume)?></td>
|
|
<td><?=htmlspecialchars($filter)?></td>
|
|
<td class="status-<?=$status?>"><?=$status?></td>
|
|
</tr>
|
|
<?php endforeach;
|
|
} catch(Exception $e) {
|
|
echo "<tr><td colspan='6'>Error: ".$e->getMessage()."</td></tr>";
|
|
}
|
|
?>
|
|
</table>
|
|
|
|
<h2>🔍 Discovered Combos</h2>
|
|
<table>
|
|
<tr><th>Domain</th><th>Type</th><th>SPF</th><th>Targets</th><th>Score</th><th>Status</th></tr>
|
|
<?php
|
|
try {
|
|
$rows = $pdo->query("SELECT domain, combo_type, spf_record, target_isps, discovery_score, status FROM admin.discovered_combos ORDER BY discovery_score DESC");
|
|
foreach($rows as $r):
|
|
$targets = is_array($r['target_isps']) ? $r['target_isps'] :
|
|
(is_string($r['target_isps']) ? explode(',', trim($r['target_isps'], '{}')) : []);
|
|
?>
|
|
<tr>
|
|
<td><strong><?=htmlspecialchars($r['domain'])?></strong></td>
|
|
<td><?=htmlspecialchars($r['combo_type'])?></td>
|
|
<td><small><?=htmlspecialchars(substr($r['spf_record'] ?? '', 0, 50))?>...</small></td>
|
|
<td class="targets"><?=implode(', ', $targets)?></td>
|
|
<td><strong><?=$r['discovery_score']?></strong></td>
|
|
<td class="status-<?=$r['status']?>"><?=$r['status']?></td>
|
|
</tr>
|
|
<?php endforeach;
|
|
} catch(Exception $e) {
|
|
echo "<tr><td colspan='6'>Error: ".$e->getMessage()."</td></tr>";
|
|
}
|
|
?>
|
|
</table>
|
|
|
|
<h2>📡 Filter Providers</h2>
|
|
<table>
|
|
<tr><th>Provider</th><th>Strictness</th><th>ISPs Using</th></tr>
|
|
<?php
|
|
try {
|
|
$rows = $pdo->query("SELECT * FROM admin.filter_providers ORDER BY strictness_level DESC LIMIT 10");
|
|
foreach($rows as $r): ?>
|
|
<tr>
|
|
<td><strong><?=htmlspecialchars($r['provider_name'] ?? $r['name'] ?? 'N/A')?></strong></td>
|
|
<td><?=$r['strictness_level'] ?? $r['strictness'] ?? '-'?>/10</td>
|
|
<td class="targets"><?=htmlspecialchars($r['description'] ?? '')?></td>
|
|
</tr>
|
|
<?php endforeach;
|
|
} catch(Exception $e) {
|
|
echo "<tr><td colspan='3'>Error: ".$e->getMessage()."</td></tr>";
|
|
}
|
|
?>
|
|
</table>
|
|
|
|
<p style="color:#666;margin-top:30px;font-size:0.85em">
|
|
Server: <?=gethostname()?> | Updated: <?=date('Y-m-d H:i:s')?>
|
|
</p>
|
|
|
|
</body>
|
|
</html>
|