Admin > Product Edit > Add A Product > Log Off
Product key word search (Search Help)
Show: Images  Descriptions  Options   Cost/Price  Markup   Qty
  Sort Sequence Sort Sequence    
# Product Category Product Name   Show Prod
1 Main Nokia N95 Cell Phone Plum
Go 3351
2 Main Lenovo 3000 K100 57061334 Intel Desktop PC
Go 3350
3 Main Western Digital Caviar SE16 500GB Hard Drive
Go 3349
4 Main Acer Aspire 5315-2142 Laptop Computer
Go 3345
5 New_Category_Description meshal Cloned/Added Product
Go 3403

SELECT products.*, Left(products.[SKU Name],9) AS Expr1 FROM products WHERE ( (1=1 )) ORDER BY cCategoryName ;
Turn ON/OFF Source Display (One Level deep include files are also shown)
<!-- #include file="../DatabaseInclude.asp" -->
This include file is NOT output to debug file.<%
LineCounter = 1
if Request.QueryString("keyword") <> "RESET" then
  if not Request.Form("key_word") = "" then
    if Session("sesKeyword") <> Request.Form("key_word") then
      Session("sesKeyword") = Request.Form("key_word")
    end if
  else  
    Session("sesKeyword") = ""
  end if
else
  Session("sesKeyword") = ""
end if

if Request.QueryString("keyword") <> "RESET" and Request.QueryString("keyword") <> "" then
  Session("sesKeyword") = Request.QueryString("keyword")
end if

keyWordStr = Session("sesKeyword")

if keyWordStr <> "" or Request.QueryString("keyword") = "RESET" then
keyWord = keyWordStr
searchKey = keyWordStr
else
  keyWord = Request.Form("key_word")
  searchKey = Request.Form("key_word")
end if

keyword = trim(keyword)


' --- Start Search Code -------------------------------------------------------
Dim rsProducts, rsStyle, modifiedDescription, modifiedName, SQLstr, searchStr, intEOF, PID
dim i, isubtotal

Set rsProducts = Server.CreateObject("ADODB.Recordset")

'Generic SQL Information, used for key word search & Category Search

  SQLstr = "SELECT products.*, "
   SQLstr = SQLstr & " Left(products.[SKU Name],9) AS Expr1"
   SQLstr = SQLstr & " FROM products "
   SQLstr = SQLstr & " WHERE ("
   SQLstr = SQLstr & " (1=1 "
    SQLstr = SQLstr & " )"

if not keyword = "" then
  session("keyword") = keyword

  Dim strKeywords, strKeywordArray
  strKeywordArray= Split(keyword, "+")

  SQLstr = SQLstr & " AND ("
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  SQLstr = SQLstr & " (products.SupplierSKU like '%%%" & strKeywordArray(0) & "%%%'"
  for strKeyword = LBound(strKeywordArray) + 1 to UBound(strKeywordArray)
    SQLstr = SQLstr & " and products.SupplierSKU like '%%%" & strKeywordArray(strKeyword) & "%%%'"
  next
  SQLstr = SQLstr & ")"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  SQLstr = SQLstr & " or (products.[SKU Name] like '%%%" & strKeywordArray(0) & "%%%'"
  for strKeyword = LBound(strKeywordArray) + 1 to UBound(strKeywordArray)
    SQLstr = SQLstr & " and products.[SKU Name] like '%%%" & strKeywordArray(strKeyword) & "%%%'"
  next
  SQLstr = SQLstr & ")"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  SQLstr = SQLstr & " or (products.[Manufacturer Name] like '%%%" & strKeywordArray(0) & "%%%'"
  for strKeyword = LBound(strKeywordArray) + 1 to UBound(strKeywordArray)
    SQLstr = SQLstr & " and products.[Manufacturer Name] like '%%%" & strKeywordArray(strKeyword) & "%%%'"
  next
  SQLstr = SQLstr & ")"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  SQLstr = SQLstr & " or (products.cname like '%%%" & strKeywordArray(0) & "%%%'"
  for strKeyword = LBound(strKeywordArray) + 1 to UBound(strKeywordArray)
    SQLstr = SQLstr & " and products.cname like '%%%" & strKeywordArray(strKeyword) & "%%%'"
  next
  SQLstr = SQLstr & ")"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  SQLstr = SQLstr & " or (products.cdescription like '%%%" & strKeywordArray(0) & "%%%'"
  for strKeyword = LBound(strKeywordArray) + 1 to UBound(strKeywordArray)
    SQLstr = SQLstr & " and products.cdescription like '%%%" & strKeywordArray(strKeyword) & "%%%'"
  next
  SQLstr = SQLstr & ")"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
