Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with Form

Status
Not open for further replies.

tsp1lrk

IS-IT--Management
Joined
May 30, 2001
Messages
103
Location
US
Hi,

Our support desk is requesting a status page that they can update to alert our user community of problems. I want to have a page where our support desk people can login, AND show the current status. (Update dynamically) So what I'm looking to do is have the login page show the current status. When they want to change the status, they login, go to the form, change the status, click modify, and it will re-direct back to the first login page and update it with those changes... I'm having a problem, here's my code thus far; this may even be wrong.

login page:
<cfparam name=&quot;technician&quot; default=&quot;&quot;>
<cfparam name=&quot;problem&quot; default=&quot;&quot;>
<cfparam name=&quot;resolution&quot; default=&quot;&quot;>
<cfparam name=&quot;comments&quot; default=&quot;&quot;>

<html>
<head>
<title>IS NJ Campus Status</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#ffffff&quot; text=&quot;#000000&quot;>
<CFFORM name=&quot;UserLogin&quot; method=&quot;post&quot; action=&quot;results.cfm&quot;>
<div align=&quot;center&quot;>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width=&quot;45%&quot; border=&quot;1&quot; bordercolor=&quot;#000000&quot;>
<tr>
<td width=&quot;26%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;><IMG height=75 src=&quot;../../images/CS_LOGO.jpg&quot; width=93></font></td>
<td width=&quot;74%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>Welcome
to the Campus Support Status page.<br>
This page will be maintained daily by our Support Desk to update any Network
related problems affecting the IS user community.</font></td>
<CFQUERY datasource=&quot;my data source&quot; NAME=&quot;showStatus&quot;>
SELECT *
FROM tblstatus2
</CFQUERY>

</tr>
<tr valign=&quot;bottom&quot;> <cfoutput>
<td colspan=&quot;2&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>
<br>
Technician Reporting: #Technician#

<br>
Time: #CreateODBCDate(dateformat(Now(),&quot;dd-mmm-yyyy&quot;))#
<br>
Problem:#problem#

<br>
Resolution: #resolution#
<br>
<br>
<br>
<br>
<br></cfoutput>
<font color=&quot;#990000&quot;><i>For Campus Support Personnel Only:</i></font><br>
<br>
</font>
<DIV align=center>
<table width=&quot;101%&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; align=center>
<tr>
<td width=&quot;45%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>Login:</font></td>
<td width=&quot;55%&quot;>

<CFINPUT type=&quot;Text&quot; name=&quot;UserName&quot; required=&quot;Yes&quot; message=&quot;A User Name is required!&quot;>

</td>
</tr>
<tr>
<td width=&quot;45%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>Password:</font></td>
<td valign=&quot;bottom&quot; width=&quot;55%&quot;>
<CFINPUT type=&quot;Password&quot; name=&quot;Password&quot; required=&quot;Yes&quot; message=&quot;A Password is Required!&quot;>
</td>
</tr>
</table></DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT type=submit value=&quot;Login&quot;>&nbsp;<INPUT type=reset value=Reset>
</td>
</tr>
</table></CFFORM>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</body>
</html>


Results Page:
<CFSET Session.LoggedIn = FALSE>
<cfparam name=&quot;Form.UserName&quot; default=&quot;&quot;>
<cfparam name=&quot;Form.password&quot; default=&quot;&quot;>
<CFQUERY NAME=&quot;GetUser&quot; DATASOURCE=&quot;my data source&quot;>
SELECT *
FROM tblstatus
WHERE UserName = '#Form.UserName#'
</CFQUERY>

<CFIF GETUSER.RECORDCOUNT GREATER THAN 0 and #form.password# IS '#getuser.password#'>
<CFSET Session.LoggedIn = TRUE>
<CFSET Session.UserName = GetUser.Username>
<cfcookie name=&quot;UserName&quot; value=&quot;#GetUser.UserName#&quot;>

<cflocation url=&quot;insertform.cfm&quot; addtoken=&quot;No&quot;>
<CFELSEIF #form.password# is not &quot;#getuser.password#&quot;>
<html>
<body>
<font face=&quot;Verdana&quot;><b><font size=&quot;-1&quot;><div align=&quot;center&quot;>Sorry! You either mistyped the password;<br>
or you are trying to bypass the login screen. Please try again!</div></font></b></font>
<cfinclude template=&quot;status_Login.cfm&quot;>
</body></html>
</cfif>


Insert Form Page: (Page where they would enter the status)

<CFQUERY datasource=&quot;my data source&quot; NAME=&quot;writeStatus&quot;>
SELECT *
FROM tblstatus2
</CFQUERY>

