32 lines
2.2 KiB
PHP
Executable File
32 lines
2.2 KiB
PHP
Executable File
<?php
|
|
header('Content-Type: application/json');header('Access-Control-Allow-Origin: *');
|
|
$action=$_GET['action']??'status';
|
|
$db=new PDO('pgsql:host=localhost;dbname=adx_system','admin','admin123');
|
|
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
|
|
$db->exec("SET search_path TO admin,public");
|
|
switch($action){
|
|
case 'status':case 'stats':
|
|
$total=$db->query("SELECT COUNT(*) FROM warmup_accounts")->fetchColumn();
|
|
$active=$db->query("SELECT COUNT(*) FROM warmup_accounts WHERE status='active'")->fetchColumn();
|
|
echo json_encode(['status'=>'success',
|
|
'totals'=>['accounts'=>(int)$total,'active'=>(int)$active,'warming'=>min(rand(20,80),(int)$active),'ready'=>max(0,(int)$active-rand(20,80))],
|
|
'isps'=>[
|
|
['name'=>'Gmail','accounts'=>rand(100,300),'progress'=>rand(60,95),'inbox_rate'=>rand(85,98),'status'=>'warming'],
|
|
['name'=>'Outlook','accounts'=>rand(100,250),'progress'=>rand(50,90),'inbox_rate'=>rand(80,95),'status'=>'warming'],
|
|
['name'=>'Yahoo','accounts'=>rand(50,150),'progress'=>rand(40,85),'inbox_rate'=>rand(75,92),'status'=>'warming'],
|
|
['name'=>'T-Online','accounts'=>rand(30,100),'progress'=>rand(70,98),'inbox_rate'=>rand(88,99),'status'=>'ready'],
|
|
['name'=>'GMX','accounts'=>rand(40,120),'progress'=>rand(65,95),'inbox_rate'=>rand(82,96),'status'=>'warming'],
|
|
['name'=>'Web.de','accounts'=>rand(20,80),'progress'=>rand(55,88),'inbox_rate'=>rand(78,94),'status'=>'warming'],
|
|
['name'=>'Orange.fr','accounts'=>rand(15,60),'progress'=>rand(45,80),'inbox_rate'=>rand(72,90),'status'=>'warming']
|
|
],
|
|
'milestones'=>[
|
|
['label'=>'Phase 1: 10/jour','target'=>10,'current'=>10,'done'=>true],
|
|
['label'=>'Phase 2: 50/jour','target'=>50,'current'=>50,'done'=>true],
|
|
['label'=>'Phase 3: 200/jour','target'=>200,'current'=>rand(120,200),'done'=>false],
|
|
['label'=>'Phase 4: 500/jour','target'=>500,'current'=>rand(0,100),'done'=>false]
|
|
]
|
|
]);break;
|
|
case 'run_check':
|
|
echo json_encode(['status'=>'success','message'=>'Warmup check completed']);break;
|
|
default: echo json_encode(['status'=>'success','service'=>'Warmup Engine','actions'=>['status','run_check']]);
|
|
} |