[ Index ] |
|
Code source de Dolibarr 2.0.1 |
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.12 2005/07/02 12:16:34 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/product/album/fiche.php,v $ 21 * 22 */ 23 require ("./pre.inc.php"); 24 25 llxHeader(); 26 27 if ($action == 'add') { 28 $album = new Album($db); 29 30 $album->titre = $titre; 31 $album->ref = $ref; 32 $album->annee = $annee; 33 $album->description = $desc; 34 35 $id = $album->create($user); 36 } 37 38 if ($action == 'addga') { 39 $album = new Album($db); 40 41 $album->linkga($id, $ga); 42 } 43 44 45 if ($action == 'update') { 46 $album = new Album($db); 47 48 $album->titre = $titre; 49 $album->ref = $ref; 50 $album->annee = $annee; 51 $album->description = $desc; 52 53 $album->update($id, $user); 54 } 55 56 if ($action == 'updateosc') { 57 $album = new Album($db); 58 $result = $album->fetch($id); 59 60 $album->updateosc($user); 61 } 62 63 /* 64 * 65 * 66 */ 67 if ($action == 'create') 68 { 69 70 print "<form action=\"fiche.php?id=$id\" method=\"post\">\n"; 71 print "<input type=\"hidden\" name=\"action\" value=\"add\">"; 72 73 print_fiche_titre($langs->trans("NewAlbum")); 74 75 print '<table class="border" width="100%">'; 76 print "<tr>"; 77 print '<td>'.$langs->trans("Ref").'</td><td><input name="ref" size="20" value=""></td></tr>'; 78 print '<td>Titre</td><td><input name="titre" size="40" value=""></td></tr>'; 79 print '<tr><td>'.$langs->trans("Price").'</td><td><input name="price" size="10" value=""></td></tr>'; 80 print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>'; 81 print '<textarea name="desc" rows="8" cols="50">'; 82 print "</textarea></td></tr>"; 83 print '<tr><td> </td><td><input type="submit" value="Créer"></td></tr>'; 84 print '</table>'; 85 print '</form>'; 86 87 88 } 89 else 90 { 91 if ($id) 92 { 93 94 $album = new Album($db); 95 $result = $album->fetch($id); 96 97 if ( $result ) 98 { 99 100 $gas = $album->liste_groupart(); 101 102 103 print_fiche_titre('Fiche Album : '.$album->titre); 104 105 print '<table class="border" width="100%">'; 106 print "<tr>"; 107 print '<td width="20%">'.$langs->trans("Ref").'</td><td width="30%">'.$album->ref.'</td>'; 108 print '<td width="50%" valign="top">'.$langs->trans("Description").'</td></tr>'; 109 110 print '<tr><td>'.$langs->trans("Status")."</td><td>$album->status</td>\n"; 111 print '<td rowspan="6" valign="top">'.nl2br($album->description)."</td>"; 112 print "<tr><td>Titre</td><td>$album->titre</td></tr>\n"; 113 print "<tr><td>Annee</td><td>$album->annee</td></tr>\n"; 114 print '<tr><td>'.$langs->trans("Price").'</td><TD>'.price($album->price).'</td></tr>'; 115 116 print '<td valign="top">Artiste/Groupe</td><td>'; 117 foreach ($gas as $key => $value) 118 { 119 print '<a href="../groupart/fiche.php?id='.$key.'">'.$value."</a><br>"; 120 } 121 print "</td></tr>\n"; 122 123 print "</table>"; 124 125 126 if ($action == 'edit') 127 { 128 print_fiche_titre('Edition de la fiche Album : '.$album->titre); 129 130 print "<form action=\"fiche.php?id=$id\" method=\"post\">\n"; 131 print "<input type=\"hidden\" name=\"action\" value=\"update\">"; 132 133 print '<table border="1" width="100%" cellspacing="0" cellpadding="4">'; 134 print "<tr>"; 135 print '<td width="20%">'.$langs->trans("Ref").'</td><td><input name="ref" size="20" value="'.$album->ref.'"></td>'; 136 print '<td valign="top">'.$langs->trans("Description").'</td></tr>'; 137 138 print '<td>Titre</td><td><input name="titre" size="40" value="'.$album->titre.'"></td>'; 139 print '<td valign="top" width="50%" rowspan="3"><textarea name="desc" rows="8" cols="50">'; 140 print $album->description; 141 print "</textarea></td></tr>"; 142 143 print '<tr><td>Année</td><TD><input name="annee" size="6" maxlenght="4" value="'.$album->annee.'"></td></tr>'; 144 print '<tr><td>'.$langs->trans("Price").'</td><TD><input name="price" size="10" value="'.$album->price.'"></td></tr>'; 145 146 print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Save").'"></td></tr>'; 147 148 print '</form>'; 149 150 $htmls = new Form($db); 151 $ga = new Groupart($db); 152 153 print "<form action=\"fiche.php?id=$id\" method=\"post\">\n"; 154 print "<input type=\"hidden\" name=\"action\" value=\"addga\">"; 155 156 foreach ($gas as $key => $value) 157 { 158 print '<tr><td>Artiste/Groupe</td>'; 159 print '<td><a href="../groupart/fiche.php?id='.$key.'">'.$value."</td></tr>\n"; 160 } 161 162 print "<tr><td>Artiste/Groupe</td><td>"; 163 $htmls->select_array("ga", $ga->liste_array()); 164 print "</td></tr>"; 165 print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Add").'"></td></tr>'; 166 print "</form>"; 167 print '</table>'; 168 169 } 170 171 } 172 else 173 { 174 print "Fetch failed"; 175 } 176 177 178 } 179 else 180 { 181 print "Error"; 182 } 183 } 184 185 /* ************************************************************************** */ 186 /* */ 187 /* Barre d'action */ 188 /* */ 189 /* ************************************************************************** */ 190 191 print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">'; 192 print '<td width="20%" align="center">-</td>'; 193 194 print '<td width="20%" align="center">[<a href="fiche.php?action=updateosc&id='.$id.'">Update Osc</a>]</td>'; 195 196 print '<td width="20%" align="center">-</td>'; 197 198 if ($action == 'create') 199 { 200 print '<td width="20%" align="center">-</td>'; 201 } 202 else 203 { 204 print '<td width="20%" align="center">[<a href="fiche.php?action=edit&id='.$id.'">'.$langs->trans("Edit").'</a>]</td>'; 205 } 206 print '<td width="20%" align="center">-</td>'; 207 print '</table><br>'; 208 209 210 211 $db->close(); 212 213 llxFooter("<em>Dernière modification $Date: 2005/07/02 12:16:34 $ révision $Revision: 1.12 $</em>"); 214 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |