public static function deleteVillage_plant($obj_mainpacket) { $packet = $obj_mainpacket->packet; $VillageId = $packet[0]; $msg = "failed"; $result = 0; $result_VillageId = 0; $retResult = BL_manageVillage_plant::getVillage_plantListByVillageId($VillageId); if ($retResult->type == 1) { $obj_Village_plant = $retResult->data[0]; $obj_result2 = DAL_manageVillage_plant::deleteVillage_plant($obj_Village_plant->VillageId); if ($obj_result2->type == 1) { $result = 1; $result_VillageId = $obj_Village_plant->VillageId; $msg = "success"; } else { $msg = "Sorry!!! Problem occured while deleting this Village_plant"; } } else { $msg = "Sorry!!! The Village_plant you are tring to delete is not found"; } $obj_mainpacket->returnValues = array($result, $obj_Village_plant->VillageId, $msg); $obj_mainpacket->main_setPacket(); }
function getVillage_plantByVillageId($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_plant::getVillage_plantListByVillageId($id); if ($result->type == 1) { $arr_Village_plantList = $result->data; if (count($arr_Village_plantList) > 0) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; foreach ($arr_Village_plantList as $obj_Village_plant) { $main_result .= getVillage_plantXml($obj_Village_plant); } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }