diff --git a/customer_traffic.php b/customer_traffic.php index 8989f108..933ffd99 100644 --- a/customer_traffic.php +++ b/customer_traffic.php @@ -112,11 +112,14 @@ if (! is_null($month) && ! is_null($year)) { eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";"); } else { - $result_stmt = Database::prepare("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail + $result_stmt = Database::prepare(" + SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = :customerid - GROUP BY `year` DESC, `month` DESC - LIMIT 12"); + GROUP BY `year`, `month` + ORDER BY `year` DESC, `month` DESC + LIMIT 12 + "); Database::pexecute($result_stmt, array( "customerid" => $userinfo['customerid'] ));