o.moresis
2 years ago
8 changed files with 97 additions and 36 deletions
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
<?php |
||||
namespace MSFD\Controllers; |
||||
use MSFD\Services\PgSql; |
||||
|
||||
|
||||
class StatsController { |
||||
public function fetchStats() { |
||||
if (!in_array(5, $_SESSION['user_groups'])) { |
||||
header('HTTP/1.1 403 Forbidden'); |
||||
die(); |
||||
} |
||||
require __DIR__.'/../Data/users.php'; |
||||
} |
||||
|
||||
public function countTypes() { |
||||
$sql = "SELECT * FROM webapp.stats_count_per_type"; |
||||
$result = PgSql::getJson($sql); |
||||
|
||||
echo $result; |
||||
} |
||||
|
||||
public function countTotal() { |
||||
$sql = "SELECT * FROM webapp.stats_total_inserts"; |
||||
$result = PgSql::getJson($sql); |
||||
|
||||
echo $result; |
||||
} |
||||
|
||||
public function countFiles() { |
||||
$sql = "SELECT * FROM webapp.stats_total_files"; |
||||
$result = PgSql::getJson($sql); |
||||
|
||||
echo $result; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue