[ 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/boutique/notification/ -> fiche.php (source)

   1  <?php
   2  /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program; if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18   *
  19   * $Id: fiche.php,v 1.6 2004/10/19 20:19:58 opensides Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/boutique/notification/fiche.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  llxHeader();
  27  
  28  if ($action == 'add') {
  29    $editeur = new Editeur($db);
  30  
  31    $editeur->nom = $nom;
  32  
  33    $id = $editeur->create($user);
  34  }
  35  
  36  if ($action == 'addga') {
  37    $editeur = new Editeur($db);
  38  
  39    $editeur->linkga($id, $ga);
  40  }
  41  
  42  
  43  if ($action == 'update' && !$cancel) {
  44    $editeur = new Editeur($db);
  45  
  46    $editeur->nom = $nom;
  47  
  48    $editeur->update($id, $user);
  49  }
  50  
  51  /*
  52   *
  53   *
  54   */
  55  if ($action == 'create')
  56  {
  57  
  58    print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
  59    print '<input type="hidden" name="action" value="add">';
  60  
  61    print '<div class="titre">Nouvel Editeur</div><br>';
  62        
  63    print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
  64    print "<tr>";
  65    print '<td>Nom</td><td><input name="nom" size="40" value=""></td></tr>';
  66    print '<tr><td>&nbsp;</td><td><input type="submit" value="Créer"></td></tr>';
  67    print '</table>';
  68    print '</form>';
  69        
  70  
  71  }
  72  else
  73  {
  74    if ($id)
  75      {
  76  
  77        $editeur = new Editeur($db);
  78        $result = $editeur->fetch($id);
  79  
  80        if ( $result )
  81      { 
  82        if ($action == 'edit')
  83          {
  84            print '<div class="titre">Edition de la fiche Editeur : '.$editeur->titre.'</div><br>';
  85            
  86            print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
  87            print '<input type="hidden" name="action" value="update">';
  88            
  89            print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
  90            print "<tr>";
  91            print '<td width="20%">Nom</td><td><input name="nom" size="40" value="'.$editeur->nom.'"></td>';
  92  
  93  
  94            print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Save").'">&nbsp;<input type="submit" value="'.$langs->trans("Cancel").'" name="cancel"></td></tr>';
  95            
  96            print '</form>';
  97  
  98            print '</table><hr>';
  99            
 100          }    
 101  
 102        print '<div class="titre">Fiche Editeur : '.$editeur->titre.'</div><br>';
 103  
 104        print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
 105        print "<tr>";
 106        print '<td width="20%">Nom</td><td width="30%">'.$editeur->nom.'</td></tr>';
 107        print "</table>";
 108  
 109  
 110  
 111      }
 112        else
 113      {
 114        print "Fetch failed";
 115      }
 116      
 117  
 118      }
 119    else
 120      {
 121        print "Error";
 122      }
 123  }
 124  
 125  /* ************************************************************************** */
 126  /*                                                                            */ 
 127  /* Barre d'action                                                             */ 
 128  /*                                                                            */ 
 129  /* ************************************************************************** */
 130  
 131  
 132  print '<div class="tabsAction">';
 133  if ($action != 'create')
 134  {
 135    print '<a class="tabAction" href="fiche.php?action=edit&id='.$id.'">'.$langs->trans("Edit").'</a>';
 136  }
 137  print '</div>';
 138  
 139  
 140  $db->close();
 141  
 142  llxFooter("<em>Derni&egrave;re modification $Date: 2004/10/19 20:19:58 $ r&eacute;vision $Revision: 1.6 $</em>");
 143  ?>


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