Commit bfe71a5e authored by Marius Burkard's avatar Marius Burkard
Browse files

- backported !628 to stable branch

parent 57c04e6a
...@@ -30,8 +30,9 @@ class list_action extends listform_actions { ...@@ -30,8 +30,9 @@ class list_action extends listform_actions {
{ {
global $app; global $app;
$domain = $rec['domain'];
$rec = $app->listform->decode($rec); $rec = $app->listform->decode($rec);
//* Alternating datarow colors //* Alternating datarow colors
$this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF'; $this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF';
$rec['bgcolor'] = $this->DataRowColor; $rec['bgcolor'] = $this->DataRowColor;
...@@ -40,26 +41,26 @@ class list_action extends listform_actions { ...@@ -40,26 +41,26 @@ class list_action extends listform_actions {
//** Traffic of the current month //** Traffic of the current month
$tmp_year = date('Y'); $tmp_year = date('Y');
$tmp_month = date('m'); $tmp_month = date('m');
$tmp_rec = $app->db->queryOneRecord("SELECT SUM(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ? AND MONTH(traffic_date) = ?", $rec['domain'], $tmp_year, $tmp_month); $tmp_rec = $app->db->queryOneRecord("SELECT SUM(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ? AND MONTH(traffic_date) = ?", $domain, $tmp_year, $tmp_month);
$rec['this_month'] = $app->functions->formatBytes($tmp_rec['t']); $rec['this_month'] = $app->functions->formatBytes($tmp_rec['t']);
$this->sum_this_month += $tmp_rec['t']; $this->sum_this_month += $tmp_rec['t'];
//** Traffic of the current year //** Traffic of the current year
$tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ?", $rec['domain'], $tmp_year); $tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ?", $domain, $tmp_year);
$rec['this_year'] = $app->functions->formatBytes($tmp_rec['t']); $rec['this_year'] = $app->functions->formatBytes($tmp_rec['t']);
$this->sum_this_year += $tmp_rec['t']; $this->sum_this_year += $tmp_rec['t'];
//** Traffic of the last month //** Traffic of the last month
$tmp_year = date('Y', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); $tmp_year = date('Y', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")));
$tmp_month = date('m', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); $tmp_month = date('m', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")));
$tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ? AND MONTH(traffic_date) = ?", $rec['domain'], $tmp_year, $tmp_month); $tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ? AND MONTH(traffic_date) = ?", $domain, $tmp_year, $tmp_month);
$rec['last_month'] = $app->functions->formatBytes($tmp_rec['t']); $rec['last_month'] = $app->functions->formatBytes($tmp_rec['t']);
$this->sum_last_month += $tmp_rec['t']; $this->sum_last_month += $tmp_rec['t'];
//** Traffic of the last year //** Traffic of the last year
$tmp_year = date('Y', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); $tmp_year = date('Y', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1));
$tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ?", $rec['domain'], $tmp_year); $tmp_rec = $app->db->queryOneRecord("SELECT sum(traffic_bytes) as t FROM web_traffic WHERE hostname = ? AND YEAR(traffic_date) = ?", $domain, $tmp_year);
$rec['last_year'] = $app->functions->formatBytes($tmp_rec['t']); $rec['last_year'] = $app->functions->formatBytes($tmp_rec['t']);
$this->sum_last_year += $tmp_rec['t']; $this->sum_last_year += $tmp_rec['t'];
......
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