function getTraditionalknowledgecategoryByCategoryId($sessionkey, $appcode, $id)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result .= "<AUTHSTATUS>1</AUTHSTATUS>";
        $result = BL_manageTraditionalknowledgecategory::getTraditionalknowledgecategoryListByCategoryId($id);
        if ($result->type == 1) {
            $arr_TraditionalknowledgecategoryList = $result->data;
            if (count($arr_TraditionalknowledgecategoryList) > 0) {
                $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
                foreach ($arr_TraditionalknowledgecategoryList as $obj_Traditionalknowledgecategory) {
                    $main_result .= getTraditionalknowledgecategoryXml($obj_Traditionalknowledgecategory);
                }
            } else {
                $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
            }
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function deleteTraditionalknowledgecategory($obj_mainpacket)
 {
     $packet = $obj_mainpacket->packet;
     $CategoryId = $packet[0];
     $msg = "failed";
     $result = 0;
     $result_CategoryId = 0;
     $retResult = BL_manageTraditionalknowledgecategory::getTraditionalknowledgecategoryListByCategoryId($CategoryId);
     if ($retResult->type == 1) {
         $obj_Traditionalknowledgecategory = $retResult->data[0];
         $obj_result2 = DAL_manageTraditionalknowledgecategory::deleteTraditionalknowledgecategory($obj_Traditionalknowledgecategory->CategoryId);
         if ($obj_result2->type == 1) {
             $result = 1;
             $result_CategoryId = $obj_Traditionalknowledgecategory->CategoryId;
             $msg = "success";
         } else {
             $msg = "Sorry!!! Problem occured while deleting this Traditionalknowledgecategory";
         }
     } else {
         $msg = "Sorry!!! The Traditionalknowledgecategory you are tring to delete is not found";
     }
     $obj_mainpacket->returnValues = array($result, $obj_Traditionalknowledgecategory->CategoryId, $msg);
     $obj_mainpacket->main_setPacket();
 }