require_once("../database.php");
require_once("adminfuncties.php");
require_once("subcat_navigatie.php");
if(isset($_POST[s1]))
{
if(!empty($_POST[DelInfo]))
{
$MyInfo = explode("|", $_POST[DelInfo]);
$q1 = "select * from oneshop_producten where ItemSubcategory = '$MyInfo[0]' ";
$r1 = mysql_query($q1) or die(mysql_error());
while($a1 = mysql_fetch_array($r1))
{
if(!empty($a1[ItemImage]))
{
unlink("../items_images/$a1[ItemImage]");
}
}
$q2 = "delete from oneshop_producten where ItemSubcategory = '$MyInfo[0]' ";
mysql_query($q2) or die(mysql_error());
$q3 = "delete from devbg_subcategories where SubcategoryID = '$MyInfo[0]' ";
mysql_query($q3) or die(mysql_error());
echo "
De sub-categorie $MyInfo[1] / $MyInfo[2] werd succesvol verwijderd.";
}
}
$q1 = "select * from oneshop_categories order by CategoryName ";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
echo "Er zijn geen sub-categories aanwezig...";
exit();
}
else
{
while($a1 = mysql_fetch_array($r1))
{
$q2 = "select * from devbg_subcategories where CategoryID = '$a1[CategoryID]' order by SubcategoryName ";
$r2 = mysql_query($q2) or die(mysql_error());
while($a2 = mysql_fetch_array($r2))
{
$OptionsList .= "\n\t";
}
}
if(empty($OptionsList))
{
echo "U heeft geen sub-categories...";
exit();
}
echo "";
echo "Alle producten in de geselecteerde sub-categorie zullen verwijderd worden!";
}
?>