From 9d8092f3dd17959ab987f09ba3dd999dbb8e39c1 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 23 Jul 2005 12:59:30 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/energie/compteur_graph.php | 132 ++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 htdocs/energie/compteur_graph.php diff --git a/htdocs/energie/compteur_graph.php b/htdocs/energie/compteur_graph.php new file mode 100644 index 00000000000..c4b629a6b64 --- /dev/null +++ b/htdocs/energie/compteur_graph.php @@ -0,0 +1,132 @@ + + * + * 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"); + +/* + * + */ +if ($_POST["action"] == 'addvalue') +{ + if ($_POST["releve"] > 0) + { + $compteur = new EnergieCompteur($db, $user); + if ( $compteur->fetch($_GET["id"]) == 0) + { + $date = mktime(12, + 0 , + 0, + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"]); + + $compteur->AjoutReleve($date, $_POST["releve"]); + Header("Location: compteur.php?id=".$_GET["id"]); + } + } +} +/* + * + */ + +llxHeader($langs, '',$langs->trans("Compteur"),"Compteur"); + +$html = new Form($db); + +/********************************************************************* + * + * Mode creation + * + * + ************************************************************************/ +if ($_GET["action"] == 'create') +{ + print_titre("Ajouter une compteur"); + +} +else +/* *************************************************************************** */ +/* */ +/* Mode vue */ +/* */ +/* *************************************************************************** */ +{ + if ($_GET["id"] > 0) + { + $compteur = new EnergieCompteur($db, $user); + if ( $compteur->fetch($_GET["id"]) == 0) + { + $head[0][0] = DOL_URL_ROOT.'/energie/compteur.php?id='.$compteur->id; + $head[0][1] = "Compteur"; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/energie/compteur_graph.php?id='.$compteur->id; + $head[$h][1] = "Graph"; + $a = 1; + + dolibarr_fiche_head($head, $a, $soc->nom); + + print ''; + print ""; + print '"; + print "
".$langs->trans("Compteur")."'; + print $compteur->libelle; + print "

"; + + print ''; + + + print ''; + + print ''; + + print '
'; + $file = "day.".$compteur->id.".png"; + print ''; + print ''; + $file = "week.".$compteur->id.".png"; + print ''; + print '
'; + $file = "month.".$compteur->id.".png"; + print ''; + print ''; + $file = "year.".$compteur->id.".png"; + print ''; + print '

'; + + } + else + { + /* Commande non trouvée */ + print "Compteur inexistant"; + } + } + else + { + print "Compteur inexistant"; + } +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>