function updateVillage_othernames($sessionkey, $appcode, $Village_othernamesdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Village_othernames = new Village_othernames();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "VILLAGEID":
                    $obj_Village_othernames->VillageId = $child;
                    break;
                case "VILLAGENAMES":
                    $obj_Village_othernames->VillageNames = $child;
                    break;
            }
        }
        $obj_retResult_Village_othernames = DAL_manageVillage_othernames::updateVillage_othernames($obj_Village_othernames);
        if ($obj_retResult_Village_othernames->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getVillage_othernamesXml($obj_retResult_Village_othernames->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addVillage_othernames($obj_Village_othernames)
 {
     $db = config::dbconfig();
     $obj_retresult = new returnResult();
     $obj_Village_othernames->VillageId = DAL_manageVillage_othernames::getLastVillage_othernamesId() + 1;
     $sql = "INSERT INTO tbl_village_othernames (VillageId,VillageNames) \n\t\tVALUES (" . common::noSqlInject($obj_Village_othernames->VillageId) . "," . "'" . common::noSqlInject($obj_Village_othernames->VillageNames) . "'" . ");";
     $rs = mysql_query($sql);
     if (mysql_affected_rows() > 0) {
         $obj_retresult->type = 1;
         $obj_retresult->msg = "success";
         $obj_retresult->data = $obj_Village_othernames;
     } else {
         $obj_retresult->type = 0;
         $obj_retresult->msg = "failed";
     }
     return $obj_retresult;
 }
 public static function isChildVillage_othernames($VillageId, $ChildVillageId)
 {
     $ischild = false;
     $obj_retResult = DAL_manageVillage_othernames::getVillage_othernamesListByVillageId($ChildVillageId);
     //get child node
     if ($obj_retResult->type == 1) {
         $arr_Village_othernamesList = $obj_retResult->data;
         $obj_Village_othernames = $arr_Village_othernamesList[0];
         $arrParentIds = explode(",", $obj_Village_othernames->Url);
         foreach ($arrParentIds as $Village_othernamesParentId) {
             if ($Village_othernamesParentId == $VillageId) {
                 $ischild = true;
             }
         }
     }
     return $ischild;
 }