* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ * */ require("./pre.inc.php"); $mesg = ''; llxHeader("","","Fiche entrepôt"); if ($HTTP_POST_VARS["action"] == 'add') { $entrepot = new Entrepot($db); $entrepot->ref = $HTTP_POST_VARS["ref"]; $entrepot->libelle = $HTTP_POST_VARS["libelle"]; $entrepot->description = $HTTP_POST_VARS["desc"]; $entrepot->statut = $HTTP_POST_VARS["statut"]; $id = $entrepot->create($user); $action = ''; } if ($HTTP_POST_VARS["action"] == 'update' && $cancel <> 'Annuler') { $entrepot = new Entrepot($db); if ($entrepot->fetch($id)) { $entrepot->libelle = $HTTP_POST_VARS["libelle"]; $entrepot->description = $HTTP_POST_VARS["desc"]; $entrepot->statut = $HTTP_POST_VARS["statut"]; if ( $entrepot->update($id, $user)) { $action = ''; $mesg = 'Fiche mise à jour'; } else { $action = 're-edit'; $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error; } } else { $action = 're-edit'; $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error; } } if ($cancel == 'Annuler') { $action = ''; } /* * Affichage * */ if ($_GET["action"] == 'create') { print "
\n"; print ''; print ''."\n"; print_titre("Nouvel entrepôt"); print ''; print ''; print '"; print ''; print ''; print '
Libellé
Description'; print '
Statut'; print '
 
'; print '
'; } else { if ($id) { if ($action <> 're-edit') { $entrepot = new Entrepot($db); $result = $entrepot->fetch($id); } if ( $result ) { if ($action <> 'edit' && $action <> 're-edit') { print_fiche_titre('Fiche entrepot', $mesg); print ''; print ''; print ""; print ''; print '"; print "
Libellé'.$entrepot->libelle.'
Description".nl2br($entrepot->description)."
statut'.$entrepot->statuts[$entrepot->statut].'
Nb de produits'; print $entrepot->nb_products(); print "
"; } } if (($action == 'edit' || $action == 're-edit') && 1) { print_fiche_titre('Edition de la fiche entrepot', $mesg); print "
\n"; print ''; print ''; print ''; print '"; print ''; print "".''; print '
Libellé
Description'; print '
Statut'; print '
 '; print '
'; print '
'; } } else { print "Error"; } } /* ************************************************************************** */ /* */ /* Barre d'action */ /* */ /* ************************************************************************** */ print '
'; if ($action == '') { if ($user->rights->produit->modifier || $user->rights->produit->creer) { print ''; } else { print ''; } } else { print ''; } print ''; print ''; if ($action == '') { if (1) { print ''; } else { print ''; } } else { print ''; } print ''; print '
[Changer le prix]----[Editer]---

'; $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>