<!--- create array of ratings values --->
<cfdump var="#variables#">
<cfset arrRatings = ['Very poor', 'Not that bad', 'Average', 'Good', 'Perfect']>
<!--- get initial votes numbers and avg rating --->
<cfset initRatings = createobject('component', 'tools').getRatings(user=url.uID,merchant=url.merchantID)>
<div class="rating-L">
<strong>Average rating</strong>
<span>(<span id="all_votes"><cfoutput>#initRatings.votes#</cfoutput></span> votes; <span id="all_avg"><cfoutput>#initRatings.avg#</cfoutput></span>)</span>
<cfoutput>
<form id="avg" style="width: 200px">
<cfloop from="1" to="#arraylen(arrRatings)#" index="x">
<input type="radio" name="rate_avg" value="#x#" title="#arrRatings[x]#" disabled="disabled"<cfif initRatings.avg EQ x> checked="checked"</cfif>>
</cfloop>
</form>
</cfoutput>
</div>
|