================
myopensrs.cfm
================
<!--- headers --->
<cfoutput><a href="trackertabs.cfm?user_name=#url.user_name#&tab=2"></cfoutput>
<img src="http://127.0.0.1:8500/TicketTracking/pics/imagesCA6WFWX0.jpg" width=50 height=50 alt="go back to service tab" border="0" /></a>
<!--- Query the database for all open service requests (per user log in) --->
<cfquery name="Getmyrequests" datasource="sspsrs">
SELECT *
FROM Issues
WHERE status = 'active' and user_name = <cfqueryparam value="#url.user_name#" cfsqltype="cf_sql_varchar">
order by ticket_num
</cfquery>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>My Open Service Requests</title>
</head>
<body>
<font size=6><i><CENTER>My Open Service Requests</center></i></font>
<table border='0' width="100%" align='center' summary='script output'>
<tr bgcolor="#99ccff">
<th bgcolor="#99ccff"><font size=2><b>Service<br> Request #</b></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Request</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Network</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Classification<br>of Request</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Assigned<br> To</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Customer<br>Last Name</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Customer<br>First Name</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Opened<br> Date</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Closed<br>Date Date</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Status</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Priority</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Description</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Comments</strong></font></th>
<th bgcolor="#99ccff"><font size=2></strong>Update<br> Service<br> Request</strong></font></th>
</tr>
<!--- Output a table containing each service requests. Create dynamic
links to edit and delete the service. Pass the ID
associated with each record in the URL of the link --->
<cfoutput query="Getmyrequests">
<tr bgcolor="###iif(currentrow MOD 2,DE('ffffff'),DE('cccccc'))#">
<td><font size=2>#Ticket_num#</font></td>
<td><font size=2>#Title#</font></td>
<td><font size=2>#Network#</font></td>
<td><font size=2>#Classification_of_Request#</font></td>
<td><font size=2>#Full_name#</font></td>
<td><font size=2>#Last_Name#</font></td>
<td><font size=2>#First_Name#</font></td>
<td><font size=2>#DateFormat(Opened_Date,'mm/dd/yyyy')#</font></td>
<td><font size=2>#DateFormat(Closed_Date,'mm/dd/yyyy')#</font></td>
<td><font size=2>#Status#</font></td>
<td><font size=2>#Priority#</font></td>
<td><font size=2>#Description#</font></td>
<td><font size=2>#Comments#</font></td>
<td><a href="http://127.0.0.1:8500/TicketTracking/update_sr.cfm?user_name=#url.user_name#&ticket_num=#ticket_num#">Update</a></td>
</tr>
</cfoutput>
</table>
</body>
</html>
==================
update_action.cfm
==================
<cfquery name="changeun" datasource="sspsrs">
SELECT user_name
FROM tblAdmins where Full_name = <cfqueryparam value="#form.full_name#" cfsqltype="cf_sql_varchar">
</cfquery>
<cfoutput><a href="myopensrs.cfm?user_name=#url.user_name#"></cfoutput>
<img src="http://127.0.0.1:8500/TicketTracking/pics/returnwc.jpg" width=60 height=60 alt="go back to service tab" border="0" /></a>
<br>
<br>
<body bgcolor="#99ccff">
<cfif #form.status# is 'Resolved' and #form.closed_date# is "">
<script>
alert("Please choose a closed date before closing this service request.");
self.location="http://127.0.0.1:8500/TicketTracking/update_sr.cfm?<cfoutput>user_name=#url.user_name#&ticket_num=#ticket_num#</cfoutput>";
</script>
<!--- =========== having problems with this <cfelseif> here
=================--->
<cfelseif #form.status# = 'Active'>
<script>
alert("Please change the status to "resolve" before closing this service request.");
self.location="http://127.0.0.1:8500/TicketTracking/update_sr.cfm?<cfoutput>user_name=#url.user_name#&ticket_num=#ticket_num#</cfoutput>";
</script>
<cfelse>
<!--- Update the record, and write the new data to the database --->
<cfquery datasource="sspsrs">
UPDATE Issues
SET
title= <cfqueryparam value="#Form.title#" cfsqltype="cf_sql_varchar">,
network= <cfqueryparam value="#Form.Network#" cfsqltype="cf_sql_varchar">,
Classification_of_Request= <cfqueryparam value="#Form.Classification_of_Request#" cfsqltype="cf_sql_varchar">,
full_name= <cfqueryparam value="#Form.full_name#" cfsqltype="cf_sql_varchar"> ,
user_name= <cfqueryparam value="#changeun.user_name#">,
Last_Name= <cfqueryparam value="#Form.Last_Name#" cfsqltype="cf_sql_varchar">,
First_Name= <cfqueryparam value="#Form.First_Name#" cfsqltype="cf_sql_varchar">,
Opened_Date= <cfqueryparam value="#DateFormat(Form.Opened_Date, 'mm/dd/yyyy')#" cfsqltype="cf_sql_date">,
closed_date= <cfqueryparam value="#DateFormat(Form.closed_date, 'mm/dd/yyyy')#" cfsqltype="cf_sql_date">,
status= <cfqueryparam value="#Form.status#" cfsqltype="cf_sql_varchar">,
priority= <cfqueryparam value="#Form.priority#" cfsqltype="cf_sql_varchar">,
description= <cfqueryparam value="#Form.description#" cfsqltype="cf_sql_varchar">,
comments= <cfqueryparam value="#Form.comments#" cfsqltype="cf_sql_varchar">
WHERE ticket_num = <cfqueryparam value="#url.ticket_num#" cfsqltype="cf_sql_integer">
</cfquery>
</cfif>
<!--- display the tip that was entered into the database--->
<font size = 4 font color="#ffffff"><b>The following Service Request was updated:</b></font> <br /> <br /> <br />
<cfoutput>
<b>Service Request:</b> - #url.ticket_num# <br /><br />
<b>Title:</b> - #Title# <br /><br />
<b>Network:</b> - #Network# <br /><br />
<b>Classification of Request:</b> - #Classification_of_Request# <br /><br />
<b>Assigned To:</b> - #full_name# <br /><br />
<!---<b>User Name:</b> - #user_name# <br /><br />--->
<b>Last Name:</b> - #Last_name# <br /><br />
<b>First Name:</b> - #First_name# <br /><br />
<b>Opened Date:</b> - #Opened_Date# <br /><br />
<b>Closed Date:</b> - #Closed_Date# <br /><br />
<b>Status:</b> - #status# <br /><br />
<b>Priority:</b> - #priority# <br /><br />
<b>Description:</b> - #description# <br /><br />
<b>Comments:</b> - #comments# <br /><br />
</cfoutput>
<br /> <br />
</body>
ASKER
ASKER
ASKER
<!--- === THE FORM === --->
<cfparam name="show" default="0">
<form name="testForm" action="" method="post">
<input type="hidden" name="show" value="1">
<select name="status">
<option value="resolved"> RESOLVED </option>
<option value="Active"> ACTIVE </option>
<option value="NONE"> NONE </option>
</select>
<input type="hidden" name="closed_date" value="">
<input type="submit" name="submit" value="submit">
</form>
<!--- === ACTION === --->
<cfif show>
<cfdump var="#form#">
<cfif NOT compareNoCase('#form.status#','resolved') and form.closed_date EQ '' >
<cfoutput> RESOLVED </cfoutput>
<cfelseif NOT compareNoCase('#form.status#','Active')>
<cfoutput> ACTIVE </cfoutput>
<cfelse>
<cfoutput> NONE </cfoutput>
</cfif>
</cfif>
<cfif form.status is 'Resolved' and form.closed_date is "">
<script>
alert("Please choose a closed date before closing this service request.");
self.location="http://127.0.0.1:8500/TicketTracking/update_sr.cfm?<cfoutput>user_name=#url.user_name#&ticket_num=#ticket_num#</cfoutput>";
</script>
<cfelseif form.status is 'Active'>
<h1>Status is Active!</h1>
<script>
alert("Please change the status to 'resolve' before closing this service request.");
self.location="http://127.0.0.1:8500/TicketTracking/update_sr.cfm?<cfoutput>user_name=#url.user_name#&ticket_num=#ticket_num#</cfoutput>";
</script>
</cfif>
ASKER
[u]add new form[/u]
<tr>
<td><br>* Request Type:</b></br></td>
<td>select name="Title">
<option value="">---Select Option---</option>
<cfloop value="dropdownvalues.title_name#">#dropdownvalues.title_name#</option>
<cfloop>
</select></td>
</tr>
[u]insert new form[/u]
<cfif #form.title# eq "">
<script>
alert("You must select a Request Type!");
self.location="http://127.0.0.1:8500/TicketTracking/addnewsr.cfm?user_name=#url.user_name#;
</script>
<td>
<select name="Title">
<option value="">---Select Option---</option>
<cfloop value="dropdownvalues.title_name#">
<option>#dropdownvalues.title_name#</option>
<cfloop>
</select>
</td>
</tr>
ASKER
A web server refers to the software that helps to deliver web content that can be accessed either through the Internet or through an intranet. The primary function of a web server is to store, process and deliver web pages to clients. The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP). The most common use of web servers is to host websites, but there are other uses such as gaming, data storage, running enterprise applications, handling email, FTP, etc.
TRUSTED BY
Change to
<cfelseif #form.status# EQ 'Active'>