From f4f981d8f98e4f74a8d69d05a31ab63e188ea808 Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Sun, 15 Nov 2015 08:00:17 -0500 Subject: [PATCH] Added missing delimiter settings in reseller form file. --- interface/lib/classes/quota_lib.inc.php | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/interface/lib/classes/quota_lib.inc.php b/interface/lib/classes/quota_lib.inc.php index 1f9c419..24a3ce3 100644 --- a/interface/lib/classes/quota_lib.inc.php +++ b/interface/lib/classes/quota_lib.inc.php @@ -103,9 +103,9 @@ // select vhosts (belonging to client) if($clientid != null){ - $sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")"; + $sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)"; } - $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')".$sql_where); + $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')".$sql_where, $clientid); $hostnames = array(); $traffic_data = array(); @@ -120,12 +120,12 @@ $tmp_year = date('Y'); $tmp_month = date('m'); // This Month - $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year, $tmp_month); + $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $tmp_month, $hostnames); foreach ($tmp_recs as $tmp_rec) { - $traffic_data[]['this_month'] = $tmp_rec['t']; + $traffic_data[$tmp_rec['hostname']]['this_month'] = $tmp_rec['t']; } // This Year - $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year); + $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $hostnames); foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['this_year'] = $tmp_rec['t']; } @@ -133,21 +133,21 @@ $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"))); // Last Month - $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year, $tmp_month); + $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND MONTH(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $tmp_month, $hostnames); foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['last_month'] = $tmp_rec['t']; } $tmp_year = date('Y', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); // Last Year - $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname", $tmp_year); + $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $hostnames); foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['last_year'] = $tmp_rec['t']; } if (is_int($lastdays) && ($lastdays > 0)) { // Last xx Days - $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE (traffic_date >= DATE_SUB(NOW(), INTERVAL ".$app->db->quote($lastdays)." DAY)) AND hostname IN ('".join("','",$hostnames)."') GROUP BY hostname"); + $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE (traffic_date >= DATE_SUB(NOW(), INTERVAL ? DAY)) AND hostname IN ? GROUP BY hostname", $lastdays, $hostnames); foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['lastdays'] = $tmp_rec['t']; } -- Gitblit v1.9.1