|
| <% WriteString("PageTitle_MarkupPrices") %> |
<%
If blnProcess then
'***********************************************
' MAKING THE CHANGES
'***********************************************
If V_IDs = "" then %>
| <% WriteString("ContentText_MarkupNoneSelected") %> |
<% else
If strChangeType = "perc" then
strNewValue = "V_Price + (V_Price * " & numChange / 100 & ")"
else
strNewValue = "V_Price + " & numChange
end if
strQuery = "UPDATE tblCactuShopVersions SET V_Price=" & strNewValue & " WHERE V_ID IN (" & V_IDs & ")"
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
%>
| <% WriteString("ContentText_ModificationsMade") %> |
<% end if '// no V_IDs were selected from the checkboxes.
else
'***********************************************
' CONFIRMING THE CHANGES
'***********************************************
'-----------------------------------------------
'BUILD UP QUERY
'And the accompanying text string
'-----------------------------------------------
'Start the query
strQuerySelect = "SELECT DISTINCT "
For numCounter = 1 to numTotalLanguages: strQuerySelect = strQuerySelect & "tblCactuShopVersions.V_Name" & CStr(numCounter) & ", tblCactuShopProducts.P_Name" & CStr(numCounter) & ", ": Next
strQuerySelect = strQuerySelect & "V_Price, V_ID FROM (tblCactuShopVersions INNER JOIN tblCactuShopProducts ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID WHERE (1=1)"
'Direction
If strChangeDirection = "up" then
strAction = GetString("ContentText_Markup")
else
strAction = GetString("ContentText_Markdown")
end if
'Price boundaries
If numFromPrice > 0 then
If numToPrice > 0 then
strAction = strAction & " " & GetString("ContentText_VersionsBetween") & " " & strDefaultCurrencySymbol & " " & CurrencyDisplay(numFromPrice, 1, blnDefaultCurrencyHasDecimals) & " " & GetString("ContentText_PriceRangeAnd") & " " & strDefaultCurrencySymbol & " " & CurrencyDisplay(numToPrice, 1, blnDefaultCurrencyHasDecimals)
strQuerySelect = strQuerySelect & " AND (V_Price >= " & numFromPrice & ") AND (V_Price <= " & numToPrice & ")"
Else
strAction = strAction & " " & GetString("ContentText_VersionsAbove") & " " & strDefaultCurrencySymbol & " " & CurrencyDisplay(numFromPrice, 1, blnDefaultCurrencyHasDecimals)
strQuerySelect = strQuerySelect & " AND (V_Price >= " & numFromPrice & ")"
end if
elseif numToPrice > 0 then
strAction = strAction & " " & GetString("ContentText_VersionsBelow") & " " & strDefaultCurrencySymbol & " " & CurrencyDisplay(numToPrice, 1, blnDefaultCurrencyHasDecimals)
strQuerySelect = strQuerySelect & " AND (V_Price <= " & numToPrice & ")"
else
strAction = strAction & " " & GetString("ContentText_AllVersions")
end if
'Category
If numCategory > 0 then
'-----------------------------------------------
'GET THE CATEGORY NAME
'We have to pull it out from the database then
'loop around to find the right language
'-----------------------------------------------
strQuery = "SELECT "
For numCounter = 1 to numTotalLanguages: strQuery = strQuery & "tblCactuShopProdtype.PT_Name" & CStr(numCounter) & ", ": Next
strQuery = strQuery & "tblCactuShopProdtype.PT_ID FROM tblCactuShopProdtype WHERE PT_ID = " & numCategory
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
strCategoryName = objRecordSet("PT_Name" & CStr(numLanguageID))
if strCategoryName & "" = "" then
For numCounter = 1 to numTotalLanguages
strCategoryName = objRecordSet("PT_Name" & CStr(numCounter))
if strCategoryName & "" <> "" then exit for
next
end if
objRecordSet.Close
strAction = strAction & " " & GetString("ContentText_InCategory") & " '" & strCategoryName & "'"
strQuerySelect = strQuerySelect & " AND (tblCactuShopProductProdTypeLink.PPT_ProdTypeID = " & numCategory & ")"
end if
'Modification type
If strChangeType = "perc" then
strAction = strAction & " " & GetString("ContentText_MarkUpBy") & " " & CStr(numChange) & "%"
else
strAction = strAction & " " & GetString("ContentText_MarkUpBy") & " " & strDefaultCurrencySymbol & " " & CurrencyDisplay(numChange, 1, blnDefaultCurrencyHasDecimals)
end if
strQuerySelect = strQuerySelect & " ORDER BY V_ID"
'Now that's all done - we want to set the Change value
'to negative if we're marking down. Means we can then
'ignore 'direction'
If strChangeDirection = "down" then numChange = -numChange
'Execute the query!
Call ExecuteSQL(strQuerySelect, numCursorType, objRecordSet)
If objRecordSet.BOF And objRecordSet.EOF then
%>
| <% WriteString("ContentText_NoPricesMarkup") %> |
<% else %>
| <%= strAction %> |
| <% WriteString("ContentText_MarkupConfirmText") %> |
|
|
<% End If '// recordset not bof and eof
objRecordSet.Close
End If '// the processing/confirming selection %>
|