File: D:/web/homefly/vsadmin/inc/incproductbody.asp
<% prodoptions=""
saveLCID = Session.LCID
productdisplayscript(noproductoptions<>true) %>
<table width="<%=innertablewidth%>" border="0" cellspacing="<%=innertablespacing%>" cellpadding="<%=innertablepadding%>" bgcolor="<%=innertablebg%>">
<% if IsEmpty(showcategories) OR showcategories=true then %>
<tr>
<td colspan="2" align="<%=headeralign%>"><b><a href="<%=xxHomeURL%>"><%=xxHome%></a> » <% if tsName <> "" then response.write "<a href='categories.asp?id="&tsID&"'>" & tsName & "</a> » "%><% =sectionName %></b></td>
<td align="right"> <% if nobuyorcheckout<>true then %><a href="cart.asp"><img src="images/checkout.gif" border="0"></a><% end if %></td>
</tr>
<% end if
Session.LCID = 1033
sSQL = "SELECT DISTINCT cpnWorkingName FROM coupons LEFT OUTER JOIN cpnAssign ON coupons.cpnID=cpnAssign.cpaCpnID WHERE ("
addor = ""
if tsID<>"" then
sSQL = sSQL & addor & "(cpnSitewide=0 AND cpaType=0 AND cpaAssignment='"&tsID&"')"
addor = " OR "
end if
if catid<>"" then
sSQL = sSQL & addor & "(cpnSitewide=0 AND cpaType=1 AND cpaAssignment='"&catid&"')"
addor = " OR "
end if
tdt = Date()
sSQL = sSQL & addor & "(cpnSitewide=1 OR cpnSitewide=2)) AND cpnNumAvail>0 AND cpnEndDate>="&datedelim&DatePart("m",tdt) & "/" & DatePart("d",tdt) & "/" & DatePart("yyyy",tdt)&datedelim&" AND cpnIsCoupon=0"
Session.LCID = saveLCID
rs2.Open sSQL,cnn,0,1
if NOT rs2.EOF then
%>
<tr>
<td align="left" colspan="3">
<p><b><%=xxDsProd%></b><br><font color="#FF0000" size="1">
<% do while NOT rs2.EOF
response.write rs2("cpnWorkingName") & "<br>"
rs2.MoveNext
loop %></font></p>
</td>
</tr>
<%
end if
rs2.Close
%>
<tr>
<td colspan="3" align="center"><%
If iNumOfPages > 1 AND pagebarattop=1 Then Response.Write writepagebar(CurPage, iNumOfPages) & "<BR>" %>
<img src="images/clearpixel.gif" width="350" height="1">
</td>
</tr>
<%
netnav = true
if instr(Request.ServerVariables("HTTP_USER_AGENT"), "compatible") > 0 OR instr(Request.ServerVariables("HTTP_USER_AGENT"), "Gecko") > 0 then netnav = false
function atb(size)
if netnav then
atb = CInt(size / 2 + 1)
else
atb = size
end if
end function
Do While Not rs.EOF And Count < rs.PageSize
if Trim(rs("pLongDescription"))<>"" OR NOT (Trim(rs("pLargeImage"))="" OR IsNull(rs("pLargeImage")) OR Trim(rs("pLargeImage"))="prodimages/") then
startlink="<a href='proddetail.asp?prod="&Server.URLEncode(rs("pId"))&"'>"
endlink="</a>"
else
startlink=""
endlink=""
end if
Session.LCID = 1033
tdt = Date()
sSQL = "SELECT DISTINCT cpnWorkingName FROM coupons LEFT OUTER JOIN cpnAssign ON coupons.cpnID=cpnAssign.cpaCpnID WHERE cpnSitewide=0 AND cpnNumAvail>0 AND cpnEndDate>="&datedelim&DatePart("m",tdt) & "/" & DatePart("d",tdt) & "/" & DatePart("yyyy",tdt)&datedelim&" AND cpnIsCoupon=0 AND ((cpaType=2 AND cpaAssignment='"&rs("pID")&"')"
if catid="" then
sSQL = sSQL & " OR (cpaType=1 AND cpaAssignment='"&rs("pSection")&"')"
if subCats AND tcatid="" then sSQL = sSQL & " OR (cpaType=0 AND cpaAssignment='"&rs("topSection")&"')"
end if
sSQL = sSQL & ")"
Session.LCID = saveLCID
alldiscounts = ""
rs2.Open sSQL,cnn,0,1
do while NOT rs2.EOF
alldiscounts = alldiscounts & rs2("cpnWorkingName") & "<br>"
rs2.MoveNext
loop
rs2.Close
%>
<tr>
<td width="26%" rowspan="3" align="center" valign="middle">
<% if Trim(rs("pImage"))="" or IsNull(rs("pImage")) or Trim(rs("pImage"))="prodimages/" then %>
<% else %>
<%=startlink%><img src="<%=rs("pImage")%>" border="0" alt="<%=Replace(rs("pName"),"""",""")%>"><%=endlink%>
<% end if %>
</td>
<td width="59%">
<p><% if showproductid=true then response.write "<b>" & xxPrId & ":</b> " & rs("pID") & "<br>" %><b><%=rs("pName")&xxDot%></b><% if alldiscounts<>"" then response.write " <font color=""#FF0000""><strong>"&xxDsApp&"</strong><br><font size=""1"">" & alldiscounts & "</font></font>" %></p>
</td>
<td width="15%" align="right" valign="top"><%
if startlink <> "" then
response.write "<p>" & startlink & "<b>"&xxPrDets&"</b></a> </p>"
else
response.write " "
end if
%></td>
</tr>
<% updatepricescript(noproductoptions<>true) %>
<form method="POST" name="tForm<%=Count%>" action="cart.asp" onSubmit="return formvalidator<%=Count%>(this)">
<tr>
<td colspan="2">
<p><%=rs("pDescription")%></p>
<%
if IsArray(prodoptions) AND noproductoptions<>true then
response.write "<table border='0' cellspacing='1' cellpadding='1' width='100%'>"
for rowcounter=0 to UBOUND(prodoptions,2)
index=0
gotSelection=false
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,optGrpName,optPriceDiff,optType 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%'><b>"&rs2("optGrpName")&":</b></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%'><b>"&rs2("optGrpName")&":</b></td><td> <select 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) & "+"
aOption(1,index) = aOption(1,index) & FormatEuroCurrency(rs2("optPriceDiff"))&")"
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
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
response.write "</table>"
end if
%>
</td>
</tr>
<tr>
<td width="59%" align="center" valign="middle">
<% if noprice=true then
response.write " "
else
if cDbl(rs("pListPrice"))<>0.0 then response.write Replace(xxListPrice, "%s", FormatEuroCurrency(rs("pListPrice"))) & "<BR>"
if cDbl(rs("pPrice"))=0 AND pricezeromessage<>"" then
response.write pricezeromessage
else
response.write "<b>" & xxPrice & ":</b> <span id=""pricediv" & Count & """ name=""pricediv" & Count & """>" & FormatEuroCurrency(rs("pPrice")) & "</span> "
if showtaxinclusive=true then response.write Replace(ssIncTax,"%s", "<span id=""pricedivti" & Count & """ name=""pricedivti" & Count & """>" & FormatEuroCurrency(rs("pPrice")+(rs("pPrice")*countryTax/100.0)) & "</span> ")
response.write "<br>"
if currencyseparator="" then currencyseparator=" "
if currRate1<>0 AND currSymbol1<>"" then response.write "<span id=""pricediv1c" & Count & """ name=""pricediv1c" & Count & """>" & FormatNumber(rs("pPrice")*currRate1, checkDPs(currSymbol1)) & " <b>" & currSymbol1 & "</b></span>" & currencyseparator
if currRate2<>0 AND currSymbol2<>"" then response.write "<span id=""pricediv2c" & Count & """ name=""pricediv2c" & Count & """>" & FormatNumber(rs("pPrice")*currRate2, checkDPs(currSymbol2)) & " <b>" & currSymbol2 & "</b></span>" & currencyseparator
if currRate3<>0 AND currSymbol3<>"" then response.write "<span id=""pricediv3c" & Count & """ name=""pricediv3c" & Count & """>" & FormatNumber(rs("pPrice")*currRate3, checkDPs(currSymbol3)) & " <b>" & currSymbol3 & "</b></span>"
end if
end if %>
</td>
<td align="right" valign="bottom">
<%
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">
<% if showquantonproduct=true then %><input type="text" name="quant" size="2" value="1"><% end if %><input align="absmiddle" type="image" src="images/buy.gif" border="0"><%
else
response.write "<b>"&xxOutStok&"</b>"
end if
end if %></td>
</tr>
</form>
<tr>
<td colspan="3" align="center">
<hr width="70%" align="center">
</td>
</tr>
<%
Count = Count + 1
rs.MoveNext
loop
%>
<tr>
<td colspan="3" align="center"><%
If iNumOfPages > 1 AND nobottompagebar<>true Then Response.Write writepagebar(CurPage, iNumOfPages) %><br>
<img src="images/clearpixel.gif" width="350" height="1">
</td>
</tr>
</table>