Wat is de naam van het product?"; } elseif(empty($_POST[CategoryInfo])) { $add_error = "
Selecteer een product categorie.
"; } elseif(empty($NewPrice)) { $add_error = "
Wat is de prijs van het product?
"; } else { $t = time(); if(!empty($ImageName)) { $NewImageName = "$t$ImageName"; copy($_FILES[ProductImage][tmp_name], "../items_images/$NewImageName"); } $q1 = "insert into oneshop_producten set ItemName = '$MyProductName', ItemCategory = '$NewCategoryInfo[0]', ItemSubcategory = '$NewCategoryInfo[1]', ItemDescription = '$NewDesc', ItemPrice = '$NewPrice', ItemShipping = '$NewShipping', ItemImage = '$NewImageName', ProductStatus = 'unapproved', AddDate = '$t' "; mysql_query($q1) or die(mysql_error()); $qn = mysql_query("select last_insert_id()") or die(mysql_error()); $an = mysql_fetch_array($qn); $LastID = $an[0]; $q1 = "select CategoryName from oneshop_categories where CategoryID = '$NewCategoryInfo[0]' "; $r1 = mysql_query($q1) or die(mysql_error()); $a1 = mysql_fetch_array($r1); $DisplayCategory = $a1[0]; if(! empty($NewCategoryInfo[1])) { $q2 = "select SubcategoryName from devbg_subcategories where SubcategoryID = '$NewCategoryInfo[1]' "; $r2 = mysql_query($q2) or die(mysql_error()); $a2 = mysql_fetch_array($r2); $DisplayCategory .= " / $a2[0]"; } ?>
"; } else { echo " "; } ?>
Categorie:
Prijs: Euro



Het product werd succesvol toegevoegd.
"; } if($_POST[s2] == "Delete" ) { mysql_query("delete from oneshop_producten where ItemID = '$_POST[ItemID]' ") or die(mysql_error()); if(!empty($_POST[NewImageName])) { unlink("items_images/$_POST[NewImageName]"); } } } $q1 = "select * from oneshop_categories order by CategoryName "; $r1 = mysql_query($q1); if(!$r1) { header("location:../foutmelding.php"); } else { if(mysql_num_rows($r1) == '0') { echo "

U moet eerst minstens één categorie aanmaken voor je een product kunt toevoegen.
"; exit(); } else { $MySelect = ""; } } ?>
Een nieuw product toevoegen
Product naam:
Categorie:
Beschrijving:
Afbeelding:
Prijs verzending:
Product prijs: