ALTER FUNCTION [dbo].[UserFeedBackRatings]
(
@Rating DECIMAL(18,1)
)
RETURNS NVARCHAR(MAX)
AS
BEGIN
DECLARE @RatingsImg NVARCHAR(max);
SET @RatingsImg = (CASE WHEN @Rating = '0.5' THEN '<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '1.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '1.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '2.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '2.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '3.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '3.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '4.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '4.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'
WHEN @Rating = '5.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'
END)
RETURN @RatingsImg
END
(
@Rating DECIMAL(18,1)
)
RETURNS NVARCHAR(MAX)
AS
BEGIN
DECLARE @RatingsImg NVARCHAR(max);
SET @RatingsImg = (CASE WHEN @Rating = '0.5' THEN '<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '1.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '1.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '2.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '2.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '3.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '3.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '4.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-o" aria-hidden="true"></i>'
WHEN @Rating = '4.5' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star-half" aria-hidden="true"></i>'
WHEN @Rating = '5.0' THEN '<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'+' '+'<i class="fa fa-star" aria-hidden="true"></i>'
END)
RETURN @RatingsImg
END
No comments:
Post a Comment