public static function deleteVillage_neartowns($obj_mainpacket)
 {
     $packet = $obj_mainpacket->packet;
     $TownId = $packet[0];
     $msg = "failed";
     $result = 0;
     $result_TownId = 0;
     $retResult = BL_manageVillage_neartowns::getVillage_neartownsListByTownId($TownId);
     if ($retResult->type == 1) {
         $obj_Village_neartowns = $retResult->data[0];
         $obj_result2 = DAL_manageVillage_neartowns::deleteVillage_neartowns($obj_Village_neartowns->TownId);
         if ($obj_result2->type == 1) {
             $result = 1;
             $result_TownId = $obj_Village_neartowns->TownId;
             $msg = "success";
         } else {
             $msg = "Sorry!!! Problem occured while deleting this Village_neartowns";
         }
     } else {
         $msg = "Sorry!!! The Village_neartowns you are tring to delete is not found";
     }
     $obj_mainpacket->returnValues = array($result, $obj_Village_neartowns->TownId, $msg);
     $obj_mainpacket->main_setPacket();
 }
function getVillage_neartownsByTownId($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_manageVillage_neartowns::getVillage_neartownsListByTownId($id);
        if ($result->type == 1) {
            $arr_Village_neartownsList = $result->data;
            if (count($arr_Village_neartownsList) > 0) {
                $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
                foreach ($arr_Village_neartownsList as $obj_Village_neartowns) {
                    $main_result .= getVillage_neartownsXml($obj_Village_neartowns);
                }
            } else {
                $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
            }
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}