<TR>
<TD WIDTH=100 ALIGN=&quot;center&quot; VALIGN=&quot;TOP&quot; HEIGHT=&quot;150&quot;>&nbsp;</TD>

<TD VALIGN=&quot;TOP&quot;>

<FORM ACTION=&quot;insertaction.cfm&quot; METHOD=&quot;POST&quot;>

<FONT FACE=&quot;Helvetica&quot; SIZE=&quot;-1&quot;>

<P>Technician<BR>
<INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Technician&quot;></P>

<P>Problem<BR>
<INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Problem&quot;></P>

<P>Resolution<BR>
<INPUT TYPE=&quot;TEXT&quot; NAME=&quot;resolution&quot;></P>

<cfoutput><P>Date<BR>
<INPUT TYPE=&quot;TEXT&quot; name=&quot;date&quot; value=&quot;#CreateODBCDate(dateformat(Now(),&quot;dd-mmm-yyyy&quot;))#&quot;></P></cfoutput>

<P>Comments<BR>
<TEXTAREA NAME=&quot;comments&quot; COLS=&quot;25&quot; ROWS=&quot;5&quot;></TEXTAREA>

<P><INPUT TYPE=&quot;SUBMIT&quot; VALUE=&quot;Upload Status&quot;></P>

</FONT>

</FORM>

</TD>

<TD WIDTH=100 ALIGN=&quot;RIGHT&quot; VALIGN=&quot;TOP&quot; HEIGHT=&quot;150&quot;>&nbsp;</TD>

</TR>

<TR>
<TD HEIGHT=&quot;35&quot; COLSPAN=&quot;3&quot;>&nbsp;</TD>
</TR>

</TABLE>

Insert Action Page: (input the changes into a database and return to the login page showing the update)

<!--- This INSERT statement does the actual adding
of the data to the database; notice that the
SQL statement contains Cold Fusion #variables# --->
<CFQUERY datasource=&quot;my data source&quot; NAME=&quot;AddStatus&quot;>
INSERT INTO tblstatus2 (
technician,
Problem,
resolution,
comments)
VALUES (
'#Form.technician#',
'#Form.problem#',
'#Form.resolution#',
'#Form.comments#')
</CFQUERY>

<CFLOCATION URL=&quot;status_login.cfm&quot;>

any direction is appreciated; so in a nutshell, I just want to have our techs login to a page, update a status and return to the same login page so everyone can see the current status.

Help!,
Thanks,
Lisa... UPS
 
Your were close. Just need to add the query name to the output statement and it appears that one of the queries is not necessary.


login page:
<cfparam name=&quot;technician&quot; default=&quot;&quot;>
<cfparam name=&quot;problem&quot; default=&quot;&quot;>
<cfparam name=&quot;resolution&quot; default=&quot;&quot;>
<cfparam name=&quot;comments&quot; default=&quot;&quot;>

<html>
<head>
<title>IS NJ Campus Status</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#ffffff&quot; text=&quot;#000000&quot;>
<CFFORM name=&quot;UserLogin&quot; method=&quot;post&quot; action=&quot;results.cfm&quot;>
<div align=&quot;center&quot;>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<table width=&quot;45%&quot; border=&quot;1&quot; bordercolor=&quot;#000000&quot;>
<tr>
<td width=&quot;26%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;><IMG height=75 src=&quot;../../images/CS_LOGO.jpg&quot; width=93></font></td>
<td width=&quot;74%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>Welcome
to the Campus Support Status page.<br>
This page will be maintained daily by our Support Desk to update any Network
related problems affecting the IS user community.</font></td>
<CFQUERY datasource=&quot;my data source&quot; NAME=&quot;showStatus&quot;>
SELECT *
FROM tblstatus2
</CFQUERY>

</tr>
<tr valign=&quot;bottom&quot;> <cfoutput query=&quot;showstatus&quot; >
<td colspan=&quot;2&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>
<br>
Technician Reporting: #Technician#

<br>
Time: #CreateODBCDate(dateformat(Now(),&quot;dd-mmm-yyyy&quot;))#
<br>
Problem:#problem#

<br>
Resolution: #resolution#
<br>
<br>
<br>
<br>
<br></cfoutput>
<font color=&quot;#990000&quot;><i>For Campus Support Personnel Only:</i></font><br>
<br>
</font>
<DIV align=center>
<table width=&quot;101%&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; align=center>
<tr>
<td width=&quot;45%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>Login:</font></td>
<td width=&quot;55%&quot;>

