cursor = database.cursor("select count(partnumber)count from versitex.product where upper(description) like upper ('%" + request.search + "%') ");
cursor.next();
client.count = cursor.count;
cursor.close();
maxThisPage = parseInt(request.rowRef) + 19;
beginRow = request.rowRef;
beginRowPreviousPage = request.rowRef - 20;
write("");
write("Home > Search Results | ");
write(" | Description | More | Exch | Price | Qty | | ");
if(client.PriceLevel == null) {
cursor = database.cursor("select (rownum)rowcount, id, partnumber, sub, c5desc, description, to_char(((consumerprice)/(" + client.cex + ")),'999,999.99')price from versitex.product where upper(description) like upper ('%" + request.search + "%') ") }
else {
cursor = database.cursor("select (rownum)rowcount, id, partnumber, sub, c5desc, description, to_char(((" + client.PriceLevel + ")/(" + client.cex + ")),'999,999.99')price from versitex.product where upper(description) like upper ('%" + request.search + "%') ") }
var f = 0;
var i = 0;
var rowLoopRef = parseInt(request.rowRef);
while(cursor.next()) {
if(i == maxThisPage)
break
if(cursor.rowcount == rowLoopRef) {
if(f == 0) {
if(cursor.c5desc != 'C') {
write(" ") }
else {
write(" ") }
f++;
}
else {
if(cursor.c5desc != 'C') {
write(" ") }
else {
write(" ") }
f = 0;
}
rowLoopRef++;
}
else {
}
i++;
}
cursor.close();
if(client.count == 0) {
write(" We were unable to find exact matches for your search: " + request.search + " Would you like to try again? Examples: - Entering Guides finds all items containing the word guides in the description.
- Entering bass finds all the items with bass in the description.
- Entering Tops%Silicon Carbide finds all items with tops followed by the exact phrase silicon carbide in the description.
| ")
}
else{
write("");
if(maxThisPage < client.count) {
write(" " + beginRow + " to " + maxThisPage + " of " + client.count + " ")
if(beginRowPreviousPage > 0) {
write(" < Previous 20 ")
}
else {
}
write("| Next 20 >")
}
else {
write(" " + beginRow + " to " + client.count + " of " + client.count + " ")
if(beginRowPreviousPage > 0) {
write(" | < Previous 20 ")
}
else {
}
}
write(" | All Prices are in eaches and are stated in " + client.cname + " " + client.ccode + " |
| ");
}
write(" ");
|