[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/energie/ -> compteur_groupe.php (source)

   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_groupe.php,v 1.2 2005/07/24 12:15:28 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/energie/compteur_groupe.php,v $
  20   *
  21   */
  22  
  23  /**
  24     \file       htdocs/energie/compteur_groupe.php
  25     \ingroup    energie
  26     \brief      Fiche de gestion des groupes des compteurs
  27     \version    $Revision: 1.2 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  
  32  
  33  if ($_POST["action"] == 'addvalue')
  34  {
  35    $compteur = new EnergieCompteur($db, $user);
  36    if ( $compteur->fetch($_GET["id"]) == 0)
  37      {
  38        if ( $compteur->AddGroup($_POST["groupe"]) == 0)
  39      {
  40        Header("Location: compteur.php?id=".$_GET["id"]);
  41      }
  42      }
  43  }
  44  /*
  45   *
  46   */    
  47  
  48  llxHeader($langs, '',$langs->trans("Compteur"),"Compteur");
  49  
  50  if ($_GET["id"] > 0)
  51  {
  52    $compteur = new EnergieCompteur($db, $user);
  53    if ( $compteur->fetch($_GET["id"]) == 0)
  54      {      
  55        
  56        $head[0][0] = DOL_URL_ROOT.'/energie/compteur.php?id='.$compteur->id;
  57        $head[0][1] = "Compteur";
  58        $h++;
  59        
  60        $head[$h][0] = DOL_URL_ROOT.'/energie/compteur_graph.php?id='.$compteur->id;
  61        $head[$h][1] = "Graph";
  62        $h++;
  63  
  64        $head[$h][0] = DOL_URL_ROOT.'/energie/releve.php?id='.$compteur->id;
  65        $head[$h][1] = "Relevés";
  66        $h++;
  67  
  68        $head[$h][0] = DOL_URL_ROOT.'/energie/compteur_groupe.php?id='.$compteur->id;
  69        $head[$h][1] = "Groupe";
  70        $a = $h;
  71        $h++;
  72        
  73        dolibarr_fiche_head($head, $a, $soc->nom);
  74        
  75        
  76        print '<table class="border" width="100%">';
  77        print "<tr><td>".$langs->trans("Compteur")."</td>";
  78        print '<td width="50%">';
  79        print $compteur->libelle;
  80        print "</td></tr>";            
  81        print "</table><br>";
  82        
  83        $html = new Form($db);
  84        print '<form action="compteur_groupe.php?id='.$compteur->id.'" method="post">';
  85        print '<input type="hidden" name="action" value="addvalue">';
  86        print '<table class="border" width="100%">';      
  87        
  88        $var=!$var;
  89        print "<tr $bc[$var]>";
  90       
  91        $compteur->GroupsAvailable();
  92   
  93        print '<td>Groupe</td><td>';
  94        print $html->select_array("groupe", $compteur->groups_available);
  95        print '</td>';
  96              
  97        print '<td align="center"><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
  98        
  99        print "</table></form><br>";      
 100        print '</div>';
 101        print "<br>\n";
 102      }
 103    else
 104      {
 105        /* Commande non trouvée */
 106        print "Compteur inexistant";
 107      }
 108  }  
 109  else
 110  {
 111    print "Compteur inexistant";
 112  }
 113  
 114  $db->close();
 115  
 116  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/24 12:15:28 $ r&eacute;vision $Revision: 1.2 $</em>");
 117  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics