function addVillage_neartowns($sessionkey, $appcode, $Village_neartownsdata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Village_neartowns = new Village_neartowns(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "VILLAGEID": $obj_Village_neartowns->VillageId = $child; break; case "TOWNID": $obj_Village_neartowns->TownId = $child; break; case "DISTANCE": $obj_Village_neartowns->Distance = $child; break; case "DESCRIPTION": $obj_Village_neartowns->Description = $child; break; } } $obj_retResult_Village_neartowns = DAL_manageVillage_neartowns::addVillage_neartowns($obj_Village_neartowns); if ($obj_retResult_Village_neartowns->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getVillage_neartownsXml($obj_retResult_Village_neartowns->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addVillage_neartowns2($VillageId, $TownId, $Distance, $Description) { $obj_retResult = new returnResult(); $obj_newVillage_neartowns = new Village_neartowns(); $obj_newuser->setVillage_neartowns($VillageId, $TownId, $Distance, $Description); // $isExist = BL_manageVillage_neartowns::isExist($obj_newVillage_neartowns->id); if (!$isExist) { $obj_retResult_Village_neartowns = DAL_manageVillage_neartowns::addVillage_neartowns($obj_newVillage_neartowns); if ($obj_retResult_Village_neartowns->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Village_neartowns->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Village_neartowns already exist"; } return $obj_retResult; }