From 4a5acbf87b8d969ed23d5a8c29805440b96b0cfb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 May 2006 15:29:49 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20restriction=20pour=20les=20commerc?= =?UTF-8?q?iaux=20et=20les=20acc=E8s=20soci=E9t=E9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal/stats/propalestats.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/comm/propal/stats/propalestats.class.php b/htdocs/comm/propal/stats/propalestats.class.php index 25d05be4a4c..888abc3ab83 100644 --- a/htdocs/comm/propal/stats/propalestats.class.php +++ b/htdocs/comm/propal/stats/propalestats.class.php @@ -75,6 +75,8 @@ class PropaleStats extends Stats */ function getNbByYear() { + global $user; + $sql = "SELECT date_format(p.datep,'%Y') as dm, count(*)"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; @@ -95,6 +97,8 @@ class PropaleStats extends Stats */ function getAmountByMonth($year) { + global $user; + $sql = "SELECT date_format(p.datep,'%m') as dm, sum(p.price)"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; @@ -115,6 +119,8 @@ class PropaleStats extends Stats */ function getAverageByMonth($year) { + global $user; + $sql = "SELECT date_format(p.datep,'%m') as dm, avg(p.price)"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p";