From 94f25cd11f3cc948afb8177aabca8de73dff627f Mon Sep 17 00:00:00 2001
From: Rodolphe Quiedeville <rodolphe@quiedeville.org>
Date: Tue, 15 Mar 2005 16:19:28 +0000
Subject: [PATCH] Ajout dir des lignes

---
 .../script/graph-statistiques-makedir.php     | 51 +++++++++++++++++--
 1 file changed, 46 insertions(+), 5 deletions(-)

diff --git a/htdocs/telephonie/script/graph-statistiques-makedir.php b/htdocs/telephonie/script/graph-statistiques-makedir.php
index 20e9f80ceaa..e11db5eef14 100644
--- a/htdocs/telephonie/script/graph-statistiques-makedir.php
+++ b/htdocs/telephonie/script/graph-statistiques-makedir.php
@@ -74,8 +74,6 @@ for ($j = 0 ; $j < 10 ; $j++)
 {
   $dirs[$i] = DOL_DATA_ROOT."/graph/".$j."/telephonie/client/";
   $i++;
-  $dirs[$i] = DOL_DATA_ROOT."/graph/".$j."/telephonie/contrat/";
-  $i++;
   $dirs[$i] = DOL_DATA_ROOT."/graph/".$j."/telephonie/ligne/";
   $i++;
   $dirs[$i] = DOL_DATA_ROOT."/graph/".$j."/telephonie/commercial/";
@@ -97,14 +95,57 @@ if ($db->query($sql))
     {
       $row = $db->fetch_row();	
       
-      $dirs[$i] = DOL_DATA_ROOT."/graph/telephonie/client/".substr($row[0],0,1)."/".$row[0]."/";
-     
+      $dirs[$i] = DOL_DATA_ROOT."/graph/telephonie/client/".substr($row[0],0,1)."/".$row[0]."/";     
+      $i++;
+
+      $dirs[$i] = DOL_DATA_ROOT."/graph/".substr($row[0],-1)."/telephonie/client/".$row[0]."/";     
+      $i++;
+
+      $j++;
+    }
+}
+
+$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."telephonie_contrat";
+
+if ($db->query($sql))
+{
+  $num = $db->num_rows();
+  $j = 0;
+  
+  while ($j < $num)
+    {
+      $row = $db->fetch_row();	
+      
+      $dirs[$i] = DOL_DATA_ROOT."/graph/".substr($row[0],-1)."/telephonie/contrat/".$row[0]."/";
       $i++;
+
       $j++;
     }
 }
 
- 
+/*
+ *
+ */ 
+$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne";
+
+if ($db->query($sql))
+{
+  $num = $db->num_rows();
+  $j = 0;
+  
+  while ($j < $num)
+    {
+      $row = $db->fetch_row();	
+      
+      $dirs[$i] = DOL_DATA_ROOT."/graph/".substr($row[0],-1)."/telephonie/ligne/".$row[0]."/";
+      $i++;
+
+      $j++;
+    }
+}
+/*
+ *
+ */
 
 if (is_array($dirs))
 {
-- 
GitLab