diff options
Diffstat (limited to 'admin/api/getQuota.php')
-rw-r--r-- | admin/api/getQuota.php | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/admin/api/getQuota.php b/admin/api/getQuota.php deleted file mode 100644 index 1d64737..0000000 --- a/admin/api/getQuota.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";
-
-if (isset($_GET['_']) && strpos($_GET['_'], "/") === false) {
- $arg = $_GET['_'];
-} else {
- die();
-}
-
-$webs = scandir("/mnt/minteckrolt-cloud");
-
-if (in_array($arg, $webs)) {
- $tier = trim(file_get_contents("/mnt/minteckrolt-cloud/" . $arg . "/Tier"));
-
- exec("du -hs /mnt/minteckrolt-cloud/" . $arg, $ret);
- $parts = explode(" ", $ret[0]);
-
- exec("du -s /mnt/minteckrolt-cloud/" . $arg, $ret2);
- $parts2 = explode(" ", $ret2[0]);
-
- if ($tier === "3") {
- $perc = ($parts2[0] / 100000) * 100;
- if ($perc > 75) {
- die("<span class='text-danger'>" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)</span>");
- } else if ($perc > 50) {
- die("<span class='text-warning'>" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)</span>");
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)</span>");
- }
- } else if ($tier === "5") {
- $perc = ($parts2[0] / 250000) * 100;
- if ($perc > 75) {
- die("<span class='text-danger'>" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)</span>");
- } else if ($perc > 50) {
- die("<span class='text-warning'>" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)</span>");
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)</span>");
- }
- } else if ($tier === "7") {
- $perc = ($parts2[0] / 500000) * 100;
- if ($perc > 75) {
- die("<span class='text-danger'>" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)</span>");
- } else if ($perc > 50) {
- die("<span class='text-warning'>" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)</span>");
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)</span>");
- }
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "</span>");
- }
-}
-
-die("Unable to calculate data usage");
\ No newline at end of file |