Tuvieron que ser 3 partes!
Código HTML:
<p align="center">
<b><font color="#FFFFFF" face="Times New Roman">
<%
if IsArray(prodoptions) then
response.write "<table border='0' cellspacing='1' cellpadding='1' width='100%'>"
for rowcounter=0 to UBOUND(prodoptions,2)
index=0
gotSelection=false
cacheThis=true
do while index < (maxprodopts-1) AND aOption(0,index)<>0
if aOption(0,index)=Int(prodoptions(0,rowcounter)) then
gotSelection=true
exit do
end if
index = index + 1
loop
if NOT gotSelection then
sSQL="SELECT optID,optName,optfImage,optGrpName,optPriceDiff,optType,optFlags FROM options INNER JOIN optionGroup ON options.optGroup=optionGroup.optGrpID WHERE optGroup="&prodoptions(0,rowcounter)&" ORDER BY optID"
rs2.Open sSQL,cnn,0,1
if NOT rs2.EOF then
if Abs(Int(rs2("optType")))=3 then
fieldHeight = cInt((cDbl(rs2("optPriceDiff"))-Int(rs2("optPriceDiff")))*100.0)
aOption(1,index) = "<tr><td align='right' width='30%'>"&rs2("optGrpName")&":</td><td> <input type='hidden' name='optnPLACEHOLDER' value='"&rs2("optID")&"'>"
if fieldHeight<>1 then
aOption(1,index) = aOption(1,index) & "<textarea wrap='virtual' name='voptnPLACEHOLDER' cols='"&atb(Int(rs2("optPriceDiff")))&"' rows='"&fieldHeight&"'>"
aOption(1,index) = aOption(1,index) & rs2("optName")&"</textarea>"
else
aOption(1,index) = aOption(1,index) & "<input maxlength='255' type='text' name='voptnPLACEHOLDER' size='"&atb(Int(rs2("optPriceDiff")))&"' value="""&Replace(rs2("optName"),"""",""")&""">"
end if
aOption(1,index) = aOption(1,index) & "</td></tr>"
else
aOption(1,index) = "<tr><td align='right' width='30%'>"&rs2("optGrpName")&":</td><td> <select class=""prodoption"" onChange='updatepricePLACEHOLDER();' name='optnPLACEHOLDER' size='1'>"
if Int(rs2("optType"))>0 then aOption(1,index) = aOption(1,index) & "<option value=''>"&xxPlsSel&"</option>"
do while not rs2.EOF
aOption(1,index) = aOption(1,index) & "<option value='"&rs2("optID")&"'>"&rs2("optName")
if cDbl(rs2("optPriceDiff"))<>0 then
aOption(1,index) = aOption(1,index) & " ("
if cDbl(rs2("optPriceDiff")) > 0 then aOption(1,index) = aOption(1,index) & "+"
if (rs2("optFlags") AND 1) = 1 then
cacheThis=false
aOption(1,index) = aOption(1,index) & FormatEuroCurrency((rs("pPrice")*rs2("optPriceDiff"))/100.0)&")"
else
aOption(1,index) = aOption(1,index) & FormatEuroCurrency(rs2("optPriceDiff"))&")"
end if
end if
aOption(1,index) = aOption(1,index) & "</option>"&vbCrLf
rs2.MoveNext
loop
aOption(1,index) = aOption(1,index) & "</select></td></tr>"
end if
end if
if cacheThis then aOption(0,index) = Int(prodoptions(0,rowcounter))
rs2.Close
end if
response.write Replace(Replace(aOption(1,index),"optnPLACEHOLDER","optn"&rowcounter),"updatepricePLACEHOLDER","updateprice"&Count,1,1)
next
if nobuyorcheckout<>true then
%> </font></b>
<tr><td align="right"> </td><td>
<p align="center">
<img src="<%=optfImage%>" border="0">
</td></tr>
<tr><td align="right"><%=xxQuant%><b><font color="#FFFFFF" face="Times New Roman">:</font></b></td><td>
<font color="#FFFFFF" face="Times New Roman"><b><input type="text" name="quant" size="<%=atb(4)%>" value="1"></b></font></td></tr>
<%
end if
response.write "</table>"
else
if nobuyorcheckout<>true then
%><b><font color="#FFFFFF" face="Times New Roman"> </font></b>
<table border='0' cellspacing='1' cellpadding='1' width='100%'>
<tr><td align="right"><%=xxQuant%><b><font color="#FFFFFF" face="Times New Roman">:</font></b></td><td>
<font color="#FFFFFF" face="Times New Roman"><b><input type="text" name="quant" size="<%=atb(4)%>" value="1"></b></font></td></tr>
</table>
<%
end if
end if
%></p>
<p align="center">
<font color="#FFFFFF"><b><font face="Times New Roman">
<%
if nobuyorcheckout=true then
response.write " "
else
if useStockManagement then
isInStock = Int(rs("pInStock")) > 0
else
isInStock = Int(rs("pSell")) <> 0
end if
if isInStock then
%>
<input type="hidden" name="id" value="<%=rs("pID")%>">
<input type="hidden" name="mode" value="add">
<input type="hidden" name="frompage" value="<%=Request.ServerVariables("URL")&IIfVr(Trim(Request.ServerVariables("QUERY_STRING"))<>"","?","")&Request.ServerVariables("QUERY_STRING")%>">
<input type="image" src="images/buy.gif" border="0"><%
else
response.write "<b>"&xxOutStok&"</b>"
end if
end if %><br>
<% if previousid<>"" OR nextid<>"" then %>
<% if previousid<>"" then %></font></b></font><font face="Times New Roman"><a href="proddetail.asp?prod=<%=previousid%>"><font color="#FFFFFF"><b><% end if %>« Previous<% if previousid<>"" then %></b></font></a><b><font color="#FFFFFF"><% end if %> |
<% if nextid<>"" then %></font></b><a href="proddetail.asp?prod=<%=nextid%>"><font color="#FFFFFF"><b><% end if %>Next »<% if nextid<>"" then %></b></font></a><b><font color="#FFFFFF"><% end if %>
<br>
<% end if %> </font></b></font>
<hr width="80%"></p>
<% if useemailfriend then %><b><font color="#FFFFFF" face="Times New Roman">
</font></b>
<p align="center"><font face="Times New Roman"><a href="javascript:openEFWindow('<%=Server.URLEncode(prodid)%>')"><strong>
<font color="#FFFFFF"><%=xxEmFrnd%></font></strong></a></p>
<% end if %><b><font color="#FFFFFF">
</td>
</tr>
<%
rs.Close
cnn.Close
%> </font></b></font>
</table>
<% end if ' usedetailbodyformat
%>
</form>
</td>
</tr>
</table>
<%
end if ' rs.EOF
%>