From 3fbe6006fb4762ed23bd0049387b34b18ec93db6 Mon Sep 17 00:00:00 2001 From: machine <28401480+machine62@users.noreply.github.com> Date: Wed, 12 Dec 2018 06:44:16 +0100 Subject: [PATCH] prepa tag 0.0.2 finalisation partie stat ajout purge + divers infos --- model/oversight.php | 48 +++++++++++++++++++++++++++++++++++++++++++++ oversight.php | 8 ++++++++ version.txt | 2 +- view/stat.php | 41 +++++++++++++++++++++++++++++--------- 4 files changed, 89 insertions(+), 10 deletions(-) diff --git a/model/oversight.php b/model/oversight.php index 8b3c90b..749c225 100644 --- a/model/oversight.php +++ b/model/oversight.php @@ -127,6 +127,16 @@ function delSurveillance($player) } +function getCountALLInsert() +{ + global $db; + $query = "SELECT count(*) as nbtotal FROM " . TABLE_OVERSIGHT . ""; + $result = $db->sql_query($query); + return $db->sql_fetch_row($result)["nbtotal"]; + + +} + function getALLInsert($player_id) @@ -194,3 +204,41 @@ function get_DisctinctCoord($player_id) return $tRetour; } + +function get_DisctinctPlayerId() +{ + global $db; + $query = "SELECT count(distinct(player_id)) as total_player FROM " . TABLE_OVERSIGHT_PLAYERS . " "; + $result = $db->sql_query($query); + $tRetour = $db->sql_fetch_row($result); + return $tRetour["total_player"]; +} + +function get_DisctinctSenderId() +{ + global $db; + $query = "SELECT count(distinct(sender_id)) as total_sender FROM " . TABLE_OVERSIGHT_PLAYERS . " "; + $result = $db->sql_query($query); + $tRetour = $db->sql_fetch_row($result); + return $tRetour["total_sender"]; +} + +function get_Orphan() +{ + global $db; + $query = "SELECT count(player_id) as total_orphan FROM " . TABLE_OVERSIGHT . " "; + $query .= " WHERE player_id NOT IN (select player_id as pid from " . TABLE_OVERSIGHT_PLAYERS . " )"; + $result = $db->sql_query($query); + $tRetour = $db->sql_fetch_row($result); + return $tRetour["total_orphan"]; +} + +function purgeInsertOrphan() +{ + global $db; + $query = "delete FROM " . TABLE_OVERSIGHT . " "; + $query .= " WHERE player_id NOT IN (select player_id as pid from " . TABLE_OVERSIGHT_PLAYERS . " )"; + $db->sql_query($query); + +} + diff --git a/oversight.php b/oversight.php index 5c8b6ce..12a4650 100644 --- a/oversight.php +++ b/oversight.php @@ -94,6 +94,14 @@ case "stat": //-------Logique----------- $data["menuactif"] = "stat"; + if (isset($pub_purge)) + { + purgeInsertOrphan(); + } + $data["CountALLInsert"] = getCountALLInsert(); + $data["total_player"] = get_DisctinctPlayerId(); + $data["total_sender"] = get_DisctinctSenderId(); + $data["total_orphan"] = get_Orphan(); //------------------------- //-------Appel Vue--------- diff --git a/version.txt b/version.txt index 77e39fc..75d3ac6 100644 --- a/version.txt +++ b/version.txt @@ -1,4 +1,4 @@ Oversight -0.0.1 +0.0.2 Oversight,Oversight,oversight,oversight,oversight.php,1,0 3.2.0 diff --git a/view/stat.php b/view/stat.php index 7d4eebe..c2a5fe9 100644 --- a/view/stat.php +++ b/view/stat.php @@ -2,16 +2,39 @@ if (!defined('IN_SPYOGAME')) die("Hacking attempt"); ?> +
Configuration | +Valeur | +
Nombre d'utilisateur | ++ |
---|---|
Nombre de joueur surveiller | ++ |
Nombre de scanne | ++ |
Entrées orphelines | ++ |
+ | Purger | +