Hello,
I have a master detail thing going on. On the master page I click on a category link that brings up all the products for that category. Then you can click on a product and it shows up in the detail page. I want to be able to navigate in the detail page with Next and Previous. Can someone help me out. The master and detail pages are below.
Thanks in advance,
Guzz11
<web address removed --mrichmon Page Editor>
MASTER PAGE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<cfset CurrentPage=GetFileFromPat
h(GetTempl
atePath())
>
<cfparam name="PageNum_rsProducts" default="1">
<cfparam name="sql_orderby" default="Item_Price">
<cfset CurrentPage=GetFileFromPat
h(GetTempl
atePath())
>
<cfparam name="url.tfm_orderby" default="Item_Price">
<cfparam name="url.tfm_order" default="ASC">
<cfset sql_orderby = "#tfm_orderby# #tfm_order#">
<cfquery name="rsCategories" datasource="connStore">
SELECT *
FROM tblCategories
</cfquery>
<cfquery name="rsProducts" datasource="connStore">
SELECT *
FROM tblProducts
ORDER BY #sql_orderby#
</cfquery>
<cfquery name="rsPreferences" datasource="connStore">
SELECT * FROM tblPreferences
</cfquery>
<cfquery name="rsMailingList" datasource="connStore">
SELECT * FROM tblMailingList
</cfquery>
<cfset MaxRows_rsProducts=5>
<cfset StartRow_rsProducts=Min((P
ageNum_rsP
roducts-1)
*MaxRows_r
sProducts+
1,Max(rsPr
oducts.Rec
ordCount,1
))>
<cfset EndRow_rsProducts=Min(Star
tRow_rsPro
ducts+MaxR
ows_rsProd
ucts-1,rsP
roducts.Re
cordCount)
>
<cfset TotalPages_rsProducts=Ceil
ing(rsProd
ucts.Recor
dCount/Max
Rows_rsPro
ducts)>
<cfset QueryString_rsProducts=Iif
(CGI.QUERY
_STRING NEQ "",DE("&"&XMLFormat(CGI.QU
ERY_STRING
)),DE(""))
>
<cfset tempPos=ListContainsNoCase
(QueryStri
ng_rsProdu
cts,"PageN
um_rsProdu
cts=","&")
>
<cfif tempPos NEQ 0>
<cfset QueryString_rsProducts=Lis
tDeleteAt(
QueryStrin
g_rsProduc
ts,tempPos
,"&")>
</cfif>
<cfscript>
//sort column headers for rsProducts
tfm_saveParams = "keyword";
tfm_keepParams = "";
if(tfm_order EQ "ASC") {
tfm_order = "DESC";
}else{
tfm_order = "ASC";
}
if(ListLen(tfm_saveParams)
GT 0) {
tfm_params=ListToArray(tfm
_saveParam
s,",");
For (i=1; i LTE ArrayLen(tfm_params); i=i+1) {
if(isDefined(tfm_params[i]
)) {
tfm_temp = tfm_params[i];
if(isDefined("form." & tfm_params[i])) tfm_temp = "form." & tfm_params[i];
tfm_keepParams = tfm_keepParams & LCase(tfm_params[i]) & "=" & URLEncodedFormat(Evaluate(
tfm_temp))
& "&";
}
}
}
tfm_orderbyURL = CGI.SCRIPT_NAME & "?" & tfm_keepParams & "tfm_order=" & tfm_order & "&tfm_orderby=";
</cfscript>
<html>
<head>
<title>Quality Collection Catalog sells gift items for every occasion!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.
com) -->
<!-- Web URL:
http://fineline.xs.mw -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,lo
cation=0,s
tatusbar=0
,menubar=0
,resizable
=0,width=7
00,height=
700,left = 162,top = 34');");
}
// End -->
</script>
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="siteborder">
<tr>
<td><cfinclude template="includes/header.
cfm"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18%" valign="top" bgcolor="#E3E8F2"><TABLE width="159" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E3E8F2">
<TR>
<TD valign="top">
<cfinclude template="includes/email.c
fm"> <TABLE border="0" cellpadding="0" cellspacing="0" bgcolor="#172E5C">
<TR>
<TR>
<TD width="160" height="16" bgcolor="#172E5C"><DIV align="center"><IMG src="images/prod_cat.gif" width="159" height="17"></DIV></TD>
</TR>
</TABLE>
<cfinclude template="includes/leftnav
.cfm">
<br></TD>
</TR>
</TABLE>
</td>
<td width="64%" valign="top" class="leftrightborder"><T
ABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<TR>
<TD height="28" valign="top"><IMG src="images/design_banner.
gif" width="564" height="55" align="top"></TD>
</TR>
<TR>
<TD height="113"> <table width="90%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#BBD7F2">
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#F2F8FD">
<tr>
<td><a href="
http://www.andrewguzman.com" target="_blank" class="topbox">
www.andrewguzman.com<
/a><br>
<span class="topbox">This site was designed and developed by Andrew of andrewguzman.com. In this box will probably be some ads. Do not buy anything from this site. This site is only for show. I will probably use it at a later time to put up my online store. </span></td>
</tr>
</table></td>
</tr>
</table> </TD>
</TR>
<TR>
<TD height="366" valign="top" bgcolor="#FFFFFF"><br>
<cfif rsProducts.recordcount>
<TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<TR>
<TD width="6%"> </TD>
<TD width="14%"><a href="<cfoutput>#tfm_order
byURL#</cf
output>Ite
m_Price" class="blue_text"><strong>
Sort by Price</strong></a></TD>
<TD width="80%">
<DIV align="right">
<cfif PageNum_rsProducts GT 1>
<a href="<cfoutput>#CurrentPa
ge#?PageNu
m_rsProduc
ts=#Max(De
crementVal
ue(PageNum
_rsProduct
s),1)##Que
ryString_r
sProducts#
</cfoutput
>" class="blue_text"><strong>
< prev</strong></a>
</cfif>
<span class="blue_text">|</span>
<span class="blue_text">
<cfscript>
//TM_PagesEndCount;
For (i=1; i LTE TotalPages_rsProducts; i = i + 1) {
If(i NEQ PageNum_rsProducts) {
WriteOutput('<a href="#CurrentPage#?PageNu
m_rsProduc
ts=#i##Que
ryString_r
sProducts#
" class="blue_text">#i#</a>'
);
}Else{
WriteOutput("<strong>#i#</
strong>");
}
If(i neq TotalPages_rsProducts) WriteOutput(" ");
}
</cfscript>
</span> <span class="blue_text">|</span>
<cfif PageNum_rsProducts LT TotalPages_rsProducts>
<a href="<cfoutput>#CurrentPa
ge#?PageNu
m_rsProduc
ts=#Min(In
crementVal
ue(PageNum
_rsProduct
s),TotalPa
ges_rsProd
ucts)##Que
ryString_r
sProducts#
</cfoutput
>" class="blue_text"><strong>
next ></strong></a>
</cfif>
</DIV></TD>
</TR>
</TABLE>
<br>
<cfoutput query="rsProducts" startRow="#StartRow_rsProd
ucts#" maxRows="#MaxRows_rsProduc
ts#">
<TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<TR>
<TD width="100" height="80"><DIV align="center">
<TABLE width="71%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="8795B6">
<TR>
<TD><DIV align="center"><A HREF="javascript:popUp('la
rge_image.
cfm?ID=#rs
Products.I
D#')">
<img src="images/small jpgs/#rsProducts.Small_Ima
ge#" alt="Click image to Enlarge!" border="0"></a></DIV></TD>
</TR>
</TABLE>
</DIV></TD>
<TD colspan="2">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="5">
<TR>
<TD><TABLE width="95%" border="0" align="center" cellpadding="4" cellspacing="0">
<TR>
<TD width="92%" height="23"><B><a href="detail.cfm?ID=#rsPro
ducts.ID#"
class="blue_text">#rsProdu
cts.Item_N
ame#</a></
B></TD>
<TD width="8%"> </TD>
</TR>
</TABLE>
<TABLE width="97%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="A9BCD8">
<TR>
<TD align="left"><IMG src="images/trans.gif" width="5" height="1"></TD>
</TR>
</TABLE>
<form target="paypal" action="
https://www.paypal.com/cgi-bin/webscr"
method="post">
<TABLE width="95%" border="0" align="center" cellpadding="4" cellspacing="0">
<TR>
<TD width="49%" height="20" valign="top">
<P align="left"><IMG src="images/price.gif" width="61" height="14" align="absmiddle"><span class="blue_text">#dollarf
ormat(rsPr
oducts.Ite
m_Price)#<
/span><br>
<br>
<img src="images/quantity.gif" width="56" height="14">
<input name="quantity" type="text" value="1" size="3">
<br> </TD>
<TD width="51%" valign="top">
<input type="image" src="images/add_cart.gif" width="80" height="14" hspace="5" border="0" name="submit" alt="Add to Cart!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="#rsPreferences.EMai
l#">
<input type="hidden" name="item_name" value="#rsProducts.Item_Na
me#">
<input type="hidden" name="item_number" value="#rsProducts.Item_ID
#">
<input type="hidden" name="amount" value="#dollarformat(rsPro
ducts.Item
_Price)#">
<input type="hidden" name="page_style" value="QC_Catalog">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="
http://www.andrewguzman.com">
<input type="hidden" name="cancel_return" value="
http://www.qccatalog.com/cancel.cfm">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</TD>
</TR>
</TABLE>
</form>
<TABLE width="97%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="A9BCD8">
<TR>
<TD align="left"><IMG src="images/trans.gif" width="5" height="1"></TD>
</TR>
</TABLE>
<table width="95%" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td><div align="left"><a href="detail.cfm?ID=#rsPro
ducts.ID#"
><img src="images/click_here.gif
" width="193" height="12" border="0" align="absbottom"></a></di
v></td>
</tr>
</table>
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>
<br>
</cfoutput>
<cfelse>
<TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<TR>
<TD>
<DIV align="center"><BR>
<BR>
<BR>
Sorry, no items were found. Please try another search.<BR>
<BR>
<BR>
<BR>
<BR>
</DIV></TD>
</TR>
</TABLE>
</cfif>
<TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<TR>
<TD>
<DIV align="right">
<cfif PageNum_rsProducts GT 1>
<a href="<cfoutput>#CurrentPa
ge#?PageNu
m_rsProduc
ts=#Max(De
crementVal
ue(PageNum
_rsProduct
s),1)##Que
ryString_r
sProducts#
</cfoutput
>" class="blue_text"><strong>
< prev</strong></a>
</cfif>
<span class="blue_text">|</span>
<span class="blue_text">
<cfscript>
//TM_PagesEndCount;
For (i=1; i LTE TotalPages_rsProducts; i = i + 1) {
If(i NEQ PageNum_rsProducts) {
WriteOutput('<a href="#CurrentPage#?PageNu
m_rsProduc
ts=#i##Que
ryString_r
sProducts#
" class="blue_text">#i#</a>'
);
}Else{
WriteOutput("<strong>#i#</
strong>");
}
If(i neq TotalPages_rsProducts) WriteOutput(" ");
}
</cfscript>
</span> <span class="blue_text">|</span>
<cfif PageNum_rsProducts LT TotalPages_rsProducts>
<a href="<cfoutput>#CurrentPa
ge#?PageNu
m_rsProduc
ts=#Min(In
crementVal
ue(PageNum
_rsProduct
s),TotalPa
ges_rsProd
ucts)##Que
ryString_r
sProducts#
</cfoutput
>" class="blue_text"><strong>
next ></strong></a>
</cfif>
</DIV></TD>
</TR>
</TABLE></TD>
</TR>
<TR>
<TD valign="top" bgcolor="#FFFFFF"><IMG src="images/trans.gif" width="1" height="15"></TD>
</TR>
</TABLE> <br></td>
<td width="18%" valign="top" bgcolor="#E3E8F2"><TABLE width="159" height="106%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD width="198" valign="top" bgcolor="#E3E8F2">
<cfinclude template="includes/viewcar
t.cfm">
<TABLE border="0" cellpadding="0" cellspacing="0" bgcolor="#172E5C">
<TR>
<TR>
<TD width="160" height="16" bgcolor="#172E5C"><DIV align="center"><IMG src="images/sale_items.gif
" width="159" height="17"></DIV></TD>
</TR>
</TABLE> <cfinclude template="includes/sales.c
fm"> <TABLE border="0" cellpadding="0" cellspacing="0" bgcolor="#172E5C">
<TR>
<TR>
<TD></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></td>
</tr>
<tr>
<td colspan="3" valign="top" bgcolor="#172E5C">
<cfinclude template="includes/bottomn
av.cfm">
<br></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
DETAIL PAGE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<cfquery name="rsCategories" datasource="connStore">
SELECT * FROM tblCategories
</cfquery>
<cfquery name="rsProducts" datasource="connStore">
SELECT * FROM tblProducts WHERE ID = #url.id#
</cfquery>
<cfquery name="rsPreferences" datasource="connStore">
SELECT * FROM tblPreferences
</cfquery>
<html>
<head>
<title>Quality Collection Catalog sells gift items for every occasion!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,lo
cation=0,s
tatusbar=0
,menubar=0
,resizable
=0,width=7
00,height=
700,left = 162,top = 0');");
}
</script>
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="siteborder">
<tr>
<td><cfinclude template="includes/header.
cfm"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18%" valign="top" bgcolor="#E3E8F2"><TABLE width="159" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E3E8F2">
<TR>
<TD valign="top">
<cfinclude template="includes/email.c
fm"> <TABLE border="0" cellpadding="0" cellspacing="0" bgcolor="#172E5C">
<TR>
<TR>
<TD width="160" height="16" bgcolor="#172E5C"><DIV align="center"><IMG src="images/prod_cat.gif" width="159" height="17"></DIV></TD>
</TR>
</TABLE>
<cfinclude template="includes/leftnav
.cfm">
<br></TD>
</TR>
</TABLE>
<cfoutput><A href="results.cfm?Name=#rs
Categories
.Name#" id=linkset><span class="leftnav"></span></a
></cfoutpu
t></td>
<td width="64%" valign="top" class="leftrightborder"><t
able width="100%" border="0" cellpadding="0" cellspacing="0" c>
<tr>
<td><IMG src="images/design_banner.
gif" width="564" height="55" align="top"></td>
</tr>
<tr>
<td height="113"><table width="90%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#BBD7F2">
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#F2F8FD">
<tr>
<td><a href="
http://www.andrewguzman.com" target="_blank" class="topbox">
www.andrewguzman.com<
/a><br>
<span class="topbox">This site was designed and developed by Andrew of andrewguzman.com. In this box will probably be some ads. Do not buy anything from this site. This site is only for show. I will probably use it at a later time to put up my online store. </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="5">
<TR>
<TD width="30%" height="140" rowspan="2"><DIV>
<DIV align="center">
<TABLE width="46%" border="0" cellpadding="1" cellspacing="0" bgcolor="#8795B6">
<TR>
<TD><DIV align="center"><A HREF="javascript:popUp('la
rge_image.
cfm?ID=<cf
output>#rs
Products.I
D#</cfoutp
ut>')"><IM
G src="images/medium jpgs/<cfoutput>#rsProducts
.Medium_Im
age#</cfou
tput>" alt="Click on Image to view larger!" border="0"></a><FONT color="#C6C3C6"><BR>
</FONT></DIV></TD>
</TR>
</TABLE>
<A HREF="javascript:popUp('la
rge_image.
cfm?ID=<cf
output>#rs
Products.I
D#</cfoutp
ut>')" class="blue_text">Click image to Enlarge!</A></DIV>
</DIV></TD>
<TD width="70%" height="106"><form target="paypal" action="
https://www.paypal.com/cgi-bin/webscr"
method="post">
<TABLE width="90%" height="111" border="0" align="left" cellpadding="0" cellspacing="7">
<TR>
<TD height="94"><P><cfoutput><
strong class="blue_text">#rsProdu
cts.Item_N
ame#</stro
ng></cfout
put><br>
<br>
<IMG src="images/price.gif" width="61" height="14" align="absbottom"><cfoutpu
t><span class="blue_text">#dollarf
ormat(rsPr
oducts.Ite
m_Price)#<
/span></cf
output><BR
>
<BR>
<cfoutput><span class="blue_text">#rsProdu
cts.Item_D
escription
#</span></
cfoutput> <br>
<br>
<img src="images/quantity.gif" width="56" height="14">
<input name="quantity" type="text" value="1" size="3">
<input type="image" src="images/add_cart.gif" width="80" height="14" hspace="5" border="0" name="submit" alt="Add to Cart!">
<cfoutput>
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="#rsPreferences.EMai
l#">
<input type="hidden" name="item_name" value="#rsProducts.Item_Na
me#">
<input type="hidden" name="item_number" value="#rsProducts.Item_ID
#">
<input type="hidden" name="amount" value="#dollarformat(rsPro
ducts.Item
_Price)#">
<input type="hidden" name="page_style" value="QC_Catalog">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="
http://www.andrewguzman.com">
<input type="hidden" name="cancel_return" value="
http://www.qccatalog.com/cancel.cfm">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</cfoutput> </TD>
</TR>
</TABLE>
</form></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TABLE></td>
</tr>
</table>
<br></td>
<td width="18%" valign="top" bgcolor="#E3E8F2"><TABLE width="159" height="106%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD width="198" valign="top" bgcolor="#E3E8F2">
<cfinclude template="includes/viewcar
t.cfm"> <TABLE border="0" cellpadding="0" cellspacing="0" bgcolor="#172E5C">
<TR>
<TR>
<TD width="160" height="16" bgcolor="#172E5C"><DIV align="center"><IMG src="images/sale_items.gif
" width="159" height="17"></DIV></TD>
</TR>
</TABLE> <TABLE border="0" cellpadding="0" cellspacing="0" bgcolor="#172E5C">
<TR>
</TABLE></TD>
</TR>
</TABLE>
<cfinclude template="includes/sales.c
fm"></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" valign="top" bgcolor="#172E5C">
<cfinclude template="includes/bottomn
av.cfm">
<br></td>
</tr>
</table>
</body>
</html>
Start Free Trial