function getPrimarygeolayertypeByPrimaryGeoLayerTypeId($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_managePrimarygeolayertype::getPrimarygeolayertypeListByPrimaryGeoLayerTypeId($id);
        if ($result->type == 1) {
            $arr_PrimarygeolayertypeList = $result->data;
            if (count($arr_PrimarygeolayertypeList) > 0) {
                $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
                foreach ($arr_PrimarygeolayertypeList as $obj_Primarygeolayertype) {
                    $main_result .= getPrimarygeolayertypeXml($obj_Primarygeolayertype);
                }
            } else {
                $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
            }
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function deletePrimarygeolayertype($obj_mainpacket)
 {
     $packet = $obj_mainpacket->packet;
     $PrimaryGeoLayerTypeId = $packet[0];
     $msg = "failed";
     $result = 0;
     $result_PrimaryGeoLayerTypeId = 0;
     $retResult = BL_managePrimarygeolayertype::getPrimarygeolayertypeListByPrimaryGeoLayerTypeId($PrimaryGeoLayerTypeId);
     if ($retResult->type == 1) {
         $obj_Primarygeolayertype = $retResult->data[0];
         $obj_result2 = DAL_managePrimarygeolayertype::deletePrimarygeolayertype($obj_Primarygeolayertype->PrimaryGeoLayerTypeId);
         if ($obj_result2->type == 1) {
             $result = 1;
             $result_PrimaryGeoLayerTypeId = $obj_Primarygeolayertype->PrimaryGeoLayerTypeId;
             $msg = "success";
         } else {
             $msg = "Sorry!!! Problem occured while deleting this Primarygeolayertype";
         }
     } else {
         $msg = "Sorry!!! The Primarygeolayertype you are tring to delete is not found";
     }
     $obj_mainpacket->returnValues = array($result, $obj_Primarygeolayertype->PrimaryGeoLayerTypeId, $msg);
     $obj_mainpacket->main_setPacket();
 }