Skip to content

Commit

Permalink
prepa tag 0.0.2
Browse files Browse the repository at this point in the history
finalisation partie stat
ajout purge + divers infos
  • Loading branch information
machine62 committed Dec 12, 2018
1 parent 0c76466 commit 3fbe600
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 10 deletions.
48 changes: 48 additions & 0 deletions model/oversight.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

}

8 changes: 8 additions & 0 deletions oversight.php
Original file line number Diff line number Diff line change
Expand Up @@ -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---------
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Oversight
0.0.1
0.0.2
Oversight,Oversight,oversight,oversight,oversight.php,1,0
3.2.0
41 changes: 32 additions & 9 deletions view/stat.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,39 @@
if (!defined('IN_SPYOGAME')) die("Hacking attempt");

?>
<h2> Configuration </h2>

<table width="100%">
<thead>
<tr>
<td class="c_stats" width="25%">Configuration</td>
<td class="c" width="25%">Valeur</td>
</tr>
</thead>
<tbody>
<tr>
<th><a>Nombre d'utilisateur</a></th>
<th><?php echo $data["total_sender"]; ?></th>
</tr>
<tr>
<th><a>Nombre de joueur surveiller</a></th>
<th><?php echo $data["total_player"]; ?></th>
</tr>
<tr>
<th><a>Nombre de scanne </a></th>
<th><?php echo $data["CountALLInsert"]; ?></th>
</tr>
<tr>
<th><a>Entrées orphelines</a></th>
<th><?php echo $data["total_orphan"]; ?></th>
</tr>

<tr>
<th></th>
<th><a href="index.php?action=oversight&page=stat&purge">Purger</a></th>
</tr>
</tbody>
</table>

<h2> Non implemnté encore</h2>
todo <br />
liste joueur suivi + nb <br />
liste joueur suivant + nb <br />
vision analyse pour toutes l'alliance <br />
compte entrée orpheline + suppression <br /> <br />

------------- <br />
admin <br />
suppression au bout de x nb ou au bout de d date <br />

0 comments on commit 3fbe600

Please sign in to comment.