query('SELECT id, name FROM countries ORDER BY name')->fetchAll(PDO::FETCH_ASSOC); $countryId = filter_input(INPUT_GET, 'country_id', FILTER_VALIDATE_INT) ?: null; $whereCountry = ''; $params = []; if ($countryId) { $whereCountry = 'WHERE s.country_id = ?'; $params[] = $countryId; } $totalSites = 0; $totalCells = 0; try { $stmt = $db->prepare("SELECT COUNT(*) FROM sites s $whereCountry"); $stmt->execute($params); $totalSites = (int)$stmt->fetchColumn(); $stmt = $db->prepare( "SELECT COUNT(*) FROM cells c INNER JOIN sites s ON s.id = c.site_id $whereCountry" ); $stmt->execute($params); $totalCells = (int)$stmt->fetchColumn(); } catch (Throwable $e) { error_log('[statistics] compteurs generaux: ' . $e->getMessage()); } $byOperator = $db->prepare( "SELECT o.brand AS operator_name, COUNT(DISTINCT s.id) AS site_count, COUNT(c.id) AS cell_count FROM operators o LEFT JOIN sites s ON s.operator_id = o.id " . ($countryId ? 'AND s.country_id = ?' : '') . " LEFT JOIN cells c ON c.site_id = s.id GROUP BY o.id, o.brand ORDER BY cell_count DESC" ); $byOperator->execute($countryId ? [$countryId] : []); $byOperator = $byOperator->fetchAll(PDO::FETCH_ASSOC); $byTechnology = $db->prepare( "SELECT c.tech, COUNT(*) AS total FROM cells c INNER JOIN sites s ON s.id = c.site_id $whereCountry GROUP BY c.tech ORDER BY total DESC" ); $byTechnology->execute($params); $byTechnology = $byTechnology->fetchAll(PDO::FETCH_ASSOC); $byBand = $db->prepare( "SELECT c.band, COUNT(*) AS total FROM cells c INNER JOIN sites s ON s.id = c.site_id $whereCountry GROUP BY c.band ORDER BY total DESC LIMIT 30" ); $byBand->execute($params); $byBand = $byBand->fetchAll(PDO::FETCH_ASSOC); $user = current_admin_username(); ?> Statistiques — NetMonster Admin

Statistiques

Vue de consultation agregee, sans action d'ecriture possible.

Vue d'ensemble

Sites
Cellules

Par operateur

OperateurSitesCellules
Aucune donnee.

Par technologie

TechnologieCellules
Aucune donnee.

Par bande (top 30)

BandeCellules
Aucune donnee.