Skip to content
Snippets Groups Projects
Select Git revision
  • 91d3b525e85349c73acdbfa3312d07e5ebbf6c4c
  • 3.9 default
  • develop
  • 6.0
  • 5.0
  • 4.0
  • scrutinizer-patch-4
  • scrutinizer-patch-3
  • scrutinizer-patch-2
  • scrutinizer-patch-1
  • 3.7
  • 3.8
  • 3.6
  • 3.9_backported
  • 3.8_backported
  • 3.7_backported
  • 3.5
  • 3.6_backported
  • 3.5_backported
  • 3.4
  • 3.3_backported
  • 6.0.4
  • 6.0.3
  • 5.0.7
  • 6.0.2
  • 6.0.1
  • 5.0.6
  • 6.0.0
  • 5.0.5
  • 6.0.0-rc
  • 5.0.4
  • 6.0.0-beta
  • 5.0.3
  • 4.0.6
  • 5.0.2
  • 5.0.1
  • 4.0.5
  • 5.0.0
  • 4.0.4
  • 5.0.0-rc2
  • 5.0.0-rc1
41 results

groupe.php

  • groupe.php 4.22 KiB
    <?php
    /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
     *
     * 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
     * the Free Software Foundation; either version 2 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     *
     * $Id$
     * $Source$
     *
     */
    
    /**
       \file       htdocs/energie/groupe.php
       \ingroup    energie
       \brief      Fiche groupe
       \version    $Revision$
    */
    
    require("./pre.inc.php");
    
    /*
     *
     */	
    
    if ($_POST["action"] == 'add')
    {
      $groupe = new EnergieGroupe($db, $user);
    
      if ( $groupe->create($_POST["libelle"]) == 0)
        {
          Header("Location: groupe.php?id=".$groupe->id);
        }
      else
        {
          Header("Location: groupe.php?action=create");
        }
    }
    
    /*
     *
     */	
    
    llxHeader($langs, '',$langs->trans("Groupe"),"Groupe");
    
    /*********************************************************************
     *
     * Mode creation
     *
     *
     ************************************************************************/
    if ($_GET["action"] == 'create') 
    {
      $head[0][0] = DOL_URL_ROOT.'/energie/groupe.php?action=create';
      $head[0][1] = "Nouveau groupe";
      $h++;
      $a = 0;
    
      dolibarr_fiche_head($head, $a, $soc->nom);
    
      $html = new Form($db);
    
      print '<form action="groupe.php" method="post">';
      print '<input type="hidden" name="action" value="add">';
      
      print '<table class="border" width="100%">';
      print "<tr $bc[$var]>";
      print '<td>Libell</td>';
      
      print '<td><input type="text" size="40" maxlength="255" name="libelle"></td></tr>';
      
      print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
      
      print "</table></form><br>";
    	  
      print '</div>';
      
    } 
    else 
    /* *************************************************************************** */
    /*                                                                             */
    /* Mode vue                                                                    */
    /*                                                                             */
    /* *************************************************************************** */
    {  
      if ($_GET["id"] > 0)
        {
          $groupe = new EnergieGroupe($db, $user);
          if ( $groupe->fetch($_GET["id"]) == 0)
    	{	  
    	  
    	  $head[0][0] = DOL_URL_ROOT.'/energie/groupe.php?id='.$commande->id;
    	  $head[0][1] = "Groupe";
    	  $h++;
    	  $a = 0;
    
    	  dolibarr_fiche_head($head, $a, $soc->nom);
    	  	  
    	  print '<table class="border" width="100%">';
    	  print "<tr><td>".$langs->trans("Groupe")."</td>";
    	  print '<td width="50%">';
    	  print $groupe->libelle;
    	  print "</td></tr>";	  	  
    	  print "</table><br>";
    	  	      
    	  /*
    	   *
    	   */	  
    
    
    	  print '<table class="noborder" width="100%">';
    
    	  print '<tr><td align="center">';
    	  $file = "groupe.day.".$groupe->id.".png";
    	  print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
    	  print '</td><td align="center">';
    	  $file = "groupe.week.".$groupe->id.".png";
    	  print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
    	  print '</td></tr>';
    
    	  print '<tr><td align="center">';
    	  $file = "groupe.month.".$groupe->id.".png";
    	  print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
    	  print '</td><td align="center">';
    	  $file = "groupe.year.".$groupe->id.".png";
    	  print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=energie&file='.$file.'" alt="" title="">';
    	  print '</td></tr></table><br>';
    
    	  print '</div>';	  
    	  print "<br>\n";
    	}
          else
    	{
    	  /* Commande non trouve */
    	  print "Groupe inexistant";
    	}
        }  
      else
        {
          print "Groupe inexistant";
        }
    }
    
    $db->close();
    
    llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
    ?>