Example #1
0
{
	$product =	new	Product($db);
	$product->fetch($_GET["id"]);
	$product->barcode_type = $_POST['barcodetype_id'];
	$result = $product->update_barcode_type($user);
	Header("Location: barcode.php?id=".$_GET["id"]);
	exit;
}

// Modification du code barre
if ($_POST['action'] ==	'setbarcode'	&& $user->rights->barcode->creer)
{
	$product =	new	Product($db);
	$product->fetch($_GET["id"]);
	$product->barcode = $_POST['barcode']; //Todo: ajout verification de la validite du code barre en fonction du type
	$result = $product->update_barcode($user);
	Header("Location: barcode.php?id=".$_GET["id"]);
	exit;
}


/*
 *   View
 */

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

$html = new Form($db);
$formbarcode = new FormBarCode($db);

$product = new Product($db);