home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Examples / store / showcategories.cfm < prev    next >
Encoding:
Text File  |  1999-04-12  |  1.7 KB  |  64 lines

  1. <!--- This CFQUERY retrieves the categories from the database --->
  2. <CFQUERY DATASOURCE="CFexamples" NAME="GetCategories">
  3.     SELECT CategoryID, CategoryName, CategoryDesc FROM StoreCategories
  4. </CFQUERY>
  5.  
  6. <HTML>
  7. <HEAD>
  8. <TITLE>Online Store - Choose Category</TITLE>
  9. </HEAD>
  10.  
  11. <BODY BGCOLOR="FFcc33" BACKGROUND="images/storebg.gif" LEFTMARGIN=5 TOPMARGIN=0>
  12.  
  13. <SPAN STYLE="position: absolute; left: 220px; top: 30px">
  14. <img src="images/cover_store.jpg" width=300 height=335 alt="" border="0" vspace="0" hspace="0">
  15. </SPAN>
  16.  
  17.  
  18. <SPAN STYLE="position: absolute; left: 145px; top: 45px">
  19.     <IMG SRC="images/tack2.gif" WIDTH=249 HEIGHT=58 BORDER=0 ALT="TACK2">
  20. </SPAN>
  21.  
  22. <SPAN STYLE="position: absolute; left: 200px; width: 350px; top: 380px">
  23.     <!--- This CFOUTPUT block loops over the GetCategories query
  24.           and creates the following HTML for each one. --->
  25.     <TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0" WIDTH="350">
  26.  
  27.     <CFOUTPUT QUERY="GetCategories">
  28.  
  29.     <FORM ACTION="showitems.cfm" METHOD="GET">
  30.         
  31.         <!--- This form variable tells showitems.cfm which 
  32.               category to get items from --->
  33.         <INPUT TYPE="HIDDEN" NAME="CategoryID" VALUE="#CategoryID#">
  34.  
  35.     <TR>
  36.         <TD><FONT FACE="Arial Black, Helvetica Bold, Geneva, Helvetica" SIZE="5" COLOR="##000000"><I>#CategoryName#</I></FONT></TD>
  37.         <TD ALIGN="RIGHT"><FONT FACE="Helvetica" SIZE="-1"><INPUT TYPE="SUBMIT" VALUE="Browse"></FONT></TD>
  38.     </TR>
  39.     <TR>
  40.         <TD COLSPAN="2"><FONT FACE="Helvetica" SIZE="-1">#CategoryDesc#</FONT></TD>
  41.     </TR>
  42.     <TR>
  43.         <TD HEIGHT="15"> </TD>
  44.     </TR>
  45.  
  46.     </FORM>
  47.     
  48.     </CFOUTPUT>
  49.             
  50.     <TR>
  51.         <TD HEIGHT="50"> </TD>
  52.     </TR>
  53.             
  54.     </TABLE>
  55.         
  56.     <CF_SHOWDOC ID=1>
  57.  
  58. </SPAN>
  59.  
  60. <CFINCLUDE TEMPLATE="_showcart.cfm">
  61.  
  62. </BODY>
  63. </HTML>
  64.