Beispiel #1
0
function updateTown($sessionkey, $appcode, $Towndata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Town = new Town();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "TOWNID":
                    $obj_Town->TownId = $child;
                    break;
                case "TOWNNAME":
                    $obj_Town->TownName = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Town->Description = $child;
                    break;
            }
        }
        $obj_retResult_Town = DAL_manageTown::updateTown($obj_Town);
        if ($obj_retResult_Town->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getTownXml($obj_retResult_Town->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
Beispiel #2
0
 public static function updateTown2($TownId, $TownName, $Description)
 {
     $obj_retResult = new returnResult();
     $obj_newTown = new Town();
     $obj_newTown->TownId = $TownId;
     $obj_newTown->TownName = $TownName;
     $obj_newTown->Description = $Description;
     $issuccess = DAL_manageTown::updateTown($obj_newTown);
     if ($issuccess) {
         $obj_retResult->type = 1;
         //	$obj_retResult->data = BL_manageTown::getTownByTownId($obj_newTown->TownId);
         $obj_retResult->msg = "Town updation is Success";
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Town updation is Failed";
     }
     return $obj_retResult;
 }