Following is aimed to provide registered users with a page to view their activity history and edit their personal profile ...
Main template uses several <cfinclude>. Each included template has a generic purpose or specific to the main template ...
-----------------------------------------------------------------------------------
myProfile.cfm is the main template which includes several other templates to fill columns and/or tables (here is the code):
<cfif isdefined("session.UserName"
>
<cfif isdefined("URL.ID"
>
<cfquery name="getUser" datasource="deco" dbtype="odbc">
select *
from sysAccounts
where UserID=#session.UserID#
</cfquery>
<cfquery name="getID" datasource="deco" dbtype="odbc">
select *
from sysUserID
where UserID=#session.UserID#
</cfquery>
</cfif>
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<cfset session.PageTitle="Registration Form">
<html>
<cfinclude template="_JavScripts.cfm">
<head>
<title>Shelley Biotechnologies, Inc.</title>
<!--- Load CSS settings --->
<cfinclude template="_styles.cfm">
</head>
<BODY bgcolor="4682B4" topmargin="6">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="ffdead">
<td colspan="2">
<cfinclude template="_header.cfm">
</td>
</tr>
<tr bgcolor="ffdead">
<td colspan="2">
<cfinclude template="_toprow.cfm">
</td>
</tr>
<tr>
<td bgcolor="ffdead" height="220" valign="top" width="18%">
<font class="nav">
<cfinclude template="_navBar.cfm">
</font>
</td>
<td bgcolor="ffdead" valign="top" height="100%" width="82%">
<table bgcolor="white" height="100%" width="98%" border="1" frame="box" bordercolor="black">
<tr>
<td width="100%" height="100%">
<cfform name="uptProfile" action="profileManager.cfm?method=Update" method="post">
<table border="0" height="100%" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="100%" width="30%" valign="top" align="left">
<cfinclude template="myProfileCol01.cfm"><br>
</td>
<td height="100%" width="30%" align="right" valign="top" bgcolor="lightgrey">
<cfinclude template="myProfileCol02.cfm">
</td>
<td height="100%" width="45%" valign="top" align="left" bgcolor="lightgrey">
<cfinclude template="myProfileCol03.cfm">
</td>
</tr>
<tr>
<td>
</td>
<td valign="top" bgcolor="lightgrey">
• Required Field
</td>
<td align="right" bgcolor="lightgrey">
<input type="submit" value=" Update ">
</td>
</tr>
</table>
</cfform>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="ffdead" height="120" colspan="2" align="center">
<font class="nav">
<cfinclude template="_hormenu.cfm">
</font>
<p>
<cfinclude template="_footer.cfm">
</td>
</tr>
</table>
<!--- Show phone number @ absolute position --->
<!--- <img class="flex" src="images/comphone.jpg"> --->
</body>
</html>
----------------------------------------------------------------------------------------
_vermenu.cfm is the template which shows list of product types with links to their associated CF templates - Here's the code:
<cfquery name="categories" datasource="deco">
select *
from sysProdType
</cfquery>
<img src="images/sp15.gif" width="5">
<li><a href="index.cfm">
Home
</a></li>
<cfif "#categories.recordcount#" gt "0">
<cfoutput query="categories">
<img src="images/sp15.gif" width="5">
<li><a href="searchItem.cfm?itemType=#categories.CategoryID#">
#categories.CategoryCode#
</a></li>
</cfoutput>
</cfif>
<table width="96%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
</tr>
<tr>
<td>
<font size="2">
Find it here!
</font>
</td>
</tr>
<tr>
<td>
<form name="frmJumpMenu">
<select name="selJumpMenu" onChange="JumpMenu('parent',this,0)">
<option value="search.cfm?key=Products" selected>Products</option>
<cfoutput query="categories">
<option value="searchItem.cfm?itemType=#categories.CategoryID#">#categories.CategoryCode#</option>
</cfoutput>
</select>
</form>
</td>
</tr>
</table>
----------------------------------------------------------------------------------
myProfileCol01.cfm is the template responsible for loading and showing applicable options to user - Here's the code:
<cfif ("getUser.recordcount" IS NOT "0"
AND ("getID.recordcount" IS NOT "0"
>
<cfoutput>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" align="left" bgcolor="lightblue">
<center><b>Last Updated</b></center><br>
<cfif "getUser.LastUpdated" IS NOT "">
#getUser.LastUpdated#
<cfelse>
Never!
</cfif>
</td>
</tr>
<tr>
<td valign="top" align="left">
<p>
<center><b>History Tracker</b></center>
<font class="nav">
<li><a href="">Track an Order</a></li>
<li><a href="">Things you purchased</a></li>
</font>
</td>
</tr>
</table>
</cfoutput>
</cfif>
*** <END-OF-CODE> ***
I am getting error on line 9 of myProfileCol01.cfm when attempting to show #getUser.LastUpdated#. I have checked table's field name and it is a perfect match (I even dragged it in).
I am using MS Access. The field is blank, so I can't even understand why is condition true if I am checking if as not blank (<cfif "#getUser.LastUpdated#" IS NOT "">). The field is TEXT type.
Sorry for the long post, but I figure that if you see the code, you stand a better chance to find the actual problem and I getting an answer
)
Thank you all in advance;
josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
Main template uses several <cfinclude>. Each included template has a generic purpose or specific to the main template ...
-----------------------------------------------------------------------------------
myProfile.cfm is the main template which includes several other templates to fill columns and/or tables (here is the code):
<cfif isdefined("session.UserName"

<cfif isdefined("URL.ID"

<cfquery name="getUser" datasource="deco" dbtype="odbc">
select *
from sysAccounts
where UserID=#session.UserID#
</cfquery>
<cfquery name="getID" datasource="deco" dbtype="odbc">
select *
from sysUserID
where UserID=#session.UserID#
</cfquery>
</cfif>
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<cfset session.PageTitle="Registration Form">
<html>
<cfinclude template="_JavScripts.cfm">
<head>
<title>Shelley Biotechnologies, Inc.</title>
<!--- Load CSS settings --->
<cfinclude template="_styles.cfm">
</head>
<BODY bgcolor="4682B4" topmargin="6">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="ffdead">
<td colspan="2">
<cfinclude template="_header.cfm">
</td>
</tr>
<tr bgcolor="ffdead">
<td colspan="2">
<cfinclude template="_toprow.cfm">
</td>
</tr>
<tr>
<td bgcolor="ffdead" height="220" valign="top" width="18%">
<font class="nav">
<cfinclude template="_navBar.cfm">
</font>
</td>
<td bgcolor="ffdead" valign="top" height="100%" width="82%">
<table bgcolor="white" height="100%" width="98%" border="1" frame="box" bordercolor="black">
<tr>
<td width="100%" height="100%">
<cfform name="uptProfile" action="profileManager.cfm?method=Update" method="post">
<table border="0" height="100%" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="100%" width="30%" valign="top" align="left">
<cfinclude template="myProfileCol01.cfm"><br>
</td>
<td height="100%" width="30%" align="right" valign="top" bgcolor="lightgrey">
<cfinclude template="myProfileCol02.cfm">
</td>
<td height="100%" width="45%" valign="top" align="left" bgcolor="lightgrey">
<cfinclude template="myProfileCol03.cfm">
</td>
</tr>
<tr>
<td>
</td>
<td valign="top" bgcolor="lightgrey">
• Required Field
</td>
<td align="right" bgcolor="lightgrey">
<input type="submit" value=" Update ">
</td>
</tr>
</table>
</cfform>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="ffdead" height="120" colspan="2" align="center">
<font class="nav">
<cfinclude template="_hormenu.cfm">
</font>
<p>
<cfinclude template="_footer.cfm">
</td>
</tr>
</table>
<!--- Show phone number @ absolute position --->
<!--- <img class="flex" src="images/comphone.jpg"> --->
</body>
</html>
----------------------------------------------------------------------------------------
_vermenu.cfm is the template which shows list of product types with links to their associated CF templates - Here's the code:
<cfquery name="categories" datasource="deco">
select *
from sysProdType
</cfquery>
<img src="images/sp15.gif" width="5">
<li><a href="index.cfm">
Home
</a></li>
<cfif "#categories.recordcount#" gt "0">
<cfoutput query="categories">
<img src="images/sp15.gif" width="5">
<li><a href="searchItem.cfm?itemType=#categories.CategoryID#">
#categories.CategoryCode#
</a></li>
</cfoutput>
</cfif>
<table width="96%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
</tr>
<tr>
<td>
<font size="2">
Find it here!
</font>
</td>
</tr>
<tr>
<td>
<form name="frmJumpMenu">
<select name="selJumpMenu" onChange="JumpMenu('parent',this,0)">
<option value="search.cfm?key=Products" selected>Products</option>
<cfoutput query="categories">
<option value="searchItem.cfm?itemType=#categories.CategoryID#">#categories.CategoryCode#</option>
</cfoutput>
</select>
</form>
</td>
</tr>
</table>
----------------------------------------------------------------------------------
myProfileCol01.cfm is the template responsible for loading and showing applicable options to user - Here's the code:
<cfif ("getUser.recordcount" IS NOT "0"


<cfoutput>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" align="left" bgcolor="lightblue">
<center><b>Last Updated</b></center><br>
<cfif "getUser.LastUpdated" IS NOT "">
#getUser.LastUpdated#
<cfelse>
Never!
</cfif>
</td>
</tr>
<tr>
<td valign="top" align="left">
<p>
<center><b>History Tracker</b></center>
<font class="nav">
<li><a href="">Track an Order</a></li>
<li><a href="">Things you purchased</a></li>
</font>
</td>
</tr>
</table>
</cfoutput>
</cfif>
*** <END-OF-CODE> ***
I am getting error on line 9 of myProfileCol01.cfm when attempting to show #getUser.LastUpdated#. I have checked table's field name and it is a perfect match (I even dragged it in).
I am using MS Access. The field is blank, so I can't even understand why is condition true if I am checking if as not blank (<cfif "#getUser.LastUpdated#" IS NOT "">). The field is TEXT type.
Sorry for the long post, but I figure that if you see the code, you stand a better chance to find the actual problem and I getting an answer

Thank you all in advance;
josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours