[ 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/product/concert/ -> fichelieu.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: fichelieu.php,v 1.7 2004/10/20 20:06:49 opensides Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/product/concert/fichelieu.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  llxHeader();
  27  
  28  if ($action == 'add') {
  29    $lieuconcert = new LieuConcert($db);
  30  
  31    $lieuconcert->nom = $nom;
  32    $lieuconcert->ville = $ville;
  33    $lieuconcert->description = $desc;
  34  
  35    $id = $lieuconcert->create($user);
  36  }
  37  
  38  if ($action == 'update') {
  39    $lieuconcert = new LieuConcert($db);
  40  
  41    $lieuconcert->nom = $nom;
  42    $lieuconcert->ville = $ville;
  43    $lieuconcert->description = $desc;
  44  
  45    $lieuconcert->update($id, $user);
  46  }
  47  
  48  if ($action == 'updateosc') {
  49    $lieuconcert = new LieuConcert($db);
  50    $result = $lieuconcert->fetch($id);
  51  
  52    $lieuconcert->updateosc($user);
  53  }
  54  
  55  /*
  56   *
  57   *
  58   */
  59  if ($action == 'create')
  60  {
  61  
  62    print "<form action=\"fichelieu.php?id=$id\" method=\"post\">\n";
  63    print "<input type=\"hidden\" name=\"action\" value=\"add\">";
  64  
  65    print '<div class="titre">Nouveau lieu de concert</div><br>';
  66        
  67    print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
  68    print "<tr>";
  69    print '<td>Nom</td><td><input name="nom" size="40" value=""></td></tr>';
  70    print '<td>Ville</td><td><input name="ville" size="40" value=""></td></tr>';
  71    print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
  72    print '<textarea name="desc" rows="8" cols="50">';
  73    print "</textarea></td></tr>";
  74    print '<tr><td>&nbsp;</td><td><input type="submit" value="Créer"></td></tr>';
  75    print '</table>';
  76    print '</form>';
  77        
  78  
  79  }
  80  else
  81  {
  82    if ($id)
  83      {
  84  
  85        $lieuconcert = new LieuConcert($db);
  86        $result = $lieuconcert->fetch($id);
  87  
  88        if ( $result )
  89      { 
  90        print '<div class="titre">Fiche lieu de concert : '.$lieuconcert->nom.'</div><br>';
  91        
  92        print '<table border="1" width="50%" cellspacing="0" cellpadding="4">';
  93        print "<tr><td>Nom</td><td>$lieuconcert->nom</td></tr>\n";
  94        print "<tr><td>Ville</td><td>$lieuconcert->ville</td></tr>\n";
  95        print '<tr><td valign="top">'.$langs->trans("Description").'</td><td valign="top">';
  96        print nl2br($lieuconcert->description)."</td></tr>";
  97  
  98        print "</table>";
  99      }
 100      
 101        if ($action == 'edit')
 102      {
 103        print '<hr><div class="titre">Edition de la fiche lieu de concert : '.$lieuconcert->nom.'</div><br>';
 104  
 105        print "<form action=\"fichelieu.php?id=$id\" method=\"post\">\n";
 106        print "<input type=\"hidden\" name=\"action\" value=\"update\">";
 107        
 108        print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
 109        print '<tr><td>Nom</td><td><input name="nom" size="40" value="'.$lieuconcert->nom.'"></td></tr>';
 110        print '<tr><td>Ville</td><td><input name="ville" size="40" value="'.$lieuconcert->ville.'"></td></tr>';
 111        print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
 112        print '<textarea name="desc" rows="8" cols="50">';
 113        print $lieuconcert->description;
 114        print "</textarea></td></tr>";
 115        print '<tr><td>&nbsp;</td><td><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
 116        print '</form>';
 117        print '</table>';
 118  
 119      }    
 120      }
 121    else
 122      {
 123        print "Error";
 124      }
 125  }
 126  
 127  /* ************************************************************************** */
 128  /*                                                                            */ 
 129  /* Barre d'action                                                             */ 
 130  /*                                                                            */ 
 131  /* ************************************************************************** */
 132  
 133  print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">';
 134  print '<td width="20%" align="center">-</td>';
 135  print '<td width="20%" align="center">-</td>';
 136  print '<td width="20%" align="center">-</td>';
 137  
 138  if ($action == 'create')
 139  {
 140    print '<td width="20%" align="center">-</td>';
 141  }
 142  else
 143  {
 144    print '<td width="20%" align="center">[<a href="fichelieu.php?action=edit&id='.$id.'">'.$langs->trans("Edit").'</a>]</td>';
 145  }
 146  print '<td width="20%" align="center">-</td>';    
 147  print '</table><br>';
 148  
 149  
 150  
 151  $db->close();
 152  
 153  llxFooter("<em>Derni&egrave;re modification $Date: 2004/10/20 20:06:49 $ r&eacute;vision $Revision: 1.7 $</em>");
 154  ?>


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