For strUsercount = 0 to 9
    SQLstr = SQLstr & " or (products.cUser" & strUsercount & " like '%%%" & strKeywordArray(0) & "%%%'"
    for strKeyword = LBound(strKeywordArray)+ 1 to UBound(strKeywordArray)
      SQLstr = SQLstr & " and products.cUser" & strUsercount & " like '%%%" & strKeywordArray(strKeyword) & "%%%'"
    next
    SQLstr = SQLstr & ")"
Next
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Session("Search/category")= "no"
  else
    'Category Specific SQL Code
    'This is a bug from one of the implementations
    'I changed it to function properly for the generic cart
    'was: SQLstr = SQLstr & " AND (products.cCategoryName='" & replace(strCatName,"'","''") & "'"
  strCatName = "Error"
  'SQLstr = SQLstr & " AND (products.cCategoryName<>'" & replace(strCatName,"'","''") & "'"
   SearchCategory ="yes"
end if

'Generic Wrap up of SQL Code
  SQLstr = SQLstr & ") "
   SQLstr = SQLstr & " ORDER BY "
  
  if Request.Form("SORTSEQUENCE") = "sortbyproductname" then
    SQLstr = SQLstr & " cName "
  end if
  
   if Request.Form("SORTSEQUENCE") = "sortbycategory" or Request.Form("SORTSEQUENCE") = "" then
     SQLstr = SQLstr & " cCategoryName "
   end if
  
   if Request.Form("SORTSEQUENCE") = "sortbyshowproduct" then
     SQLstr = SQLstr & " cShowProduct DESC"
   end if
  
   if Request.Form("SORTSEQUENCE") = "sortbyqty" then
     SQLstr = SQLstr & " cStock "
   end if
  
   if Request.Form("SORTSEQUENCE") = "sortbyproductCost" then
     SQLstr = SQLstr & " cCost "
   end if
  
   if Request.Form("SORTSEQUENCE") = "sortbyproductPrice" then
     SQLstr = SQLstr & " cPrice "
   end if
  
   if Request.Form("SORTSEQUENCE") = "sortbyproductMarkup" then
     SQLstr = SQLstr & " IIf([products]![ccost]>0,[products]![cprice]/[products]![ccost]) DESC"
   end if

   SQLstr = SQLstr & " ;"

session("SQLstr") = SQLstr
rsProducts.Open SQLstr, dbc
intEOF = 1

if rsProducts.eof then
intEOF = 0
end if

rsStyle = "style=" & chr(34) & "font-family: Verdana; font-size: 8pt" & chr(34)

'------ End Search Code -------------------------------------------------------
%>



<table class="TableSkins">
<tr>
    <td class="TDHeader" colspan="9">
      <a href="Index.asp">Admin</a>
      > Product Edit >
      <a href="ProductForm.asp?Function=ADD">Add A Product</a>
      > <a href="SessionClose.asp">Log Off</a>
    </td>
  </tr>
  <tr><form method="POST" action="ProductList.asp">
    <!td class="TDSkins">
    
