if($level=="")
$level=0;
if($ctype == "edit")
{
$title =" Modify ";
if($level==0)
$title.="Category";
else
$title.="Sub Category";
$title.=" Details";
$stype = "Modify";
}
else
{
$title =" Add ";
if($level==0)
$title.="Category";
else
$title.="Sub Category";
$title.=" Details";
$stype = "Add";
}
$catcount=0;
$chkcatcount=mysql_query("SELECT COUNT(*) FROM ".CATEGORY." WHERE Parent=0");
list($catcount)=mysql_fetch_array($chkcatcount);
if($root != "")
{
//To select details from Product Association table
//================================================
$sel_qry = "select Cat_Status from ".PRODUCT_ASSOCIATE." where Category_Id='$root'";
$sel_result = mysql($db, $sel_qry);
list($astatus) = mysql_fetch_array($sel_result);
//To select details from Category Master table
//============================================
$seq_cat = "select Category_Id, Category_Name, Description ,Image ,Status ,Email_Status,template_type from ".CATEGORY." where Category_Id='$root'";
$result_cat = mysql($db, $seq_cat);
list($catid, $cat_name, $cat_desc,$cat_image,$status,$email_status,$template_type) = mysql_fetch_array($result_cat);
$cat_desc = preg_replace("/\r|\n/", '', $cat_desc);
if(!get_magic_quotes_runtime()) $cat_desc = addslashes($cat_desc);
#echo "
Desc=".$cat_desc;
if($status == 'Y')
$checked = "checked";
else
$checked = "";
if($email_status == 1)
$email_checked = "checked";
else
$email_checked = "";
if($template_type == 1)
$template1 = "checked";
else
$template1 = "";
if($template_type == 2)
$template2 = "checked";
else
$template2 = "";
}
//To construct category path
//==========================
$cat_path = breadcrumbs($root, '', "$type", "$level");
?>
if($ctype=="edit" || $cat_path!="")
{
?>
| Product Catalog |
| |
$nextlevel=$level+1;
if($level<$cat_level)
{
?>
| +Add Subcategory |
}
if($level>1 && $level <= $cat_level)
{
?>
| |
}
$chksub=mysql_query("SELECT COUNT(*) FROM ".CATEGORY." WHERE Parent='$root'");
list($countsub)=mysql_fetch_array($chksub);
$tblwidth=350;
if($level==1)
{
//$countsub=0;
$tblwidth=600;
}
if($level>=1)
{
?>
+Add Subcategory
+Add Product
|
}
?>
|
}
?>
|
echo $elementfocus?>
|
|