From b4c8aa4f4a7f92baea1cd1ba523006fe90369c3e Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 13 Jul 2004 16:55:03 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20possibilt=E9=20de=20supprimer=20un=20fo?= =?UTF-8?q?urnisseur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/fiche.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 24fa6740d55..0b36f43f200 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -93,10 +93,10 @@ if ($_POST["action"] == 'addinfacture' && $mesg .= ''.$facture->ref.''; } -if ($_POST["action"] == 'add_fourn' && $cancel <> 'Annuler') +if ($_POST["action"] == 'add_fourn' && $_POST["cancel"] <> 'Annuler') { $product = new Product($db); - if( $product->fetch($id) ) + if( $product->fetch($_GET["id"]) ) { if ($product->add_fournisseur($user, $_POST["id_fourn"], $_POST["ref_fourn"]) > 0) { @@ -108,9 +108,23 @@ if ($_POST["action"] == 'add_fourn' && $cancel <> 'Annuler') $action = ''; } } - } - +if ($_GET["action"] == 'remove_fourn') +{ + $product = new Product($db); + if( $product->fetch($_GET["id"]) ) + { + if ($product->remove_fournisseur($user, $_GET["id_fourn"]) > 0) + { + $action = ''; + $mesg = 'Founisseur supprimé'; + } + else + { + $action = ''; + } + } +} if ($_POST["action"] == 'update' && $cancel <> 'Annuler' && @@ -313,7 +327,10 @@ else $objp = $db->fetch_object( $i); $var=!$var; print ""; - print ''.$objp->nom.''; + print ''.$objp->nom.''; + print ''; + print ''; + print ''; $i++; } print ''; @@ -391,10 +408,10 @@ else * Ajouter un fournisseur * */ - if ($action == 'ajout_fourn' && $user->rights->produit->creer) + if ($_GET["action"] == 'ajout_fourn' && $user->rights->produit->creer) { print_titre ("Ajouter un fournisseur"); - print "
\n"; + print ''; print ''; print ''; print '
Fournisseurs