<tr>
<td class="TDSkins" colspan="9">Product key word search
       <input class="InputSkins" type="text" name="key_word" size="26" value="<%=keyword%>">
       <input class="InputSkins" type="submit" value="Go" name="search_database">
        
          <a onmouseover="return overlib('<!-- #include file="popupoutput.asp" -->',FGCOLOR,'#ffffff',TEXTCOLOR,'#000000',BELOW,LEFT)" onMouseOut="nd();">
<pre><!----------------------- Start PopUpOutPut.asp -----------------------><br><table border=0 cellspacing=0 cellpadding=0 background=Skins/<font color=#990000><b><%=ucase(Session(SkinOption))%></font></b><br>/TableBackground.gif class=PopUp><br><tr><br><td background=Skins/<font color=#990000><b><%=ucase(Session(SkinOption))%></font></b><br>/TopSquared.gif><br><p class=Popup><br>There are 3 types of Searches:</p><br></td><br></tr><br><tr><br><td valign=top><br><p class=Popup><br><b><br>STRING</b><br> Search: input any number of characters you would like to search for, spaces are OK.<br><br>(ex: <b><br>shoe rep</b><br> will find <b><br>Shoe Rep</b><br>air Men and <b><br>Shoe Rep</b><br>air Women)<br><br><br><br><b><br>WORD</b><br> Search: <i><br><b><br>space</b><br></i><br>WORD<i><br><b><br>space</b><br></i><br><br><br>(ex: <b><br>food </b><br>will find all items with food )<br><br><br><br><b><br>COMBINATION </b><br>search for multiple words in any order.<br><br>The [+] (PLUS sign) between the search strings indicates a new string/word.<br><br>You can have any reasonable number strings/words.<br><br>(ex: <b><br>fast+food+health</b><br>)<br><br>(ex: <b><br>fast+food+cowboy club+main street)</b><br></p><br></td><br></tr><br></table><br><!----------------------- End PopUpOutPut.asp -----------------------><br></pre>        <b>(Search Help</b></a>)
        
        </td>
</tr>

<tr>
<td class="TDSkins" colspan="9">Show: <input type="checkbox" name="showimages" value="ON"
    <%if ucase(Request.Form("showimages")) = "ON" or Request.QueryString("SI") = "ON" then%>
    checked
    <%end if%>>Images 
    <input type="checkbox" name="showDescriptions" value="ON"
    <%if ucase(Request.Form("showDescriptions")) = "ON" or Request.QueryString("SD") = "ON" then%>
      checked
    <%end if%>>Descriptions 
    <input type="checkbox" name="showOptions" value="ON"
    <%if ucase(Request.Form("showOptions")) = "ON" or Request.QueryString("SO") = "ON" then%>
      checked
    <%end if%>>Options  
    <input type="checkbox" name="showCostPrice" value="ON"
    <%if ucase(Request.Form("showCostPrice")) = "ON" or Request.QueryString("SCP") = "ON" then%>
      checked
    <%end if%>>Cost/Price 
    <input type="checkbox" name="showMarkUp" value="ON"
    <%if ucase(Request.Form("showMarkUp")) = "ON" or Request.QueryString("SM") = "ON" then%>
      checked
    <%end if%>>Markup  
    <input type="checkbox" name="showQty" value="ON"
    <%if ucase(Request.Form("showQty")) = "ON" or Request.QueryString("SQ") = "ON" then%>
      checked
    <%end if%>>Qty
  </td>
  
