diff --git a/admin_customers.php b/admin_customers.php index d9d95e7a..f73bfb6c 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -84,6 +84,15 @@ if ($page == 'customers' $domains = $domains_stmt->fetch(PDO::FETCH_ASSOC); $row['domains'] = intval($domains['domains']); $dec_places = Settings::Get('panel.decimal_places'); + + // get disk-space usages for web, mysql and mail + $usages_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_DISKSPACE."` WHERE `customerid` = :cid ORDER BY `stamp` DESC LIMIT 1"); + $usages = Database::pexecute_first($usages_stmt, array('cid' => $row['customerid'])); + + $row['webspace_used'] = round($usages['webspace'] / 1024, $dec_places); + $row['mailspace_used'] = round($usages['mail'] / 1024, $dec_places); + $row['dbspace_used'] = round($usages['mysql'] / 1024, $dec_places); + $row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $dec_places); $row['traffic'] = round($row['traffic'] / (1024 * 1024), $dec_places); $row['diskspace_used'] = round($row['diskspace_used'] / 1024, $dec_places); diff --git a/customer_index.php b/customer_index.php index 9d8772d7..25f390dd 100644 --- a/customer_index.php +++ b/customer_index.php @@ -78,8 +78,15 @@ if ($page == 'overview') { $yesterday = time() - (60 * 60 * 24); $month = date('M Y', $yesterday); + // get disk-space usages for web, mysql and mail + $usages_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_DISKSPACE."` WHERE `customerid` = :cid ORDER BY `stamp` DESC LIMIT 1"); + $usages = Database::pexecute_first($usages_stmt, array('cid' => $userinfo['customerid'])); + $userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places')); - $userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['mailspace_used'] = round($usages['mail'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['dbspace_used'] = round($usages['mysql'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places')); $userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places')); $userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains'); diff --git a/lng/english.lng.php b/lng/english.lng.php index e2fc7522..8d7fc200 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -71,6 +71,7 @@ $lng['customer']['ftps'] = 'FTP-accounts'; $lng['customer']['subdomains'] = 'Subdomains'; $lng['customer']['domains'] = 'Domains'; $lng['customer']['unlimited'] = '∞'; +$lng['customer']['mib'] = 'MiB'; /** * Customermenue diff --git a/templates/Sparkle/admin/customers/customers_customer.tpl b/templates/Sparkle/admin/customers/customers_customer.tpl index 519076c9..444b3760 100644 --- a/templates/Sparkle/admin/customers/customers_customer.tpl +++ b/templates/Sparkle/admin/customers/customers_customer.tpl @@ -26,16 +26,16 @@ Webspace: -
+
-
+
-
+
diff --git a/templates/Sparkle/customer/index/index.tpl b/templates/Sparkle/customer/index/index.tpl index 168c009e..1ba1a5cb 100644 --- a/templates/Sparkle/customer/index/index.tpl +++ b/templates/Sparkle/customer/index/index.tpl @@ -71,8 +71,9 @@ $header {$userinfo['email_accounts_used']} {$lng['panel']['used']}
- {$userinfo['email_accounts']} {$lng['panel']['available']} + {$userinfo['email_accounts']} {$lng['panel']['available']}
+ {$userinfo['mailspace_used']} {$lng['customer']['mib']}
@@ -113,8 +114,9 @@ $header {$userinfo['mysqls_used']} {$lng['panel']['used']}
- {$userinfo['mysqls']} {$lng['panel']['available']} + {$userinfo['mysqls']} {$lng['panel']['available']}
+ {$userinfo['dbspace_used']} {$lng['customer']['mib']}
@@ -248,4 +250,3 @@ $header
$footer -