/[dolibarr]/dolibarr/htdocs/telephonie/script/graph-statistiques-commerciaux.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/script/graph-statistiques-commerciaux.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by rodolphe, Wed Sep 14 11:03:11 2005 UTC revision 1.7 by rodolphe, Thu Nov 10 14:42:25 2005 UTC
# Line 19  Line 19 
19   * $Source$   * $Source$
20   *   *
21   *   *
22   * Generation des graphiques   * Generation des graphiques relatifs aux commerciaux
  *  
  *  
23   *   *
24   */   */
25  require ("../../master.inc.php");  require ("../../master.inc.php");
# Line 48  $error = 0; Line 46  $error = 0;
46  $dirs[0] = DOL_DATA_ROOT."/graph/";  $dirs[0] = DOL_DATA_ROOT."/graph/";
47  $dirs[1] = DOL_DATA_ROOT."/graph/telephonie/";  $dirs[1] = DOL_DATA_ROOT."/graph/telephonie/";
48  $dirs[2] = DOL_DATA_ROOT."/graph/telephonie/commercials/";  $dirs[2] = DOL_DATA_ROOT."/graph/telephonie/commercials/";
49    $dirs[2] = DOL_DATA_ROOT."/graph/telephonie/distributeurs/";
50    
51  $img_root = DOL_DATA_ROOT."/graph/telephonie/";  $img_root = DOL_DATA_ROOT."/graph/telephonie/";
52    
# Line 116  if ($resql) Line 115  if ($resql)
115      }      }
116  }  }
117  /*  /*
118     * Distributeurs
119     *
120     */
121    $sql = "SELECT distinct fk_distributeur";
122    $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_distributeur_commerciaux";
123    
124    $resql = $db->query($sql);
125    if ($resql)
126    {
127      while ($row = $db->fetch_row($resql))
128        {
129          /* Gain */
130                
131          $dir = $img_root . "distributeurs/".$row[0]."/";
132          _cdir($dir);
133          $file = $dir."gain.mensuel.png";
134          if ($verbose) print "Graph : gain distributeur $file\n";
135          $graph = new GraphDistributeurGain($db, $file);
136          $graph->width = 400;
137          $graph->GraphMakeGraph($row[0]);
138        }
139    }
140    /*
141   * Groupes   * Groupes
142   *   *
143   */   */
# Line 148  if ($resql) Line 170  if ($resql)
170        $graph->width = 400;        $graph->width = 400;
171        $graph->GraphMakeGraph($row[0]);        $graph->GraphMakeGraph($row[0]);
172    
   
173        $i++;        $i++;
174      }      }
175  }  }
176    
   
   
177  /*  /*
178   * Contrats   * Contrats
179   *   *
# Line 209  if ($resql) Line 228  if ($resql)
228        $graph->GraphMakeGraph($value);        $graph->GraphMakeGraph($value);
229      }      }
230  }  }
231    
232    function _cdir($dir)
233    {
234      if (! file_exists($dir))
235        {
236          umask(0);
237          if (! @mkdir($dir, 0755))
238            {
239              print  "Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer.";
240            }
241          else
242            {
243              //print $dir ." créé\n";
244            }
245        }  
246    }
247    
248  ?>  ?>

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26