NetworkGuy101
IS-IT--Management
I have setup a page to output info and let the user sort by a linked column name It doesnt seem to be working correctly though. Help is appreciated- Joe
<cfparam name="sort" default="1">
<cfquery name="Userview" datasource="IGNEW">
SELECT *
FROM Userinfo
ORDER BY
<cfswitch expression="#sort#">
<cfcase value="1">memberid</cfcase>
<cfcase value="2">badgenumber</cfcase>
<cfcase value="3">datetrained</cfcase>
<cfcase value="4">badgenumber </cfcase>
<cfcase value="5">DEROS</cfcase>
</cfswitch>
</cfquery>
<table width="974" border="0">
<tr>
<td><a href="eetuserview.cfm?sort=1">Member ID</a></td>
<td width="115"><font color="#0000FF" size="2">Last Name</font></td>
<td width="117"><font color="#0000FF" size="2">First Name</font></td>
<td><a href="eetuserview.cfm?sort=2">Badge Number</a></td>
<td width="89"><font color="#0000FF" size="2">Unit</font></td>
<td width="127"><font color="#0000FF" size="2">Duty Phone</font></td>
<td><a href="eetuserview.cfm?sort=3">DEROS</a></td>
<td><a href="eetuserview.cfm?sort=4">Date Trained</a></td>
<td width="253"><font color="#0000FF" size="2">EETUSER Name</font></td>
</tr>
<cfoutput query="Userview">
<tr bordercolor="##000000">
<td bordercolor="##000000"><font size="2">#Userview.memberid#</font></td>
<td bordercolor="##000000"><font size="2">#Userview.lastname#</font></td>
<td bordercolor="##000000"><font size="2">#Userview.firstname#</font></td>
<td><font size="2">#Userview.badgenumber#</font></td>
<td><font size="2">#Userview.unit#</font></td>
<td><font size="2">#Userview.dutyphone#</font></td>
<td><font size="2">#LSDateFormat(Userview.Deros,'M/DD/YYYY')#</font></td>
<td><font size="2">#Userview.Datetrained#</font></td>
<td><font size="2">#Userview.EETUSER#</font></td>
</tr>
</cfoutput>
</table>
<cfparam name="sort" default="1">
<cfquery name="Userview" datasource="IGNEW">
SELECT *
FROM Userinfo
ORDER BY
<cfswitch expression="#sort#">
<cfcase value="1">memberid</cfcase>
<cfcase value="2">badgenumber</cfcase>
<cfcase value="3">datetrained</cfcase>
<cfcase value="4">badgenumber </cfcase>
<cfcase value="5">DEROS</cfcase>
</cfswitch>
</cfquery>
<table width="974" border="0">
<tr>
<td><a href="eetuserview.cfm?sort=1">Member ID</a></td>
<td width="115"><font color="#0000FF" size="2">Last Name</font></td>
<td width="117"><font color="#0000FF" size="2">First Name</font></td>
<td><a href="eetuserview.cfm?sort=2">Badge Number</a></td>
<td width="89"><font color="#0000FF" size="2">Unit</font></td>
<td width="127"><font color="#0000FF" size="2">Duty Phone</font></td>
<td><a href="eetuserview.cfm?sort=3">DEROS</a></td>
<td><a href="eetuserview.cfm?sort=4">Date Trained</a></td>
<td width="253"><font color="#0000FF" size="2">EETUSER Name</font></td>
</tr>
<cfoutput query="Userview">
<tr bordercolor="##000000">
<td bordercolor="##000000"><font size="2">#Userview.memberid#</font></td>
<td bordercolor="##000000"><font size="2">#Userview.lastname#</font></td>
<td bordercolor="##000000"><font size="2">#Userview.firstname#</font></td>
<td><font size="2">#Userview.badgenumber#</font></td>
<td><font size="2">#Userview.unit#</font></td>
<td><font size="2">#Userview.dutyphone#</font></td>
<td><font size="2">#LSDateFormat(Userview.Deros,'M/DD/YYYY')#</font></td>
<td><font size="2">#Userview.Datetrained#</font></td>
<td><font size="2">#Userview.EETUSER#</font></td>
</tr>
</cfoutput>
</table>