function addVillage_image($sessionkey, $appcode, $Village_imagedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Village_image = new Village_image(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "PICTUREID": $obj_Village_image->PictureId = $child; break; case "VILLAGEID": $obj_Village_image->VillageId = $child; break; case "PICTUREPATH": $obj_Village_image->PicturePath = $child; break; case "DESCRIPTION": $obj_Village_image->Description = $child; break; } } $obj_retResult_Village_image = DAL_manageVillage_image::addVillage_image($obj_Village_image); if ($obj_retResult_Village_image->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getVillage_imageXml($obj_retResult_Village_image->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addVillage_image2($PictureId, $VillageId, $PicturePath, $Description) { $obj_retResult = new returnResult(); $obj_newVillage_image = new Village_image(); $obj_newuser->setVillage_image($PictureId, $VillageId, $PicturePath, $Description); // $isExist = BL_manageVillage_image::isExist($obj_newVillage_image->id); if (!$isExist) { $obj_retResult_Village_image = DAL_manageVillage_image::addVillage_image($obj_newVillage_image); if ($obj_retResult_Village_image->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Village_image->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Village_image already exist"; } return $obj_retResult; }