<CFINPUT type=&quot;Text&quot; name=&quot;UserName&quot; required=&quot;Yes&quot; message=&quot;A User Name is required!&quot;>

</td>
</tr>
<tr>
<td width=&quot;45%&quot;><font size=&quot;2&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>Password:</font></td>
<td valign=&quot;bottom&quot; width=&quot;55%&quot;>
<CFINPUT type=&quot;Password&quot; name=&quot;Password&quot; required=&quot;Yes&quot; message=&quot;A Password is Required!&quot;>
</td>
</tr>
</table></DIV>
<INPUT type=submit value=&quot;Login&quot;> <INPUT type=reset value=Reset>
</td>
</tr>
</table></CFFORM>
<p> </p>
<p> </p>
</div>
</body>
</html>


Results Page:
<CFSET Session.LoggedIn = FALSE>
<cfparam name=&quot;Form.UserName&quot; default=&quot;&quot;>
<cfparam name=&quot;Form.password&quot; default=&quot;&quot;>
<CFQUERY NAME=&quot;GetUser&quot; DATASOURCE=&quot;my data source&quot;>
SELECT *
FROM tblstatus
WHERE UserName = '#Form.UserName#'
</CFQUERY>

<CFIF GETUSER.RECORDCOUNT GREATER THAN 0 and #form.password# IS '#getuser.password#'>
<CFSET Session.LoggedIn = TRUE>
<CFSET Session.UserName = GetUser.Username>
<cfcookie name=&quot;UserName&quot; value=&quot;#GetUser.UserName#&quot;>

<cflocation url=&quot;insertform.cfm&quot; addtoken=&quot;No&quot;>
<CFELSEIF #form.password# is not &quot;#getuser.password#&quot;>
<html>
<body>
<font face=&quot;Verdana&quot;><b><font size=&quot;-1&quot;><div align=&quot;center&quot;>Sorry! You either mistyped the password;<br>
or you are trying to bypass the login screen. Please try again!</div></font></b></font>
<cfinclude template=&quot;status_Login.cfm&quot;>
</body></html>
</cfif>


Insert Form Page: (Page where they would enter the status)
this query not needed
<CFQUERY datasource=&quot;my data source&quot; NAME=&quot;writeStatus&quot;>
SELECT *
FROM tblstatus2
</CFQUERY>

<TR>
<TD WIDTH=100 ALIGN=&quot;center&quot; VALIGN=&quot;TOP&quot; HEIGHT=&quot;150&quot;> </TD>

<TD VALIGN=&quot;TOP&quot;>

<FORM ACTION=&quot;insertaction.cfm&quot; METHOD=&quot;POST&quot;>

<FONT FACE=&quot;Helvetica&quot; SIZE=&quot;-1&quot;>

<P>Technician<BR>
<INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Technician&quot;></P>

<P>Problem<BR>
<INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Problem&quot;></P>

<P>Resolution<BR>
<INPUT TYPE=&quot;TEXT&quot; NAME=&quot;resolution&quot;></P>

<cfoutput><P>Date<BR>
<INPUT TYPE=&quot;TEXT&quot; name=&quot;date&quot; value=&quot;#CreateODBCDate(dateformat(Now(),&quot;dd-mmm-yyyy&quot;))#&quot;></P></cfoutput>

<P>Comments<BR>
<TEXTAREA NAME=&quot;comments&quot; COLS=&quot;25&quot; ROWS=&quot;5&quot;></TEXTAREA>

<P><INPUT TYPE=&quot;SUBMIT&quot; VALUE=&quot;Upload Status&quot;></P>

</FONT>

</FORM>

</TD>

<TD WIDTH=100 ALIGN=&quot;RIGHT&quot; VALIGN=&quot;TOP&quot; HEIGHT=&quot;150&quot;> </TD>

</TR>

<TR>
<TD HEIGHT=&quot;35&quot; COLSPAN=&quot;3&quot;> </TD>
</TR>

</TABLE>

Insert Action Page: (input the changes into a database and return to the login page showing the update)

<!--- This INSERT statement does the actual adding
of the data to the database; notice that the
SQL statement contains Cold Fusion #variables# --->
<CFQUERY datasource=&quot;my data source&quot; NAME=&quot;AddStatus&quot;>
INSERT INTO tblstatus2 (
technician,
Problem,
resolution,
comments)
VALUES (
'#Form.technician#',
'#Form.problem#',
'#Form.resolution#',
'#Form.comments#')
</CFQUERY>

<CFLOCATION URL=&quot;status_login.cfm&quot;>
The only dumb questions are the ones that are never asked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top