Commit 07235f49 authored by Florian Schaal's avatar Florian Schaal

fixed db.quota stats

parent 14ff27bf
......@@ -250,7 +250,7 @@ class quota_lib {
$databases[$i]['used'] = isset($monitor_data[$databasename]['size']) ? $monitor_data[$databasename]['size'] : 0;
$databases[$i]['quota_raw'] = $databases[$i]['database_quota'];
$databases[$i]['used_raw'] = $databases[$i]['used'];
$databases[$i]['used_raw'] = $databases[$i]['used'] / 1024 / 1024; //* quota is stored as MB - calculated bytes
$databases[$i]['used_percentage'] = (($databases[$i]['database_quota'] > 0) && ($databases[$i]['used'] > 0)) ? round($databases[$i]['used'] * 100 / $databases[$i]['database_quota']) : 0;
if ($readable) {
......@@ -267,7 +267,7 @@ class quota_lib {
if($databases[$i]['database_quota'] == 0){
$databases[$i]['database_quota'] = $app->lng('unlimited');
} else {
$databases[$i]['database_quota'] = round($databases[$i]['database_quota'] / 1048576, 4).' MB';
$databases[$i]['database_quota'] = $databases[$i]['database_quota'] . ' MB';
}
......@@ -283,4 +283,4 @@ class quota_lib {
return $databases;
}
}
\ No newline at end of file
}
......@@ -29,7 +29,7 @@ if(is_array($tmp_rec)) {
foreach($tmp_array as $database_name => $data) {
$db_name = $data['database_name'];
$temp = $app->db->queryOneRecord("SELECT client.username, web_database.database_quota FROM web_database, sys_group, client WHERE web_database.sys_groupid = sys_group.groupid AND sys_group.client_id = client.client_id AND web_database.database_name = ?", $db_name);
$temp = $app->db->queryOneRecord("SELECT client.username, web_database.database_quota FROM web_database, sys_group, client WHERE sys_group.client_id = client.client_id AND web_database.database_name = ?", $db_name);
if(is_array($temp) && !empty($temp)) {
$monitor_data[$server_id.'.'.$db_name]['database_name'] = $data['database_name'];
$monitor_data[$server_id.'.'.$db_name]['client'] = isset($temp['username']) ? $temp['username'] : '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment