Files
dolibarr/htdocs/rapport/index.php
Laurent Destailleur e0d479a2bb Simplification de la couche generant les graphs. Tous les graphs passent par la classe DolGraph.
C'est cette classe qui doit ensuite s'appuier directement sur PHPlot ou une autre librairie graphique libre.
Qual: La génération des soldes ne fait plus exception ce qui permet de ne plus dépendre de jpgraph qui
n'est pas libre.
2006-08-13 13:30:53 +00:00

102 lines
2.0 KiB
PHP

<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
require("./AtomeFactureValidee.class.php");
require("./AtomePropaleValidee.class.php");
llxHeader();
print_fiche_titre("Rapports");
/*
* Initialisation d'un atome
*
* Parametre
* - id de connexion à la bdd
* - période 'year' ou 'month' (Reste à faire les hebdo)
* - une date dans la période voulue
* -> retourne un objet
*
*/
$x = new AtomeFactureValidee($db,'year', time());
/*
* Lecture des données
* -> retourne un tableau
*/
$arr = $x->fetch();
/*
* Création du graph
* -> retounre le nom du fichier
*/
$img = $x->ShowGraph();
print $img."<br>";
//
$x = new AtomeFactureValidee($db,'year', mktime(12,0,0,1,12,2003));
$arr = $x->fetch('year');
$img = $x->ShowGraph();
print $img."<br>";
for ($i = 1 ; $i < 5; $i++)
{
$x = new AtomeFactureValidee($db,'month', mktime(12,0,0,$i,12,2003));
$x->periode = 'month';
$arr = $x->fetch('month');
$img = $x->ShowGraph();
print $img."<br>";
}
//
$x = new AtomePropaleValidee($db,'year',mktime(12,0,0,1,12,2003));
$arr = $x->fetch();
var_dump($arr);
$img = $x->ShowGraph();
print $img."<br>";
$db->close();
llxFooter('$Date$ - $Revision$');
?>