</tr>

    <%if intEOF = 0 then%>
      <tr>
        <td class="TDSkins" colspan="9">
          Sorry, Your Search for "<%=keyword%>" Returned Nothing.
          Please try again.
        </td>
      </tr>
    <%else%>
      <tr>
      
        <td class="TDHeader">
           
        </td>
        <td class="TDHeader">

    <input type="radio" name="SORTSEQUENCE" value="sortbycategory"
      <%if Request.Form("SORTSEQUENCE") = "sortbycategory" or Request.Form("SORTSEQUENCE") = "" then%>
        checked  
      <%end if%>>
    Sort Sequence</td>
    
      <td class="TDHeader">

    <input type="radio" name="SORTSEQUENCE" value="sortbyproductname"
      <%if Request.Form("SORTSEQUENCE") = "sortbyproductname" then%>
        checked
      <%end if%>>
    Sort Sequence
      <input class="InputSkins" class="InputSkins" type="submit" value="Refresh Page (New Sort/Option Change etc.)" name="sort_sequence" style="width: 198; height: 20"></td>

       <%if ucase(Request.Form("showCostPrice")) = "ON" or Request.QueryString("SCP") = "ON" then%>
        <td class="TDHeader">
          <input type="radio" name="SORTSEQUENCE" value="sortbyproductCost"
          <%if Request.Form("SORTSEQUENCE") = "sortbyproductCost" then%>
         checked
       <%end if%>>
        </td>
  
        <td class="TDHeader">
        <input type="radio" name="SORTSEQUENCE" value="sortbyproductPrice"
       <%if Request.Form("SORTSEQUENCE") = "sortbyproductPrice" then%>
         checked
       <%end if%>>
       </td>
      <%end if%>

<%if ucase(Request.Form("showMarkUp")) = "ON" or Request.QueryString("SM") = "ON" then%>
  <td class="TDHeader">
    <input type="radio" name="SORTSEQUENCE" value="sortbyproductMarkup"
<%if Request.Form("SORTSEQUENCE") = "sortbyproductMarkup" then%>
  checked
<%end if%>>
  </td>
<%end if%>

<%if ucase(Request.Form("showQty")) = "ON" or Request.QueryString("SQ") = "ON" then%>
  <td class="TDHeader">
    <input type="radio" name="SORTSEQUENCE" value="sortbyqty"
    <%if Request.Form("SORTSEQUENCE") = "sortbyqty" then%>
      checked
    <%end if%>>
  </td>
<%end if%>

    <td class="TDHeader">
       
    </td>

    <td class="TDHeader">
       
    </td>

  </tr>

</form>

<td class="TDHeader">#</td>
<td class="TDHeader">Product Category</td>
<td class="TDHeader">Product Name
  <%if strProductErrors <> "" then%>
    <%=strProductErrors%>
  <%end if%>
</td>

    <%if ucase(Request.Form("showCostPrice")) = "ON" or Request.QueryString("SCP") = "ON" then%>
      <td class="TDHeader" align="center">
        Cost
      </td>
      <td class="TDHeader" align="center">
        Price
      </td>
    <%end if%>

    <%if ucase(Request.Form("showMarkup")) = "ON" or Request.QueryString("SM") = "ON" then%>
     <td class="TDHeader" align="center">
        Mark-Up
      </td>
    <%end if%>

    <%if ucase(Request.Form("showQty")) = "ON" or Request.QueryString("SQ") = "ON" then%>
     <td class="TDHeader">
       Qty
     </td>
    <%end if%>

  <td class="TDHeader">
     
  </td>

  <td class="TDHeader">
    Show Prod
  </td>
</tr>
<%end if%>


<form method="POST" action="ProductBatchUpdate.asp?keyword=<%=keyword%>">
  <%
  session("catDesctiptionCounter") = ""
  While Not rsProducts.EOF
  set PID = rsProducts("catalogID")
  if 100>50 then
    'if rsProducts("cCost") = 0 then
  %>


<tr>
    <td class="TDSkins">
      <%=LineCounter%>
    </td>
    
    <td class="TDSkins">
    <%if session("catDesctiptionCounter") = rsProducts("cCategoryName") then%>
    
       Category:
