function getProductByProductId($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_manageProduct::getProductListByProductId($id); if ($result->type == 1) { $arr_ProductList = $result->data; if (count($arr_ProductList) > 0) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; foreach ($arr_ProductList as $obj_Product) { $main_result .= getProductXml($obj_Product); } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function deleteProduct($obj_mainpacket) { $packet = $obj_mainpacket->packet; $ProductId = $packet[0]; $msg = "failed"; $result = 0; $result_ProductId = 0; $retResult = BL_manageProduct::getProductListByProductId($ProductId); if ($retResult->type == 1) { $obj_Product = $retResult->data[0]; $obj_result2 = DAL_manageProduct::deleteProduct($obj_Product->ProductId); if ($obj_result2->type == 1) { $result = 1; $result_ProductId = $obj_Product->ProductId; $msg = "success"; } else { $msg = "Sorry!!! Problem occured while deleting this Product"; } } else { $msg = "Sorry!!! The Product you are tring to delete is not found"; } $obj_mainpacket->returnValues = array($result, $obj_Product->ProductId, $msg); $obj_mainpacket->main_setPacket(); }