Exemple #1
0
require("../../main.inc.php");
require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.product.class.php";


if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();

if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
{

	$product = new ProductFournisseur($db);
	$result = $product->fetch($_GET["id"], $_GET["id_fourn"]);

	if( $result == 0 )
	{
		$product->update($_POST["fourn_ref"], '1', $_POST["price"], $user);
	}

	Header('Location :fourn.php?id='.$product->id.'&id_fourn='.$_GET["id_fourn"]);
}



llxHeader("","",$langs->trans("CardProduct0"));

/*
 * Fiche produit
 */
if ($_GET["id"])
{
	if ($_GET["action"] <> 're-edit')