<%=rsproducts("BBC Category 1")%>
<%=rsproducts("BBC Category 2")%>
<%=rsproducts("BBC Category 3")%>
<br>
      <%=rsProducts("cCategoryName")%><%session("catDesctiptionCounter") = rsProducts("cCategoryName")%><%else%><%=rsProducts("cCategoryName")%>
      <%session("cCategoryName") = rsProducts("cCategoryName")%>
    <%end if%></a>
    </td>
    
    <td class="TDSkins">
      <%if ucase(rsProducts("cShowProduct")) = "NO" then%>
      
      <%end if%>
      <%=rsProducts("cName")%><br>
      <%if ucase(Request.Form("ShowImages")) = "ON" or Request.QueryString("SI") = "ON" then%>
        <%if rsProducts("cimageurl") <> "" then%>
        ImageURL: <%=rsProducts("cimageurl")%><br>
          <%MultipleImages = split(rsProducts("cimageurl"),",")%>
     <% for x = LBound(MultipleImages) to UBound(MultipleImages)%>
       <img src="../ProductImages/<%=MultipleImages(x)%>" align="middle"><br>  
     <%next%>
       <%else%>
          No Image.
        <%end if%>
      <%end if%>
      
      <%if ucase(Request.Form("showDescriptions")) = "ON" then%>
        <%=rsProducts("cDescription")%>
      <%end if%>
      
        <%if ucase(Request.Form("showOptions")) = "ON" or Request.QueryString("SO") = "ON" then%>  
          <% for i = 0 to 9 %>
            <% If rsProducts("cUser" & Cstr(i)) <> "" Then %>
              <br><%=rsProducts("cUser" & Cstr(i))%><br>  
            <%end if%>
          <%next%>  
        <%end if%>
    </td>

  <%if ucase(Request.Form("showCostPrice")) = "ON" or Request.QueryString("SCP") = "ON" then%>
    <td class="TDSkins">
      <%=formatcurrency(rsProducts("cCost"),2)%> </td>
    <td class="TDSkins">
      <%=formatcurrency(rsProducts("cPrice"),2)%> 
    </td>
  <%end if%>

  <%if ucase(Request.Form("showMarkup")) = "ON" or Request.QueryString("SM") = "ON" then%>
    <td class="TDSkins">
      <%if rsProducts("cCost") = 0 or rsProducts("cCost") = "" then%>
        n/a
      <%else%>
        <%=formatpercent(rsProducts("cPrice")/rsProducts("cCost"),1,-1)%>  
      <%end if%>
    </td>
  <%end if%>

  <%if ucase(Request.Form("showQty")) = "ON" or Request.QueryString("SQ") = "ON" then%>
    <td class="TDSkins">
      <%=rsProducts("cStock")%> 
    </td>
  <%end if%>
  
  <td class="TDSkins">
    <a href="ProductForm.asp?Function=EDIT&ProdID=<%=Server.URLEncode(PID)%>&Keyword=<%=keyword%>&SI=<%=Request.Form("ShowImages")%>&SO=<%=Request.Form("ShowOptions")%>&SM=<%=Request.Form("ShowMarkUp")%>&SD=<%=Request.Form("ShowDescriptions")%>&SCP=<%=Request.Form("ShowCostPrice")%>&SQ=<%=Request.Form("ShowQty")%>&SE=<%=Request.Form("ShowErrors")%>">Go</a>
    </td>
    <td class="TDSkins">
    <input type="checkbox" name="SetProductOFF<%=i%>" value="ON"
    
    <%if ucase(rsProducts("cShowProduct")) = "YES" then%>
      checked
    <%end if%>><%=rsProducts("CatalogID")%></td>
  
  </tr>

      <input type="hidden" name="SetProductShowONOFF<%=i%>" value=<%=rsProducts("catalogID")%>>
      <%
      LineCounter = LineCounter +1
      end if
      rsProducts.MoveNext
      
      Wend
      rsProducts.close
      set rsProducts= nothing
      dbc.close
      set dbc= nothing
      %>

      
  <tr>
    <td class="TDSkins" colspan="9">
      <input type="hidden" name="SetUPPOLinecounter"value=<%=LineCounter%>>
      <input class="InputSkins" type="submit" value="Submit" name="B1">
    </td>
  
  </tr>

</table>
<%="<br>" & session("SQLstr")%>
</form>
</body>
</html><!-- #include file="../ReadFile.asp" -->
This include file is NOT output to debug file.