Hi masino_sinaga /include/staff/ticket.inc.php I have just worked it out and thought I would share...
<table width="100%" border="0" cellspacing=0 cellpadding=2 class="dtable" align="center">
<tr>
<?if($canDelete || $canClose) {?>
<th width="8px"> </th>
<?}?>
<th width="70" >
<a href="tickets.php?sort=ID&order=<?=$negorder?><?=$qstr?>" title="Sort By Ticket ID <?=$negorder?>">Ticket</a></th>
<th width="70">
<a href="tickets.php?sort=date&order=<?=$negorder?><?=$qstr?>" title="Sort By Date <?=$negorder?>">Date</a></th>
<th width="140">
<a href="tickets.php?sort=location&order=<?=$negorder?><?=$qstr?>" title="Sort By Location <?=$negorder?>">Location</a></th>
<th width="150">Equipment</th>
<th width="200">Reported fault</th>
<th width="80">
<a href="tickets.php?sort=dept&order=<?=$negorder?><?=$qstr?>" title="Sort By Category <?=$negorder?>">Department</a></th>
<th width="50">
<a href="tickets.php?sort=pri&order=<?=$negorder?><?=$qstr?>" title="Sort By Priority <?=$negorder?>">Priority</a></th>
</tr>
<?
$class = "row1";
$total=0;
if($tickets_res && ($num=db_num_rows($tickets_res))):
while ($row = db_fetch_array($tickets_res)) {
$tag=$row?'assigned':'openticket';
$flag=null;
if($row)
$flag='locked';
elseif($row)
$flag='assigned';
elseif($row)
$flag='overdue';
$tid=$row;
$subject = Format:($row,40);
if(!strcasecmp($row,'open') && !$row && !$row) {
$tid=sprintf('<b>%s</b>',$tid);
//$subject=sprintf('<b>%s</b>',Format:($row,40)); // Making the subject bold is too much for the eye
}
?>
<tr class="<?=$class?> " id="<?=$row?>">
<?if($canDelete || $canClose) {?>
<td align="center" class="nohover">
<input type="checkbox" name="tids" value="<?=$row?>" onClick="highLight(this.value,this.checked);">
</td>
<?}?>
<td align="center" title="<?=$row?>" nowrap>
<a class="Icon <?=strtolower($row)?>Ticket" title="<?=$row?> Ticket: <?=$row?>"
href="tickets.php?id=<?=$row?>"><?=$tid?></a></td>
<td align="center" nowrap><?=Format:($row)?></td>
<td nowrap><?=Format:($row,20)?></td>
<td><a <?if($flag) { ?> class="Icon <?=$flag?>Ticket" title="<?=ucfirst($flag)?> Ticket" <?}?>
href="tickets.php?id=<?=$row?>"><?=Format:($subject,20)?></a>
<?=$row?"<span class='Icon file'> </span>":''?></td>
MOD to show message
<?
$ticket_id=$row;
$sql_message = mysql_query("SELECT UNIX_TIMESTAMP(created) FROM ost_ticket_message WHERE ticket_id=$ticket_id ORDER BY created ASC LIMIT 1");
$message_created_row = mysql_fetch_array($sql_message);
$message_created = $message_created_row;
$title = mysql_query("SELECT message FROM ost_ticket_message WHERE ticket_id=$ticket_id AND created=FROM_UNIXTIME($message_created) LIMIT 1");
$lookup = message;
while ($TITLE = mysql_fetch_assoc($title)) {
$MESSAGE=$TITLE;
}
$MESSAGE = str_replace("'","`",$MESSAGE);
$MESSAGE = preg_replace("/[^A-Za-z0-9/", ' ', $MESSAGE);
$MESSAGE = str_replace("\r\n","<br/>",$MESSAGE);
$MESSAGE = str_replace("", "", $MESSAGE);
$MESSAGE = substr($MESSAGE,0,300);
?>
<td><?=Format:($MESSAGE,30)?></td>
<td nowrap><?=Format:($row,30)?></td>
<td class="nohover" align="center" style="background-color:<?=$row?>;"><?=$row?></td>
<?
$class = ($class =='row2') ?'row1':'row2';
} //end of while.
else: //not tickets found!! ?>
<tr class="<?=$class?>"><td colspan=8><b>Query returned 0 results.</b></td></tr>
<?
endif; ?>
</table>