232 lines
12 KiB
PHP
Executable File
232 lines
12 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* WEVAL - Dashboard Warmup Email
|
|
* Gestion du warmup des comptes Office 365
|
|
*/
|
|
$pdo = new PDO("pgsql:host=localhost;dbname=adx_system", "admin", "admin123");
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
// Stats
|
|
$stats = [
|
|
'total_accounts' => $pdo->query("SELECT COUNT(*) FROM admin.office_accounts")->fetchColumn(),
|
|
'warmup_active' => $pdo->query("SELECT COUNT(*) FROM admin.email_warmup WHERE status IS NOT NULL")->fetchColumn(),
|
|
'warmup_total' => $pdo->query("SELECT COUNT(*) FROM admin.email_warmup")->fetchColumn(),
|
|
];
|
|
|
|
// Ajouter compte au warmup
|
|
$msg = '';
|
|
if ($_POST && isset($_POST['add_warmup'])) {
|
|
$email = $_POST['email'] ?? '';
|
|
$daily = intval($_POST['daily_target'] ?? 50);
|
|
if ($email) {
|
|
$stmt = $pdo->prepare("INSERT INTO admin.email_warmup (email, account_type, daily_target, current_day, emails_sent_today, total_sent, status, created_at) VALUES (?, 'office365', ?, 1, 0, 0, 'active', NOW()) ON CONFLICT DO NOTHING");
|
|
$stmt->execute([$email, $daily]);
|
|
$msg = "✅ Compte ajouté au warmup!";
|
|
}
|
|
}
|
|
|
|
// Liste warmup
|
|
$warmupList = $pdo->query("SELECT * FROM admin.email_warmup ORDER BY id DESC LIMIT 20")->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
// Liste comptes Office disponibles
|
|
$officeAccounts = $pdo->query("SELECT id, admin_email, tenant_domain, status FROM admin.office_accounts WHERE status IS NOT NULL ORDER BY id DESC LIMIT 50")->fetchAll(PDO::FETCH_ASSOC);
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Warmup Dashboard - WEVAL</title>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); min-height: 100vh; color: #e2e8f0; }
|
|
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
|
|
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; padding: 20px; background: rgba(255,255,255,0.05); border-radius: 16px; }
|
|
.header h1 { font-size: 24px; display: flex; align-items: center; gap: 12px; }
|
|
.nav a { padding: 10px 20px; background: rgba(99,102,241,0.2); color: #a5b4fc; text-decoration: none; border-radius: 8px; margin-left: 10px; }
|
|
.nav a:hover { background: rgba(99,102,241,0.4); }
|
|
|
|
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
|
|
.card { background: rgba(255,255,255,0.05); border-radius: 16px; padding: 24px; border: 1px solid rgba(255,255,255,0.1); }
|
|
.card h3 { font-size: 14px; color: #94a3b8; margin-bottom: 16px; text-transform: uppercase; }
|
|
|
|
.stat-row { display: flex; gap: 20px; margin-bottom: 30px; }
|
|
.stat { flex: 1; padding: 24px; background: rgba(255,255,255,0.05); border-radius: 16px; text-align: center; }
|
|
.stat .value { font-size: 42px; font-weight: 700; }
|
|
.stat .value.purple { color: #a78bfa; }
|
|
.stat .value.green { color: #34d399; }
|
|
.stat .value.cyan { color: #22d3ee; }
|
|
.stat .label { color: #64748b; font-size: 13px; margin-top: 8px; }
|
|
|
|
.form-row { display: flex; gap: 12px; margin-bottom: 16px; }
|
|
.form-row input, .form-row select { flex: 1; padding: 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #e2e8f0; }
|
|
.btn { padding: 12px 24px; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
|
|
.btn:hover { opacity: 0.9; }
|
|
.btn-sm { padding: 8px 16px; font-size: 12px; }
|
|
|
|
table { width: 100%; border-collapse: collapse; }
|
|
th, td { padding: 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1); }
|
|
th { color: #94a3b8; font-size: 12px; text-transform: uppercase; }
|
|
.badge { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
|
|
.badge.active { background: rgba(52,211,153,0.2); color: #34d399; }
|
|
.badge.paused { background: rgba(251,191,36,0.2); color: #fbbf24; }
|
|
.badge.completed { background: rgba(99,102,241,0.2); color: #a5b4fc; }
|
|
|
|
.progress { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
|
|
.progress-bar { height: 100%; background: linear-gradient(90deg, #8b5cf6, #06b6d4); border-radius: 4px; }
|
|
|
|
.msg { padding: 12px 20px; background: rgba(52,211,153,0.2); border-radius: 8px; color: #34d399; margin-bottom: 20px; }
|
|
|
|
.warmup-plan { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 16px; }
|
|
.day { padding: 12px 8px; background: rgba(255,255,255,0.03); border-radius: 8px; text-align: center; font-size: 11px; }
|
|
.day .num { font-size: 18px; font-weight: 700; color: #a78bfa; }
|
|
.day .label { color: #64748b; margin-top: 4px; }
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<h1>🚀 Warmup Dashboard</h1>
|
|
<div class="nav">
|
|
<a href="email-warmup.php" class="btn" style="background:linear-gradient(135deg,#dc2626,#f97316);color:white;text-decoration:none;margin-right:10px"><i class="fas fa-fire"></i> Warmup Tool</a><a href="hamid-dashboard.php"><i class="fas fa-brain"></i> WEVAL MIND</a>
|
|
<a href="office-management.php"><i class="fas fa-microsoft"></i> Office</a>
|
|
<a href="standalone-index.php"><i class="fas fa-home"></i> Index</a>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ($msg): ?><div class="msg"><?= $msg ?></div><?php endif; ?>
|
|
|
|
<!-- Stats -->
|
|
<div class="stat-row">
|
|
<div class="stat">
|
|
<div class="value purple"><?= number_format($stats['total_accounts']) ?></div>
|
|
<div class="label">Comptes Office 365</div>
|
|
</div>
|
|
<div class="stat">
|
|
<div class="value green"><?= $stats['warmup_active'] ?></div>
|
|
<div class="label">Warmup Actifs</div>
|
|
</div>
|
|
<div class="stat">
|
|
<div class="value cyan"><?= $stats['warmup_total'] ?></div>
|
|
<div class="label">Total Warmup</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid">
|
|
<!-- Ajouter au Warmup -->
|
|
<div class="card">
|
|
<h3><i class="fas fa-plus-circle"></i> Ajouter au Warmup</h3>
|
|
<form method="POST">
|
|
<div class="form-row">
|
|
<select name="email">
|
|
<option value="">-- Sélectionner un compte --</option>
|
|
<?php foreach ($officeAccounts as $acc): ?>
|
|
<option value="<?= htmlspecialchars($acc['admin_email']) ?>"><?= htmlspecialchars($acc['admin_email']) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="form-row">
|
|
<input type="number" name="daily_target" value="50" placeholder="Objectif quotidien">
|
|
<button type="submit" name="add_warmup" class="btn"><i class="fas fa-rocket"></i> Démarrer</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Planning Recommandé -->
|
|
<div class="card">
|
|
<h3><i class="fas fa-calendar-alt"></i> Planning Warmup Recommandé</h3>
|
|
<div class="warmup-plan">
|
|
<div class="day"><div class="num">50</div><div class="label">J1-3</div></div>
|
|
<div class="day"><div class="num">100</div><div class="label">J4-7</div></div>
|
|
<div class="day"><div class="num">200</div><div class="label">S2</div></div>
|
|
<div class="day"><div class="num">500</div><div class="label">S3</div></div>
|
|
<div class="day"><div class="num">1K</div><div class="label">S4</div></div>
|
|
<div class="day"><div class="num">2K</div><div class="label">S5</div></div>
|
|
<div class="day"><div class="num">5K</div><div class="label">S6+</div></div>
|
|
</div>
|
|
<p style="margin-top:16px;font-size:12px;color:#64748b">
|
|
<i class="fas fa-info-circle"></i> Augmentation progressive de 30-50% par semaine recommandée.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Liste Warmup -->
|
|
<div class="card">
|
|
<h3><i class="fas fa-list"></i> Comptes en Warmup</h3>
|
|
<?php if (empty($warmupList)): ?>
|
|
<p style="color:#64748b;text-align:center;padding:40px">
|
|
<i class="fas fa-inbox" style="font-size:48px;opacity:0.3"></i><br><br>
|
|
Aucun compte en warmup.<br>
|
|
Ajoutez des comptes Office 365 pour commencer.
|
|
</p>
|
|
<?php else: ?>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Email</th>
|
|
<th>Jour</th>
|
|
<th>Aujourd'hui</th>
|
|
<th>Objectif</th>
|
|
<th>Total</th>
|
|
<th>Progression</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($warmupList as $w):
|
|
$progress = $w['daily_target'] > 0 ? min(100, ($w['emails_sent_today'] / $w['daily_target']) * 100) : 0;
|
|
?>
|
|
<tr>
|
|
<td><?= htmlspecialchars($w['email']) ?></td>
|
|
<td>J<?= $w['current_day'] ?></td>
|
|
<td><?= $w['emails_sent_today'] ?></td>
|
|
<td><?= $w['daily_target'] ?>/jour</td>
|
|
<td><?= number_format($w['total_sent']) ?></td>
|
|
<td>
|
|
<div class="progress">
|
|
<div class="progress-bar" style="width:<?= $progress ?>%"></div>
|
|
</div>
|
|
</td>
|
|
<td><span class="badge <?= $w['status'] ?>"><?= ucfirst($w['status']) ?></span></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<!-- Conseils WEVAL MIND -->
|
|
<div class="card">
|
|
<h3><i class="fas fa-lightbulb"></i> Conseils Warmup par WEVAL MIND</h3>
|
|
<div style="display:flex;gap:20px">
|
|
<div style="flex:1;padding:16px;background:rgba(139,92,246,0.1);border-radius:12px">
|
|
<h4 style="color:#a78bfa;margin-bottom:8px">✅ Bonnes Pratiques</h4>
|
|
<ul style="font-size:13px;color:#94a3b8;padding-left:20px;line-height:1.8">
|
|
<li>Commencer avec 50 emails/jour</li>
|
|
<li>Augmenter de 30% max par semaine</li>
|
|
<li>Maintenir un taux de bounce < 2%</li>
|
|
<li>Configurer SPF, DKIM, DMARC</li>
|
|
<li>Varier les heures d'envoi</li>
|
|
</ul>
|
|
</div>
|
|
<div style="flex:1;padding:16px;background:rgba(239,68,68,0.1);border-radius:12px">
|
|
<h4 style="color:#f87171;margin-bottom:8px">⚠️ À Éviter</h4>
|
|
<ul style="font-size:13px;color:#94a3b8;padding-left:20px;line-height:1.8">
|
|
<li>Augmenter trop vite le volume</li>
|
|
<li>Envoyer sans authentification</li>
|
|
<li>Ignorer les bounces</li>
|
|
<li>Utiliser des listes non vérifiées</li>
|
|
<li>Envoyer 24h/24 sans pause</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php include("includes/chatbot-widget.php"); ?>
|
|
|
|
</body>
|
|
</html>
|