<form name="frmCatalog" action="<?php 
echo $_SERVER["PHP_SELF"];
?>
" method="POST" enctype="multipart/form-data">
                                                <input type="hidden" name="catid" value="<?php 
echo htmlentities($catid);
?>
" >

                                                <table width="100%" border=0>

                                                    <tr><td  class="hd_background" colspan="2" align="left" style='word-break:break-all;' >  <?php 
echo stripslashes(getCategoryLink("sellers/mycatalog.php", $catid));
?>
</td></tr>
                                                    <tr><td colspan="2">
                                                            <table width="100%">
                                                                <?php 
if (!isset($catid) || $catid == "") {
    $catid = 0;
}
$sql = "SELECT * FROM " . $tableprefix . "categories\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE parent_id = '" . addslashes($catid) . "' AND gift_certificate_flag != 'Y' ORDER BY category_name ";
$res = mysql_query($sql);
$odd = true;
if (mysql_num_rows($res) != 0) {
    while ($row = mysql_fetch_array($res)) {
        if ($odd == true) {
            echo "<tr><td align='left' style='word-break:break-all;'><a href='mycatalog.php?catid=" . $row["category_id"] . "' class='links'>" . htmlentities(stripslashes($row["category_name"])) . "</a></td>";
echo htmlentities($catid);
?>
" >
																										<table cellpadding="2" cellspacing="2" width="95%"  align='left' border=0>
																											<tr><td colspan="3" class="message" align="left"><?php 
echo $message;
?>
</td></tr>
																											<tr>
																												<td colspan="3">
																													<fieldset>
																														<legend  class='toplinksCopy'>Categories</legend>
																														<table width="100%" border=0 align='left'>

																															<tr><td colspan="2" align='left' class="links" style='word-break:break-all;'><?php 
echo getCategoryLink("categorydetail.php", $catid, 'seo');
?>
</td></tr>
																															<tr><td colspan="2" align='left'>
																																<table width="100%"  border=0  align='left' cellpadding="2" cellspacing="2">
																																<?php 
if (!isset($catid) || $catid == "") {
    $catid = 0;
}
$showproducts = false;
$sql = "SELECT * FROM " . $tableprefix . "categories WHERE parent_id = '" . addslashes($catid) . "' ORDER BY category_name ";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) != 0) {
    while ($row = mysql_fetch_array($result)) {
        echo "<tr>";
        echo "<td width='10%' align=right style='word-break:break-all;'><img src=images/dot.jpg></td><td width='40%' class=maintext align=left style='word-break:break-all;'><a href=\"" . $PHP_SELF . "?catid=" . $row["category_id"] . "&categorydesc=" . urlencode($row["category_name"]) . "\" class=\"links\">" . htmlentities($row["category_name"]) . "</a>&nbsp;(" . $row["count"] . ")</td>";
 function defaultsubcatlevel($catid, $catlevel)
 {
     $lvl2subcats = modApiFunc("Catalog", "getSubCategories", $catid);
     // Checking for subcategories which have level greater than 1
     if ($catlevel > 1) {
         $catname = getCategoryName($catid);
         $catlink = getCategoryLink($catid);
         $value = "";
         $value .= "<li><a href='{$catlink}'><span>" . $catname . "</span></a><div><ul>";
     }
     //Get subcategories for level2 and below
     $count = count($lvl2subcats) - 1;
     while ($count >= 0) {
         $value .= $this->defaultsubcatlevel(getCategoryID($lvl2subcats[$count]["category_id"]), 2);
         $count = $count - 1;
     }
     if ($catlevel > 1) {
         $value .= "</ul></div>";
     }
     return $value;
 }