[ 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/ -> 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: groupe.php,v 1.1 2005/07/23 13:31:59 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/energie/groupe.php,v $
  20   *
  21   */
  22  
  23  /**
  24     \file       htdocs/energie/groupe.php
  25     \ingroup    energie
  26     \brief      Fiche groupe
  27     \version    $Revision: 1.1 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  
  32  /*
  33   *
  34   */    
  35  
  36  if ($_POST["action"] == 'add')
  37  {
  38    $groupe = new EnergieGroupe($db, $user);
  39  
  40    if ( $groupe->create($_POST["libelle"]) == 0)
  41      {
  42        Header("Location: groupe.php?id=".$groupe->id);
  43      }
  44    else
  45      {
  46        Header("Location: groupe.php?action=create");
  47      }
  48  }
  49  
  50  /*
  51   *
  52   */    
  53  
  54  llxHeader($langs, '',$langs->trans("Groupe"),"Groupe");
  55  
  56  /*********************************************************************
  57   *
  58   * Mode creation
  59   *
  60   *
  61   ************************************************************************/
  62  if ($_GET["action"] == 'create') 
  63  {
  64    $head[0][0] = DOL_URL_ROOT.'/energie/groupe.php?action=create';
  65    $head[0][1] = "Nouveau groupe";
  66    $h++;
  67    $a = 0;
  68  
  69    dolibarr_fiche_head($head, $a, $soc->nom);
  70  
  71    $html = new Form($db);
  72  
  73    print '<form action="groupe.php" method="post">';
  74    print '<input type="hidden" name="action" value="add">';
  75    
  76    print '<table class="border" width="100%">';
  77    print "<tr $bc[$var]>";
  78    print '<td>Libellé</td>';
  79    
  80    print '<td><input type="text" size="40" maxlength="255" name="libelle"></td></tr>';
  81    
  82    print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
  83    
  84    print "</table></form><br>";
  85        
  86    print '</div>';
  87    
  88  } 
  89  else 
  90  /* *************************************************************************** */
  91  /*                                                                             */
  92  /* Mode vue                                                                    */
  93  /*                                                                             */
  94  /* *************************************************************************** */
  95  {  
  96    if ($_GET["id"] > 0)
  97      {
  98        $groupe = new EnergieGroupe($db, $user);
  99        if ( $groupe->fetch($_GET["id"]) == 0)
 100      {      
 101        
 102        $head[0][0] = DOL_URL_ROOT.'/energie/groupe.php?id='.$commande->id;
 103        $head[0][1] = "Groupe";
 104        $h++;
 105        $a = 0;
 106  
 107        dolibarr_fiche_head($head, $a, $soc->nom);
 108              
 109        print '<table class="border" width="100%">';
 110        print "<tr><td>".$langs->trans("Groupe")."</td>";
 111        print '<td width="50%">';
 112        print $groupe->libelle;
 113        print "</td></tr>";            
 114        print "</table><br>";
 115                  
 116        /*
 117         *
 118         */      
 119  
 120  
 121        print '<table class="noborder" width="100%">';
 122  
 123        print '<tr><td align="center">';
 124        $file = "groupe.day.".$groupe->id.".png";
 125        print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
 126        print '</td><td align="center">';
 127        $file = "groupe.week.".$groupe->id.".png";
 128        print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
 129        print '</td></tr>';
 130  
 131        print '<tr><td align="center">';
 132        $file = "groupe.month.".$groupe->id.".png";
 133        print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
 134        print '</td><td align="center">';
 135        $file = "groupe.year.".$groupe->id.".png";
 136        print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
 137        print '</td></tr></table><br>';
 138  
 139        print '</div>';      
 140        print "<br>\n";
 141      }
 142        else
 143      {
 144        /* Commande non trouvée */
 145        print "Groupe inexistant";
 146      }
 147      }  
 148    else
 149      {
 150        print "Groupe inexistant";
 151      }
 152  }
 153  
 154  $db->close();
 155  
 156  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/23 13:31:59 $ r&eacute;vision $Revision: 1.1 $</em>");
 157  ?>


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