[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: compteur_graph.php,v 1.2 2005/07/24 12:15:28 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/energie/compteur_graph.php,v $ 20 * 21 */ 22 23 require ("./pre.inc.php"); 24 25 /* 26 * 27 */ 28 if ($_POST["action"] == 'addvalue') 29 { 30 if ($_POST["releve"] > 0) 31 { 32 $compteur = new EnergieCompteur($db, $user); 33 if ( $compteur->fetch($_GET["id"]) == 0) 34 { 35 $date = mktime(12, 36 0 , 37 0, 38 $_POST["remonth"], 39 $_POST["reday"], 40 $_POST["reyear"]); 41 42 $compteur->AjoutReleve($date, $_POST["releve"]); 43 Header("Location: compteur.php?id=".$_GET["id"]); 44 } 45 } 46 } 47 /* 48 * 49 */ 50 51 llxHeader($langs, '',$langs->trans("Compteur"),"Compteur"); 52 53 $html = new Form($db); 54 55 /********************************************************************* 56 * 57 * Mode creation 58 * 59 * 60 ************************************************************************/ 61 if ($_GET["action"] == 'create') 62 { 63 print_titre("Ajouter une compteur"); 64 65 } 66 else 67 /* *************************************************************************** */ 68 /* */ 69 /* Mode vue */ 70 /* */ 71 /* *************************************************************************** */ 72 { 73 if ($_GET["id"] > 0) 74 { 75 $compteur = new EnergieCompteur($db, $user); 76 if ( $compteur->fetch($_GET["id"]) == 0) 77 { 78 $head[0][0] = DOL_URL_ROOT.'/energie/compteur.php?id='.$compteur->id; 79 $head[0][1] = "Compteur"; 80 $h++; 81 82 $head[$h][0] = DOL_URL_ROOT.'/energie/compteur_graph.php?id='.$compteur->id; 83 $head[$h][1] = "Graph"; 84 $a = $h; 85 $h++; 86 87 $head[$h][0] = DOL_URL_ROOT.'/energie/releve.php?id='.$compteur->id; 88 $head[$h][1] = "Relevés"; 89 $h++; 90 91 $head[$h][0] = DOL_URL_ROOT.'/energie/compteur_groupe.php?id='.$compteur->id; 92 $head[$h][1] = "Groupe"; 93 $h++; 94 95 dolibarr_fiche_head($head, $a, $soc->nom); 96 97 print '<table class="border" width="100%">'; 98 print "<tr><td>".$langs->trans("Compteur")."</td>"; 99 print '<td width="50%">'; 100 print $compteur->libelle; 101 print "</td></tr>"; 102 print "</table><br>"; 103 104 print '</div>'; 105 106 107 print '<table class="noborder" width="100%">'; 108 109 print '<tr><td align="center" colspan="2">'; 110 $file = "day.".$compteur->id.".png"; 111 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">'; 112 print '</td></tr>'; 113 114 print '<tr><td align="center" colspan="2">'; 115 $file = "week.".$compteur->id.".png"; 116 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">'; 117 print '</td></tr>'; 118 119 print '<tr><td align="center">'; 120 $file = "month.".$compteur->id.".png"; 121 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">'; 122 print '</td><td align="center">'; 123 $file = "year.".$compteur->id.".png"; 124 print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">'; 125 print '</td></tr></table><br>'; 126 127 } 128 else 129 { 130 /* Commande non trouvée */ 131 print "Compteur inexistant"; 132 } 133 } 134 else 135 { 136 print "Compteur inexistant"; 137 } 138 } 139 140 $db->close(); 141 142 llxFooter("<em>Dernière modification $Date: 2005/07/24 12:15:28 $ révision $Revision: 1.2 $</em>"); 143 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |