[ 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/ -> 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.9 2005/03/28 13:52:42 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/product/concert/fiche.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  llxHeader();
  27  
  28  if ($action == 'add') {
  29    $concert = new Concert($db);
  30  
  31    $concert->groupartid = $_POST["ga"];
  32    $concert->lieuid = $_POST["lc"];
  33    $concert->date = $db->idate(mktime(12, 0 , 0, $remonth, $reday, $reyear)); 
  34    $concert->description = $desc;
  35  
  36    $id = $concert->create($user);
  37  }
  38  
  39  if ($action == 'update') {
  40    $concert = new Concert($db);
  41  
  42    $concert->groupartid = $_POST["ga"];
  43    $concert->lieuid = $_POST["lc"];
  44    $concert->date = $db->idate(mktime(12, 0 , 0, $remonth, $reday, $reyear)); 
  45    $concert->description = $desc;
  46  
  47    $concert->update($id, $user);
  48  }
  49  
  50  if ($action == 'updateosc') {
  51    $concert = new Concert($db);
  52    $result = $concert->fetch($id);
  53  
  54    $concert->updateosc($user);
  55  }
  56  
  57  /*
  58   *
  59   *
  60   */
  61  if ($action == 'create')
  62  {
  63  
  64    print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
  65    print "<input type=\"hidden\" name=\"action\" value=\"add\">";
  66  
  67    print '<div class="titre">Nouveau concert</div><br>';
  68  
  69    $htmls = new Form($db);
  70        
  71    print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
  72  
  73    $ga = new Groupart($db);
  74  
  75    print "<tr><td>Date</td><td>";
  76    $htmls->select_date();
  77    print "</td></tr>";
  78  
  79    print "<tr><td>Lieu</td><td>";
  80    $htmls->select_array("ga",  $ga->liste_array());
  81    print '</td></tr>';
  82  
  83    $lc = new LieuConcert($db);
  84  
  85    print "<tr><td>Lieu</td><td>";
  86    $htmls->select_array("lc",  $lc->liste());
  87    print '<a href="fichelieu.php?action=create">Nouveau lieu</a></td></tr>';
  88  
  89    print '<tr><td>&nbsp;</td><td><input type="submit" value="Créer"></td></tr>';
  90    print '</table>';
  91    print '</form>';
  92        
  93  
  94  }
  95  else
  96  {
  97    if ($id)
  98      {
  99  
 100        $concert = new Concert($db);
 101        $result = $concert->fetch($id);
 102  
 103        $groupart = new Groupart($db);
 104        $result = $groupart->fetch($concert->groupartid);
 105  
 106        $lieuconcert = new LieuConcert($db);
 107        $result = $lieuconcert->fetch($concert->lieuid);
 108  
 109        if ( $result )
 110      { 
 111        print '<div class="titre">Fiche Concert : '.$concert->titre.'</div><br>';
 112        
 113        print '<table border="1" width="50%" cellspacing="0" cellpadding="4">';
 114        print "<tr>";
 115        print "<td>Date</td><td>".strftime("%A %d %B %Y",$concert->date)."</td>\n";
 116  
 117        print '<tr><td valign="top">Artiste/Groupe</td><td valign="top">'.$groupart->nom_url."</td>";
 118  
 119        print '<tr><td valign="top">Lieu</td><td valign="top">'.$lieuconcert->nom_url."</td>";
 120  
 121        print '<tr><td valign="top">'.$langs->trans("Description").'</td><td valign="top">'.nl2br($concert->description)."</td>";
 122        
 123  
 124        print "</table>";
 125      }
 126      
 127        if ($action == 'edit')
 128      {
 129        print '<hr><div class="titre">Edition de la fiche Concert : '.$concert->titre.'</div><br>';
 130  
 131        print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
 132        print "<input type=\"hidden\" name=\"action\" value=\"update\">";
 133        
 134        print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
 135        print "<tr>";
 136        print '<td>'.$langs->trans("Ref").'</td><td><input name="ref" size="20" value="'.$concert->ref.'"></td></tr>';
 137        print '<td>'.$langs->trans("Label").'</td><td><input name="titre" size="40" value="'.$concert->titre.'"></td></tr>';
 138        print '<tr><td>'.$langs->trans("Price").'</td><TD><input name="price" size="10" value="'.$concert->price.'"></td></tr>';    
 139        print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
 140        print '<textarea name="desc" rows="8" cols="50">';
 141        print $concert->description;
 142        print "</textarea></td></tr>";
 143  
 144  
 145  
 146        print '</form>';
 147        print '</table>';
 148  
 149      }    
 150      }
 151    else
 152      {
 153        print "Error";
 154      }
 155  }
 156  
 157  /* ************************************************************************** */
 158  /*                                                                            */ 
 159  /* Barre d'action                                                             */ 
 160  /*                                                                            */ 
 161  /* ************************************************************************** */
 162  
 163  print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">';
 164  print '<td width="20%" align="center">-</td>';
 165  
 166  print '<td width="20%" align="center">[<a href="fiche.php?action=updateosc&id='.$id.'">Update Osc</a>]</td>';
 167  
 168  print '<td width="20%" align="center">-</td>';
 169  
 170  if ($action == 'create')
 171  {
 172    print '<td width="20%" align="center">-</td>';
 173  }
 174  else
 175  {
 176    print '<td width="20%" align="center">[<a href="fiche.php?action=edit&id='.$id.'">'.$langs->trans("Edit").'</a>]</td>';
 177  }
 178  print '<td width="20%" align="center">-</td>';    
 179  print '</table><br>';
 180  
 181  
 182  
 183  $db->close();
 184  
 185  llxFooter("<em>Derni&egrave;re modification $Date: 2005/03/28 13:52:42 $ r&eacute;vision $Revision: 1.9 $</em>");
 186  ?>


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