/[dolibarr]/dolibarr/scripts/banque/graph-solde.php
ViewVC logotype

Diff of /dolibarr/scripts/banque/graph-solde.php

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

revision 1.8 by rodolphe, Wed Aug 10 12:20:51 2005 UTC revision 1.9 by eldy, Sat Sep 17 02:32:33 2005 UTC
# Line 1  Line 1 
1    #!/usr/bin/php
2  <?PHP  <?PHP
3  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4   *   *
# Line 17  Line 18 
18   *   *
19   * $Id$   * $Id$
20   * $Source$   * $Source$
  *  
21   */   */
22    
23  require ("../../htdocs/master.inc.php");  /**
24            \file       scripts/banque/graph-solde.php
25            \ingroup    banque
26            \brief      Script de génération des images des soldes des comptes
27    */
28    
29    
30    // Test si mode batch
31    $sapi_type = php_sapi_name();
32    if (substr($sapi_type, 0, 3) == 'cgi') {
33        echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n";
34        exit;
35    }
36    
37    
38    // Recupere root dolibarr
39    $path=eregi_replace('graph-solde.php','',$_SERVER["PHP_SELF"]);
40    
41    require ($path."../../htdocs/master.inc.php");
42    
43    // Vérifie que chemin vers JPGRAHP est connu et defini $jpgraph
44    if (! defined('JPGRAPH_DIR') && ! defined('JPGRAPH_PATH'))
45    {
46        print 'Erreur: Définissez la constante JPGRAPH_PATH sur la valeur du répertoire contenant JPGraph';
47        exit;
48    }    
49    if (! defined('JPGRAPH_DIR')) define('JPGRAPH_DIR', JPGRAPH_PATH);
50    $jpgraphdir=JPGRAPH_DIR;
51    if (! eregi('[\\\/]$',$jpgraphdir)) $jpgraphdir.='/';
52    
53  include_once (JPGRAPH_DIR."jpgraph.php");  
54  include_once (JPGRAPH_DIR."jpgraph_line.php");  include_once ($jpgraphdir."jpgraph.php");
55  include_once (JPGRAPH_DIR."jpgraph_bar.php");  include_once ($jpgraphdir."jpgraph_line.php");
56  include_once (JPGRAPH_DIR."jpgraph_pie.php");  include_once ($jpgraphdir."jpgraph_bar.php");
57  include_once (JPGRAPH_DIR."jpgraph_error.php");  include_once ($jpgraphdir."jpgraph_pie.php");
58  include_once (JPGRAPH_DIR."jpgraph_canvas.php");  include_once ($jpgraphdir."jpgraph_error.php");
59    include_once ($jpgraphdir."jpgraph_canvas.php");
60    
61  $error = 0;  $error = 0;
62    
63  $opt = getopt("m:y:");  // Initialise opt, tableau des parametres
64    if (function_exists("getopt"))
65    {
66        // getopt existe sur ce PHP
67        $opt = getopt("m:y:");
68    }
69    else
70    {
71        // getopt n'existe sur ce PHP
72        $opt=array('m'=>$argv[1]);
73    }    
74    
75    
76    // Crée répertoire accueil
77    create_exdir($conf->banque->dir_images);
78    
79    
80  $datetime = time();  $datetime = time();
81    
# Line 191  foreach ($accounts as $account) Line 235  foreach ($accounts as $account)
235    $graph->Add($b2plot);    $graph->Add($b2plot);
236    $graph->img->SetImgFormat("png");    $graph->img->SetImgFormat("png");
237        
238    $file= DOL_DATA_ROOT."/graph/banque/solde.$account.$year.$month.png";    $file= $conf->banque->dir_images."/solde.$account.$year.$month.png";
239        
240    $graph->Stroke($file);    $graph->Stroke($file);
241  }  }
# Line 311  foreach ($accounts as $account) Line 355  foreach ($accounts as $account)
355    $graph->Add($b2plot);    $graph->Add($b2plot);
356    $graph->img->SetImgFormat("png");    $graph->img->SetImgFormat("png");
357        
358    $file= DOL_DATA_ROOT."/graph/banque/solde.$account.$year.png";    $file= $conf->banque->dir_images."/solde.$account.$year.png";
359        
360    $graph->Stroke($file);    $graph->Stroke($file);
361  }  }
# Line 415  foreach ($accounts as $account) Line 459  foreach ($accounts as $account)
459        $graph->Add($b2plot);        $graph->Add($b2plot);
460        $graph->img->SetImgFormat("png");        $graph->img->SetImgFormat("png");
461                
462        $file= DOL_DATA_ROOT."/graph/banque/solde.$account.png";        $file= $conf->banque->dir_images."/solde.$account.png";
463                
464        $graph->Stroke($file);        $graph->Stroke($file);
465      }      }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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