<?php
// /Controllers/KPIController.php
namespace Controllers;
require_once __DIR__ . '/../_Core/bootstrap.php';

class KPIController {
  protected $pdo;
  public function __construct(){ $this->pdo = Database::getConnection(); }

  public function summaryForUser($user_id){
    // minimal KPI sample; expand with real logic
    $stmt = $this->pdo->prepare("SELECT COUNT(*) as total_customers FROM sd_customers WHERE created_by = ?");
    $stmt->execute([$user_id]); $row = $stmt->fetch(\PDO::FETCH_ASSOC);
    return ['status'=>1,'kpi'=>$row];
  }
}
?>
