require_once("../database.php");
require_once("adminfuncties.php");
require_once("subcat_navigatie.php");
if(isset($_POST[s30]))
{
$MySubcategory = strip_tags($_POST[SubName]);
if(empty($MySubcategory) || ereg("[[:punct:]]", $MySubcategory) || (strlen($MySubcategory) > 50))
{
echo "
De naam van de sub-categorie mag enkel bestaan uit cijfers en letters.";
$ven = "yes";
}
else
{
$CategoryInfo = explode("|", $_POST[CategoryID]);
$q1 = "insert into devbg_subcategories set
CategoryID = '$CategoryInfo[0]',
SubcategoryName = '$MySubcategory' ";
mysql_query($q1) or die(mysql_error());
echo "De nieuwe sub-categorie werd succesvol aangemaakt...";
unset($_POST);
}
}
if(isset($_POST[s1]) || isset($ven))
{
if(!empty($_POST[CategoryID]))
{
$CategoryInfo = explode("|", $_POST[CategoryID]);
?>
$q1 = "select * from devbg_subcategories where CategoryID = '$CategoryInfo[0]' order by SubcategoryName ";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) > '0')
{
echo "Deze sub-categories staan onder de categorie $CategoryInfo[1]
";
while($a1 = mysql_fetch_array($r1))
{
echo "$a1[SubcategoryName]
";
}
}
exit();
}
}
$q1 = "select * from oneshop_categories order by CategoryName ";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
echo "U kunt geen sub-categories maken wanneer er geen hoofd-categories bestaan.";
exit();
}
else
{
$MySelect = "\n\n";
}
?>