Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Captain Ru #1
Am I wasting my time? I seek council.
My page has <cfinclude> to create the top menu, which includes text input
fields for search parameters. Another <cfinclude> sets a page to below and
left, which displays names and record info read from a database. I would like
the search field to pop up the find in the left area, but is that possible?
That's where the <cfinclude> file is.
Captain Ru Guest
-
Hide and Seek Tools
I have lost my main tool selector. I tried to hide it and then show it (command-F2), but it did not reappear. Any ideas? -
quicktime seek and currentime
Hello I am trying to make a program which has power point slides(jpgs) and a talking head video which is in quicktime format.....i need to... -
seek for help
Hi All, I got a question about connecting the SQL server database with a asp page. I just wanna know if I got a asp page in a location A and... -
illegal seek
I was debugging a totally unrelated problem yesterday and put in a quick and dirty print line with $! in it. Now as it happened the bit of code I... -
Council to make an sp.
I must to implent a sp that checks data into a one to one relationed table and let me know if all data is available or not. To better understand... -
jorgepino #2
Re: Am I wasting my time? I seek council.
do you have any code you can post?
jorgepino Guest
-
Captain Ru #3
Re: Am I wasting my time? I seek council.
empdir.cfm
<cfinclude template="topmenu.cfm">
<table width = "100%">
<tr>
<td width ="50%"><cfinclude template="leftmenu.cfm"></td>
<td><cfinclude template="data.cfm"></td>
</tr>
</table>
Captain Ru Guest
-
Captain Ru #4
Re: Am I wasting my time? I seek council.
topmenu.cfm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>EMP List</title>
<link rel="stylesheet" type="text/css" href="CSS/emp.css">
<SCRIPT language="JavaScript">
if (document.images)
{
pic1on= new Image(11,11);
pic1on.src="Images/sort_asc_over.jpg";
pic2on= new Image(11,11);
pic2on.src="Images/sort_desc_over.jpg";
pic3on= new Image(11,11);
pic3on.src="Images/sort_asc_over.jpg";
pic4on= new Image(11,11);
pic4on.src="Images/sort_desc_over.jpg";
pic5on= new Image(11,11);
pic5on.src="Images/sort_asc_over.jpg";
pic6on= new Image(11,11);
pic6on.src="Images/sort_desc_over.jpg";
pic7on= new Image(11,11);
pic7on.src="Images/sort_asc_over.jpg";
pic8on= new Image(11,11);
pic8on.src="Images/sort_desc_over.jpg";
pic1off= new Image(11,11);
pic1off.src="Images/sort_asc.jpg";
pic2off= new Image(11,11);
pic2off.src="Images/sort_desc.jpg";
pic3off= new Image(11,11);
pic3off.src="Images/sort_asc.jpg";
pic4off= new Image(11,11);
pic4off.src="Images/sort_desc.jpg";
pic5off= new Image(11,11);
pic5off.src="Images/sort_asc.jpg";
pic6off= new Image(11,11);
pic6off.src="Images/sort_desc.jpg";
pic7off= new Image(11,11);
pic7off.src="Images/sort_asc.jpg";
pic8off= new Image(11,11);
pic8off.src="Images/sort_desc.jpg";
}
function lightup(imgName)
{
if (document.images)
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
}
}
function turnoff(imgName)
{
if (document.images)
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
}
}
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0">
<table bgcolor="#EEE8AA" width="100%" height = "10%" cellpadding="0"
cellspacing="0" border="1">
<tr>
<td colspan = "5" align = "center"> </td>
</tr>
<tr bgcolor="#ffffff">
<th width="120" nowrap align="left"> Last:<img
src="Images/sort_asc.jpg" name="pic1" width="11" height="11"
style="cursor:hand"
onClick="window.open('Emp_List.cfm?Sort=Last_asc', 'mainFrame')"
onMouseover="lightup('pic1')" onMouseout="turnoff('pic1')"><img
style="cursor:hand" src="Images/sort_desc.jpg"
onClick="window.open('Emp_List.cfm?Sort=Last_DESC' ,'mainFrame')" name="pic2"
onMouseover="lightup('pic2')" onMouseout="turnoff('pic2')"></th>
<th width="110" nowrap align="left"> First:<img style="cursor:hand"
src="Images/sort_asc.jpg"
onClick="window.open('Emp_List.cfm?Sort=First_asc' ,'mainFrame')" name="pic3"
onMouseover="lightup('pic3')" onMouseout="turnoff('pic3')"><img
style="cursor:hand" src="Images/sort_desc.jpg"
onClick="window.open('Emp_List.cfm?Sort=First_DESC ','mainFrame')" name="pic4"
onMouseover="lightup('pic4')" onMouseout="turnoff('pic4')"></th>
<th width="65" nowrap align="left"> Ext:<img style="cursor:hand"
src="Images/sort_asc.jpg"
onClick="window.open('Emp_List.cfm?Sort=Ext_asc',' mainFrame')" name="pic5"
onMouseover="lightup('pic5')" onMouseout="turnoff('pic5')"><img
style="cursor:hand" src="Images/sort_desc.jpg"
onClick="window.open('Emp_List.cfm?Sort=EXT_DESC', 'mainFrame')" name="pic6"
onMouseover="lightup('pic6')" onMouseout="turnoff('pic6')"></th>
<th width="110" nowrap align="left"> Branch:<img style="cursor:hand"
src="Images/sort_asc.jpg"
onClick="window.open('Emp_List.cfm?Sort=BRANCH_asc ','mainFrame')" name="pic7"
onMouseover="lightup('pic7')" onMouseout="turnoff('pic7')"><img
style="cursor:hand" src="Images/sort_desc.jpg"
onClick="window.open('Emp_List.cfm?Sort=BRANCH_DES C','mainFrame')" name="pic8"
onMouseover="lightup('pic8')" onMouseout="turnoff('pic8')"> </th>
<th width="100%" nowrap align="left"> *Click on the up / down arrows to
sort by any column</th>
</tr>
<tr>
<cfform name="Search_Lname_Form" action="Emp_list.cfm?Search_lname=Yes"
target="mainFrame"><td height="24" nowrap><input type="text"
name="Search_lname_Input" size="8"><img style="cursor:hand"
src="Images/SEARCH.gif" onClick="Search_Lname()"></td></cfform>
<cfform name="Search_Fname_Form" action="Emp_list.cfm?Search_Fname=Yes"
target="mainFrame"><td nowrap><input type="text" name="Search_FName_Input"
size="8"><img style="cursor:hand" src="Images/SEARCH.gif"
onClick="Search_Fname()"></td></cfform>
<cfform name="Search_EXT_Form" action="Emp_list.cfm?Search_EXT=Yes"
target="mainFrame"><td nowrap><input type="text" name="Search_EXT_Input"
size="1"><img style="cursor:hand" src="Images/SEARCH.gif"
onClick="Search_EXT()"></td></cfform>
<cfform name="Search_Branch_Form" action="Emp_list.cfm?Search_Branch=Yes"
target="mainFrame"><td nowrap><input type="text" name="Search_Branch_Input"
size="15"><img style="cursor:hand" src="Images/SEARCH.gif"
onClick="Search_Branch()"></td> </cfform>
</tr>
</table>
<script language="vbscript">
sub Search_Lname()
document.Search_Lname_Form.submit
end sub
</script>
<script language="vbscript">
sub Search_Fname()
document.Search_Fname_Form.submit
end sub
</script>
<script language="vbscript">
sub Search_EXT()
document.Search_EXT_Form.submit
end sub
</script>
<script language="vbscript">
sub Search_Branch()
document.Search_Branch_Form.submit
end sub
</script>
Captain Ru Guest
-
Captain Ru #5
Re: Am I wasting my time? I seek council.
leftmenu.cfm
<cfquery name = "emp_data" datasource = "#db#">
select *
from emptbl
order by lname
</cfquery>
<table <!--- width="50%" height="94" ---> border="1" cellpadding="0"
cellspacing="0">
<strong>
<cfset color_on="yes">
<cfoutput query="EMP_DATA">
<cfif color_on is "yes">
<tr bgcolor="ffffff">
<cfset color_on="No">
<cfelse>
<tr height="25">
<cfset color_on="yes">
</cfif>
<cfif #lname# is not "">
<td width="120" nowrap> <a href="data.cfm?EMPID=#ID#"
target="data.cfm"><b>#lname#</b></a></td>
<cfelse>
<td width="120" nowrap> </td>
</cfif>
<cfif #fname# is "">
<td width="110"nowrap> </td>
<cfelse>
<td width="110" nowrap> #fname#</td>
</cfif>
<cfif #ext# is "">
<td width="67" nowrap> </td>
<cfelse>
<td width="65" nowrap> #ext#</td>
</cfif>
<cfif #branch# is "">
<td width="67" nowrap> </td>
<cfelse>
<td nowrap width="100%"> #BRANCH#</td>
</cfif>
</tr>
</cfoutput> </strong>
</table>
Captain Ru Guest
-
Captain Ru #6
Re: Am I wasting my time? I seek council.
data.cfm
<cfparam name="Edit" default="No">
<cfparam name="EMPEdit" default="No">
<cfparam name="SaveEMP" default="No">
<cfparam name="DeleteEMP" default="No">
<cfparam name="login" default="No">
<cfparam name="logOut" default="No">
<cfparam name="session.loggedin" default="No">
<title>Employee Data</title>
<link rel="stylesheet" type="text/css" href="CSS/emp.css">
<!--- <cfif Logout is 'Yes'>
<cfset session.loggedin = 'No'>
</cfif>
<cfif login is 'Yes'>
<cfif #Login_ID_Input# is 'Cynthia' or #Login_ID_Input# is 'Ronz' and
Password_Input is 'empadmin'>
<cfset session.loggedin = 'Yes'>
<cfset EMPEdit = 'Yes'>
<cfelse>
Incorect username or password!
</cfif>
</cfif> --->
<!--- <cfif #DeleteEMP# is 'Yes'>
<cfquery name="Save_EMP_Data" datasource="EMP">
DELETE FROM EmpTbl
WHERE ID=#EMPID#
</cfquery>
<script language="javascript">
alert("Employee has been Deleted")
</script>
</cfif> --->
<!--- <cfif #SaveEmp# is 'yes'>
<cfquery name="Save_EMP_Data" datasource="EMP">
Update EmpTbl
Set fname='#fname_Input#',
lname='#lname_Input#',
<cfif isdefined("dept_Input")>dept='#dept_Input#',</cfif>
<cfif isdefined("branch_Input")>branch='#branch_Input#', </cfif>
<cfif isdefined("title_Input")>title='#title_Input#',</cfif>
<cfif isdefined("ext_Input")>ext='#ext_Input#',</cfif>
<cfif isdefined("phone_Input")>phone='#phone_Input#',</cfif>
<cfif isdefined("fax_Input")>fax='#fax_Input#',</cfif>
<cfif isdefined("cellnumb_Input")>cellnumb='#cellnumb_In put#',</cfif>
<cfif isdefined("dob_Input")>dob='#dob_Input#',</cfif>
<cfif isdefined("hiredate_Input")>hiredate='#hiredate_In put#',</cfif>
<cfif isdefined("officer_Input")>officer='#officer_Input #'</cfif>
WHERE ID=#EMPID#
</cfquery>
</cfif> --->
<cfif not isdefined("EMPID")>
<cfabort>
<cfelse>
<CFQUERY NAME="EMP_Data" DATASOURCE="EMP">
SELECT *
FROM EmpTbl
WHERE ID=#EMPID#
</CFQUERY>
<cfoutput query="EMP_Data">
<cfform action="EMP_Data.cfm?SaveEmp=Yes&EMPID=#ID#" name="EMPEdit_Form">
<table bordercolor="000000" bordercolorlight="000000"
bordercolordark="000000" border="1" cellpadding="0" cellspacing="0">
<TR>
<TD colspan="2" align="center"><img style="cursor:hand"
src="Images/employeepics/#empspicture#" height="133"
onClick="window.open('Images/employeepics/#empspicture#','_NEW','TOOLBAR=NO,WIDT
H=350,HEIGHT=400')"></TD>
</TR>
<TR bgcolor="ccffcc">
<TH nowrap align="left">First Name</TD>
<TD nowrap width="100%">
<cfif #session.loggedin# is 'yes'>
<cfinput type="text" name="fname_Input" value="#fname#">
<cfelse> #fname#
</cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left" nowrap>Last Name</TD><TD nowrap><cfif #session.loggedin#
is 'Yes'><cfinput type="text" name="lname_Input"
value="#lname#"><cfelse> #lname#</cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left">Department</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="dept_Input"
value="#dept#"><cfelse> #dept#</cfif></TD>
</TR>
<tr bgcolor="ccffcc">
<TH align="left">Branch</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="branch_Input"
value="#branch#"><cfelse> #branch#</cfif></TD>
</tr>
<TR bgcolor="ccffcc" >
<TH align="left">Title</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="title_Input" value="#title#"><cfelse><cfif
#title# is ""> <cfelse> #title#</cfif></cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left">Ext</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="ext_Input" value="#ext#"><cfelse><cfif #ext#
is ""> <cfelse> #ext#</cfif></cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left">Phone</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="phone_Input" value="#phone#"><cfelse><cfif
#phone# is ""> <cfelse> #phone#</cfif></cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left">Fax</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="fax_Input" value="#fax#"><cfelse><cfif #fax#
is ""> <cfelse> #fax#</cfif></cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left">Cell</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="cellnumb_Input"
value="#cellnumb#"><cfelse><cfif #cellnumb# is
""> <cfelse> #cellnumb#</cfif></cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left">Birthday</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="dob_Input" value="#dob#"><cfelse><cfif #dob#
is ""> <cfelse> #dob#</cfif></cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left">Hire Date</TD><TD nowrap><cfif #session.loggedin# is
'Yes'><cfinput type="text" name="hiredate_Input"
value="#hiredate#"><cfelse><cfif #hiredate# is
""> <cfelse> #hiredate#</cfif></cfif></TD>
</TR>
<TR bgcolor="ccffcc">
<TH align="left"></TD>Officer?
<TD nowrap><cfif #session.loggedin# is 'Yes'><cfinput type="text"
name="officer_Input" value="#officer#"><cfelse><cfif #officer# is
0> No<cfelse> Yes</cfif></cfif></TD>
</TR>
<cfif #session.loggedin# is 'Yes'>
<tr>
<td colspan="2" align="center"><input type="submit" value="save"><input
type="button" value="Delete" onClick="DeleteEMP()"><input type="button"
name="logout" value="Logout"
onClick="window.open('EMP_Data.cfm?Logout=Yes&EMPI D=#ID#','rightFrame')"></td>
</tr>
</cfif>
</cfform>
<script language="javascript">
function DeleteEMP()
{
var where_to= confirm("Do you really want to go to this page??");
if (where_to== true)
{window.open('EMP_Data.cfm?DeleteEMP=Yes&EMPID=#ID #','rightFrame');
window.open('Emp_list.cfm','mainFrame');
}
else
{
}
}
</SCRIPT>
</cfoutput>
</cfif>
</table>
Captain Ru Guest
-
Captain Ru #7
Re: Am I wasting my time? I seek council.
these files are copied from another directory to be changed. the data.cfm file
has old code commented, and some parts not yet commented, like the session
variables used.
the top menu when searched should display in the left menu, and the left menu
should display to the right, but both produce popups. the search is also
calling a different file from the copy i'm using (the original)
Captain Ru Guest
-
jorgepino #8
Re: Am I wasting my time? I seek council.
updated search form
<cfform name="Search_Form" action="Emp_list.cfm">
<td height="24" nowrap><input type="text" name="Search_lname_Input"
size="8"><img style="cursor:hand" src="Images/SEARCH.gif"
onClick="Search_Lname()"></td>
<td nowrap><input type="text" name="Search_FName_Input" size="8"><img
style="cursor:hand" src="Images/SEARCH.gif" onClick="Search_Fname()"></td>
<td nowrap><input type="text" name="Search_EXT_Input" size="1"><img
style="cursor:hand" src="Images/SEARCH.gif" onClick="Search_EXT()"></td>
<td nowrap><input type="text" name="Search_Branch_Input" size="15"><img
style="cursor:hand" src="Images/SEARCH.gif" onClick="Search_Branch()"></td>
</cfform>
<cfquery name = "emp_data" datasource = "#db#">
select *
from emptbl
where 1=1
<cfif ParameterExists(form.Search_lname_Input)> lname like
'%form.Search_lname_Input%'<c/fif>
// do the same for all inputfields
order by lname
</cfquery>
jorgepino Guest
-
Captain Ru #9
Re: Am I wasting my time? I seek council.
well i swapped out my table and put that code in (it's missing a </cfif>) and
it didn't do anything. I noticed an ''error on page''. The search is fine.
the question is
can I have my topmenu.cfm display into my leftmenu.cfm
(can the included files act as frames)
Captain Ru Guest



Reply With Quote

