- fix possible error in usage-report if customer has no traffic (traffic = 0)

- fix another missing hidden-field in classic-theme template

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2011-03-04 13:35:54 +01:00
parent d6d19e7cb2
commit 3e63b1aabb
2 changed files with 6 additions and 1 deletions

View File

@@ -207,7 +207,11 @@ while($row = $db->fetch_array($result))
while($customer = $db->fetch_array($customers))
{
$mail_body.= sprintf('%-15s', $customer['loginname']) . ' ' . sprintf('%-12d', $customer['traffic_used_total']) . ' (' . sprintf('%00.3f%%', (($customer['traffic_used_total'] * 100) / $customer['traffic'])) . ') ' . $customer['traffic'] . "\n";
if ($customer['traffic'] >= 0) {
$mail_body.= sprintf('%-15s', $customer['loginname']) . ' ' . sprintf('%-12d', $customer['traffic_used_total']) . ' (' . sprintf('%00.3f%%', (($customer['traffic_used_total'] * 100) / $customer['traffic'])) . ') ' . $customer['traffic'] . "\n";
} else {
$mail_body.= sprintf('%-15s', $customer['loginname']) . ' ' . sprintf('%-12d', $customer['traffic_used_total']) . ' (' . sprintf('%00.3f%%', $customer['traffic_used_total']) . ') ' . $customer['traffic'] . "\n";
}
}
$mail_body.= '---------------------------------------------' . "\n";