PDO::ERRMODE_EXCEPTION,PDO::ATTR_DEFAULT_FETCH_MODE=>PDO::FETCH_ASSOC]);
$_db->exec("SET search_path TO admin,public");
$_total=(int)$_db->query("SELECT COUNT(*) FROM office_accounts")->fetchColumn();
$_active=(int)$_db->query("SELECT COUNT(*) FROM office_accounts WHERE LOWER(status)='active'")->fetchColumn();
$_warming=(int)$_db->query("SELECT COUNT(*) FROM office_accounts WHERE LOWER(status)='warming'")->fetchColumn();
$_suspended=(int)$_db->query("SELECT COUNT(*) FROM office_accounts WHERE LOWER(status)='suspended'")->fetchColumn();
$_blocked=(int)$_db->query("SELECT COUNT(*) FROM office_accounts WHERE LOWER(status)='blocked'")->fetchColumn();
$_domains=(int)$_db->query("SELECT COUNT(*) FROM office_domains")->fetchColumn();
$_dom_verified=(int)$_db->query("SELECT COUNT(*) FROM office_domains WHERE verification_status='Verified'")->fetchColumn();
$_tenants=(int)$_db->query("SELECT COUNT(*) FROM graph_tenants")->fetchColumn();
$_graph=(int)$_db->query("SELECT COUNT(*) FROM graph_accounts")->fetchColumn();
$_sends=(int)$_db->query("SELECT COUNT(*) FROM graph_send_log")->fetchColumn();
$_exchange=(int)$_db->query("SELECT COUNT(*) FROM office_accounts WHERE exchange_configured=true")->fetchColumn();
$_by_status=$_db->query("SELECT LOWER(status) as status,COUNT(*) as cnt FROM office_accounts GROUP BY LOWER(status) ORDER BY cnt DESC")->fetchAll();
$_by_step=$_db->query("SELECT current_step,COUNT(*) as cnt FROM office_accounts GROUP BY current_step ORDER BY current_step")->fetchAll();
$_top_tenants=$_db->query("SELECT tenant_domain,status,users_count,sends_today,daily_limit FROM graph_tenants ORDER BY users_count DESC LIMIT 10")->fetchAll();
$_recent=$_db->query("SELECT id,name,tenant_domain,LOWER(status) as status,current_step,exchange_configured,domains_count,has_license FROM office_accounts ORDER BY id DESC LIMIT 30")->fetchAll();
$_dom_list=$_db->query("SELECT d.domain_name,d.verification_status,a.name as account_name FROM office_domains d LEFT JOIN office_accounts a ON d.account_id=a.id ORDER BY d.verification_status,d.domain_name LIMIT 50")->fetchAll();
?>
WEVAL Technology Platform
🏢 Office Workflow
O365 accounts, Graph API tenants, domains verification, Exchange pipeline
=number_format($_total)?>
Office Accounts
=$_active?>
Active
=$_warming?>
Warming
=$_suspended+$_blocked?>
Suspended
=$_dom_verified?>/=$_domains?>
Domains Verified
=$_tenants?>
Graph Tenants
=number_format($_sends)?>
Graph Sends
📊 Account Pipeline — 8 Steps
$sn):$cnt=0;foreach($_by_step as $s)if((int)$s['current_step']==$i)$cnt=(int)$s['cnt'];$clr=$i<3?'var(--am)':($i<6?'var(--cy)':'var(--gn)');?>