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 |
* |
* |
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 |
|
|
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 |
} |
} |
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 |
} |
} |
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 |
} |
} |