From 302ad11dd9148dab6040b51a7277a7eaeba6c9bf Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 31 May 2007 08:13:31 +0000 Subject: [PATCH] Modif de style et nettoyage --- htdocs/energie/compteur_graph.php | 164 +++++++++++------------------- 1 file changed, 60 insertions(+), 104 deletions(-) diff --git a/htdocs/energie/compteur_graph.php b/htdocs/energie/compteur_graph.php index bdbb7941e53..a137c1f531f 100644 --- a/htdocs/energie/compteur_graph.php +++ b/htdocs/energie/compteur_graph.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2007 Rodolphe Quiedeville * * 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 @@ -21,122 +21,78 @@ */ 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 = $h; - $h++; - - $head[$h][0] = DOL_URL_ROOT.'/energie/releve.php?id='.$compteur->id; - $head[$h][1] = "Relevés"; - $h++; - - $head[$h][0] = DOL_URL_ROOT.'/energie/compteur_groupe.php?id='.$compteur->id; - $head[$h][1] = "Groupe"; - $h++; - - dolibarr_fiche_head($head, $a, $soc->nom); - - print ''; - print ""; - print '"; - print "
".$langs->trans("Compteur")."'; - print $compteur->libelle; - print "

"; - - 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"; - } - } + +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 = $h; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/energie/releve.php?id='.$compteur->id; + $head[$h][1] = "Relevés"; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/energie/compteur_groupe.php?id='.$compteur->id; + $head[$h][1] = "Groupe"; + $h++; + + 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 '

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