我正在开发一个新的票务系统,但出了点问题。当用户没有打开的工单时,它应该显示以下消息:
<?}else{?>
<tr>
<td style="background:#f7f7f7;">There are no tickets submitted yet.</td>
</tr>
<?}?>
我可能做错了什么,我不知道在哪里。这是我拥有的代码:
<?php
if($_GET['a'] == "del" && $_GET['id'] != ""){
mysql_query("DELETE FROM message WHERE id='{$_GET['id']}' LIMIT 1;");
}
$msg = mysql_query("SELECT * FROM `message` WHERE `receiver`='{$_SESSION['login']}' ORDER BY date DESC")or die (mysql_error());
?>
<table id="nested" width="97%" cellspacing=0 cellpadding=0 style="border-collapse:collapse;">
<tr><th width="50px">ID</th><th width="110px">Date</th><th width="165px">Title</th><th width="90px">Status</th><th align="right" width="60px">Actions</th></tr></div>
<tbody>
<?php
while($mesg = mysql_fetch_array($msg)) {
?>
<tr class="">
<th><?php echo $mesg['id']; ?> </th>
<td><?php echo $mesg['date']; ?> </td>
<td><?php echo $mesg['title']; ?> </td>
<td><?php
if($mesg['readed']) { echo "Read";
}else{ echo "Unread";
} ?> </td>
<th><ul class="action-buttons">
<li><a href="#myTickets?id=<?=$mesg['id']?>" class="action-button" title="Read"><span class="read"></span></a></li>
<li><a href="#myTickets?a=del&id=<?=$mesg['id']?>" class="action-button" title="Delete"><span class="delete"></span></a></li>
<li><a href="#myTickets?a=close&id=<?=$mesg['id']?>" class="action-button" title="Close"><span class="close"></span></a></li></ul>
<? } ?>
</th>
<?}else{?>
<tr>
<td style="background:#f7f7f7;">There are no tickets submitted yet.</td>
</tr>
<?}?>
</tr>
</tbody>
</table>
</table>
如果有人可以帮助我,我将不胜感激,谢谢!