* Copyright (c) 2004 Laurent Destailleur * * 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"); llxHeader(); $mesg = ''; /* * * */ if ($_GET["id"]) { $product = new Product($db); $result = $product->fetch($_GET["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 !"; } } $filenbpropal = $dir . "/propal12mois.png"; $filenbvente = $dir . "/vente12mois.png"; $filenbpiece = $dir . "/vendu12mois.png"; if (! file_exists($filenbvente) or $_GET["action"] == 'recalcul') { $px = new BarGraph(); $mesg = $px->isGraphKo(); if (! $mesg) { $graph_data = $product->get_num_vente(); $px->draw($filenbvente, $graph_data); $px = new BarGraph(); $graph_data = $product->get_nb_vente(); $px->draw($filenbpiece, $graph_data); $px = new BarGraph(); $graph_data = $product->get_num_propal(); $px->draw($filenbpropal, $graph_data); $mesg = "Graphiques générés"; } } // Zone recherche print ''; print ''; print '
'; print 'Réf :  '; print '
'; print 'Libellé :  '; print '
'; print '
'; $head[0][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; $head[0][1] = 'Fiche'; $head[1][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id; $head[1][1] = 'Prix'; $head[2][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id; $head[2][1] = 'Statistiques'; dolibarr_fiche_head($head, 2, 'Fiche '.$types[$product->type].' : '.$product->ref); 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 actuel'.price($product->price).'
"; print '
'; print ''; print ''; print ''; if (file_exists($filenbvente) && filemtime($filenbvente)) { print ''; } else { print ''; } print ''; if (file_exists($filenbpiece) && filemtime($filenbpiece)) { print ''; } else { print ''; } print ''; print ''; print ''; print ''; print ''; if (file_exists($filenbpropal) && filemtime($filenbpropal)) { print ''; } else { print ''; } print ''; if (file_exists($filenbpiece) && filemtime($filenbpiece33)) { print ''; } else { 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 '.dolibarr_print_date(filemtime($filenbvente),"%d %b %Y %H:%M:%S").'Graphique non généré[Re-calculer]Généré le '.dolibarr_print_date(filemtime($filenbpiece),"%d %b %Y %H:%M:%S").'Graphique non généré[Re-calculer]
Statistiques effectuées sur les factures payées uniquement
Nombre de propositions commerciales
sur les 12 derniers mois
-
'; print 'Propales sur les 12 derniers mois'; print 'TODO AUTRE GRAPHIQUE'; print '
Généré le '.dolibarr_print_date(filemtime($filenbpropal),"%d %b %Y %H:%M:%S").'Graphique non généré[Re-calculer]Généré le '.dolibarr_print_date(filemtime($filenbpiece),"%d %b %Y %H:%M:%S").'Graphique non généré[Re-calculer]
'; } } else { print "Error"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>