Hi.
Im writing a very basic helpdesk system to help me track all calls logged in our office. Everything works find except for one thing. I would like the ability (if needed) to sort by each column if I need to. For example, Date order or Ticket Id order. If have seen this done by a hyperlink on each of the columns in the table. Is it possible with the code that I have enclosed? and could someone show me an example? Many thanks.
<%@LANGUAGE = "VBSCRIPT"%>
<%Option Explicit%>
<!--#include virtual="/helpdesk/conn.as
p"-->
<!--#include virtual="/helpdesk/god-use
r.asp"-->
<%
Dim rs, strSQL, rsTickets, strTickets, strTicketCus, strTicketForename, strTicketSurname, strTicketTitle, strTicketSubject, strTicketDetails
Set rsTickets = Server.CreateObject("ADODB
.Recordset
")
strTickets = "SELECT ticketID, ticketDate, ticketTime, ticketCus, ticketForename, ticketSurname, ticketTitle, ticketSubject, statusName, statusIcon FROM qTickets WHERE statusID = 1 OR statusID = 2 OR statusID = 4 OR statusID = 6 ORDER BY statusID, ticketID DESC"
rsTickets.open strTickets, conn
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>HelpDesk Administration</title>
<link rel="stylesheet" type="text/css" href="../styles.css" />
</head>
<body>
<div id="header"> <h2 align="left">
<div align="left"><img src="../img/cnllogo.jpg" width="165" height="49" /></h1>
</div>
</div>
<div id="content"> <a href="invoicelist.asp">Tic
kets to be invoiced</a> | <a href="helpdesk.asp">
Log call</a> | <a href="report.asp">Reports </a>
<%if rsTickets.eof = true then%>
<p>There are no open support tickets.</p>
<%else%>
<h2>Current tickets in job que </h2>
<table class="datatable">
<tr>
<th width="11%" align="center"><div align="center"><a href="ORDER BY statusID DESC"></a>Ticket ID </div></th>
<th width="15%">Date</th>
<th width="13%">Time</th>
<th width="18%">Surname</th>
<th width="34%">Subject</th>
<th width="9%"><div align="center">Status</div
></th>
</tr>
<%Dim i
i = 0
Do While Not rsTickets.eof%>
<tr class="<%if (i MOD 2) then%>colour-row<%end if%>">
<td align="center"><%=rsTicket
s("ticketI
D")%></td>
<td><%=rsTickets("ticketDa
te")%></td
>
<td><%=rsTickets("ticketTi
me")%></td
>
<td><%=rsTickets("ticketSu
rname")%><
/td>
<td><a href="editTicket.asp?ticke
tID=<%=rsT
ickets("ti
cketID")%>
"><%=rsTic
kets("tick
etSubject"
)%></td>
<td align="center"><img src="../img/<%=rsTickets("
statusIcon
")%>" height="10" width="10" alt="<%=rsTickets("statusN
ame")%>" title="<%=rsTickets("statu
sName")%>"
/></td>
</tr>
<%i = i + 1
rsTickets.MoveNext
loop%>
</table>
<%end if
rsTickets.close
Set rsTickets = nothing
conn.close
Set conn = nothing%>
</div></body>
</html>
Start Free Trial