[ 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/postnuke/articles/ -> 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.11 2005/07/02 12:16:34 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/postnuke/articles/fiche.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  require ("./pnarticle.class.php");
  26  
  27  
  28  if ($action == 'update' && !$cancel)
  29  {
  30    $article = new pnArticle($db);
  31  
  32    $article->titre = $_POST["titre"];
  33    $article->body = $_POST["body"];
  34    if ($article->update($id, $user))
  35      {
  36  
  37      }
  38    else
  39      {
  40        $action = 'edit';
  41      }
  42  }
  43  
  44  /*
  45   *
  46   *
  47   */
  48  
  49  llxHeader();
  50  
  51  if ($id)
  52  {
  53    $article = new pnArticle($db);
  54  
  55    if ($id)
  56      {
  57        $result = $article->fetch($id, 0);
  58      }
  59    
  60    if ( $result )
  61      { 
  62        $htmls = new Form($db);
  63  
  64  
  65  
  66        if ($action == 'edit')
  67      {
  68        print_titre ("Edition de la fiche article");
  69        
  70        print "<form action=\"$fiche.php?id=$id\" method=\"post\">\n";
  71        print "<input type=\"hidden\" name=\"action\" value=\"update\">";
  72        
  73        print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
  74        print "<tr><td>Titre</td><td>$article->titre</td></tr>\n";
  75        print "<tr>";
  76        print '<td valign="top">'.$langs->trans("Description").'</td>';
  77        
  78        print '<td valign="top" width="80%"><textarea name="body" rows="14" cols="60">';
  79        print str_replace("<br />","",$article->body);
  80        print "</textarea></td></tr>";
  81        
  82        print '<tr><td align="center" colspan="2"><input type="submit" value="'.$langs->trans("Save").'">&nbsp;<input type="submit" value="'.$langs->trans("Cancel").'" name="cancel"></td></tr>';
  83        print "</form>";
  84        
  85  
  86        print '</table><hr>';
  87            
  88          }    
  89  
  90        /*
  91         * Affichage
  92         */
  93        print_fiche_titre('Fiche Article : '.$article->titre);
  94  
  95        print '<table class="border" width="100%">';
  96        
  97        print "<tr><td>Titre</td><td>$article->titre</td></tr>\n";
  98        print "<tr><td>Titre</td><td>$article->body</td></tr>\n";
  99  
 100        
 101        print "</table>";
 102      }
 103        else
 104      {
 105        print "Fetch failed";
 106      }
 107      
 108  
 109      }
 110    else
 111      {
 112        print "Error";
 113      }
 114  
 115  
 116  /* ************************************************************************** */
 117  /*                                                                            */ 
 118  /* Barre d'action                                                             */ 
 119  /*                                                                            */ 
 120  /* ************************************************************************** */
 121  
 122  print '<div class="tabsAction">';
 123  if ($action != 'create')
 124  {
 125    print '<a class="tabAction" href="fiche.php?action=edit&id='.$id.'">'.$langs->trans('Edit').'</a>';
 126  }
 127  print '</div>';
 128  
 129  $db->close();
 130  
 131  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/02 12:16:34 $ r&eacute;vision $Revision: 1.11 $</em>");
 132  ?>


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