* * 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("../../propal.class.php"); //require("../../graph.class.php"); llxHeader(); $mesg = ''; /* * * */ if ($id) { $product = new Product($db); $result = $product->fetch($id); if ( $result ) { $dir = DOL_DOCUMENT_ROOT."/document/produit/".$product->id; if (! file_exists($dir)) { umask(0); if (! mkdir($dir, 0755)) { $mesg = "Impossible de créer $dir !"; } } $filev = $dir . "/vente12mois.png"; $filenv = $dir . "/vendu12mois.png"; if (! file_exists($filev) or $action == 'recalcul') { $px = new BarGraph(); $graph_data = $product->get_num_vente(); $px->draw($filev, $graph_data); $px = new BarGraph(); $graph_data = $product->get_nb_vente(); $px->draw($filenv, $graph_data); $mesg = "Graphiques générés"; } print_fiche_titre('Fiche produit : '.$product->ref, $mesg); print ''; print ''; print ''; print ""; print ''; print ''; print "
Référence'.$product->ref.'Statistiques
Libellé$product->libelle'; print "Propositions commerciales : ".$product->count_propale(); print "
Proposé à ".$product->count_propale_client()." clients"; print '
Factures : '.$product->count_facture(); print '
Prix'.price($product->price).'
"; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
Nombre de ventes
sur les 12 derniers mois
Nombre de pièces vendues
'; print 'Ventes sur les 12 derniers mois'; print ''; print 'Ventes sur les 12 derniers mois'; print '
Généré le '.strftime("%d %b %Y %H:%M:%S",filemtime($filev)).'[Re-calculer]Généré le '.strftime("%d %b %Y %H:%M:%S",filemtime($filev)).'[Re-calculer]
'; } } else { print "Error"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>