[ 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/admin/ -> energie.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: energie.php,v 1.1 2005/07/31 12:36:55 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/admin/energie.php,v $
  20   */
  21   
  22  /**        \file       htdocs/admin/energie.php
  23          \ingroup    energie
  24          \brief      Page d'administration/configuration du module de gestion de l'energie
  25          \version    $Revision: 1.1 $
  26  */
  27  
  28  require ("./pre.inc.php");
  29  
  30  $langs->load("admin");
  31  
  32  if (!$user->admin)
  33    accessforbidden();
  34  
  35  
  36  if ($_POST["action"] == 'setvalue' && $user->admin)
  37  {
  38    $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'JPGRAPH_DIR'";
  39  
  40    $db->query($sql);
  41  
  42    $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible)";
  43    $sql .= " VALUES ('JPGRAPH_DIR','".$_POST["url"]."',0)";
  44      
  45    if ($db->query($sql))
  46      {
  47        Header("Location: energie.php");
  48      }
  49    else
  50      {
  51        dolibarr_print_error($db);
  52      }
  53  }
  54  
  55  llxHeader();
  56  
  57  /*
  58   *
  59   *
  60   */
  61  
  62  print_titre($langs->trans("Energy"));
  63  
  64  print '<br>';
  65  print '<form method="post" action="energie.php">';
  66  print '<input type="hidden" name="action" value="setvalue">';
  67  print '<table class="border">';
  68  print '<tr class="liste_titre">';
  69  print '<td>'.$langs->trans("Name").'</td>';
  70  print '<td>'.$langs->trans("NewValue").'</td><td>'.$langs->trans("CurrentValue").'</td>';
  71  print "</tr>\n";
  72  print '<tr><td>';
  73  print $langs->trans("Emplacement de la librairie JpGraph").'</td><td>';
  74  print '<input size="45" type="text" name="url" value="'.JPGRAPH_DIR.'">';
  75  print '</td><td>';
  76  print JPGRAPH_DIR;
  77  print '</td></tr>';
  78  
  79  print '<tr><td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Modify").'"></td></tr>';
  80  print '</table></form>';
  81  
  82  $db->close();
  83  
  84  llxFooter();
  85  ?>


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