forked from Wavyzz/dolibarr
Modif de style et nettoyage
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,122 +21,78 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
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");
|
llxHeader($langs, '',$langs->trans("Compteur"),"Compteur");
|
||||||
|
|
||||||
$html = new Form($db);
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
*
|
|
||||||
* Mode creation
|
|
||||||
*
|
|
||||||
*
|
|
||||||
************************************************************************/
|
|
||||||
if ($_GET["action"] == 'create')
|
|
||||||
{
|
|
||||||
print_titre("Ajouter une compteur");
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Mode vue */
|
/* Mode vue */
|
||||||
/* */
|
/* */
|
||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
{
|
|
||||||
if ($_GET["id"] > 0)
|
if ($_GET["id"] > 0)
|
||||||
{
|
{
|
||||||
$compteur = new EnergieCompteur($db, $user);
|
$compteur = new EnergieCompteur($db, $user);
|
||||||
if ( $compteur->fetch($_GET["id"]) == 0)
|
if ( $compteur->fetch($_GET["id"]) == 0)
|
||||||
{
|
{
|
||||||
$head[0][0] = DOL_URL_ROOT.'/energie/compteur.php?id='.$compteur->id;
|
$head[0][0] = DOL_URL_ROOT.'/energie/compteur.php?id='.$compteur->id;
|
||||||
$head[0][1] = "Compteur";
|
$head[0][1] = "Compteur";
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/energie/compteur_graph.php?id='.$compteur->id;
|
$head[$h][0] = DOL_URL_ROOT.'/energie/compteur_graph.php?id='.$compteur->id;
|
||||||
$head[$h][1] = "Graph";
|
$head[$h][1] = "Graph";
|
||||||
$a = $h;
|
$a = $h;
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/energie/releve.php?id='.$compteur->id;
|
$head[$h][0] = DOL_URL_ROOT.'/energie/releve.php?id='.$compteur->id;
|
||||||
$head[$h][1] = "Relev<EFBFBD>s";
|
$head[$h][1] = "Relev<EFBFBD>s";
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/energie/compteur_groupe.php?id='.$compteur->id;
|
$head[$h][0] = DOL_URL_ROOT.'/energie/compteur_groupe.php?id='.$compteur->id;
|
||||||
$head[$h][1] = "Groupe";
|
$head[$h][1] = "Groupe";
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $a, $soc->nom);
|
dolibarr_fiche_head($head, $a, $soc->nom);
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print "<tr><td>".$langs->trans("Compteur")."</td>";
|
print "<tr><td>".$langs->trans("Compteur")."</td>";
|
||||||
print '<td width="50%">';
|
print '<td width="50%">';
|
||||||
print $compteur->libelle;
|
print $compteur->libelle;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
|
|
||||||
print '</div>';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
print '<tr><td align="center" colspan="2">';
|
||||||
print '<table class="noborder" width="100%">';
|
$file = "day.".$compteur->id.".png";
|
||||||
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
||||||
print '<tr><td align="center" colspan="2">';
|
print '</td></tr>';
|
||||||
$file = "day.".$compteur->id.".png";
|
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
print '<tr><td align="center" colspan="2">';
|
||||||
print '</td></tr>';
|
$file = "week.".$compteur->id.".png";
|
||||||
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
||||||
print '<tr><td align="center" colspan="2">';
|
print '</td></tr>';
|
||||||
$file = "week.".$compteur->id.".png";
|
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
print '<tr><td align="center">';
|
||||||
print '</td></tr>';
|
$file = "month.".$compteur->id.".png";
|
||||||
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
||||||
print '<tr><td align="center">';
|
print '</td><td align="center">';
|
||||||
$file = "month.".$compteur->id.".png";
|
$file = "year.".$compteur->id.".png";
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
||||||
print '</td><td align="center">';
|
print '</td></tr></table><br>';
|
||||||
$file = "year.".$compteur->id.".png";
|
print '</div>';
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
|
}
|
||||||
print '</td></tr></table><br>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Commande non trouv<75>e */
|
|
||||||
print "Compteur inexistant";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Compteur non trouv<75>e */
|
||||||
print "Compteur inexistant";
|
print "Compteur inexistant";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "Compteur inexistant";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||||
|
|||||||
Reference in New Issue
Block a user