<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html XMLns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>所有留言</title> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> <script type="text/javascript" src="lib/jquery.js"></script> </head> <body> <!--{if $smarty.session.username}--> Welcome:<!--{$smarty.session.username}--> <a href="logout.php">退出</a> <!--{else}--> <a href="login.php">登录</a> <a href="reg.php">注册</a> <!--{/if}--> <a href="add.php">发表留言</a> <!--{foreach from=$gblist item=item}--> <table id="t<!--{$item.id}-->" width="700" border="0" cellspacing="0" cellpadding="0" class="tb"> <tr> <td class="bg"><b>[<!--{$item.username}-->]</b> 发表于:<!--{$item.insert_time}--></td> </tr> <tr> <td><!--{$item.content}--> <br /> <!--{if $item.user_file}--> 附件:<a target="_blank" href="uploads/<!--{$item.user_file}-->"><!--{$item.user_file}--></a> <!--{/if}--> </td> </tr> <tr> <td align="right"><!--{if $item.user_id==$smarty.session.user_id}--><a href="add.php?id=<!--{$item.id}-->">修改</a> <a href="javascript:delItem(''<!--{$item.id}-->'')">删除</a><!--{/if}--></td> </tr> </table> <!--{/foreach}--> <!--{$pagePanel}--> <script> function delItem (id) { $.get(''delete.php?id=''+id,null,function (msg) { if (''1''==msg) { $(''#t''+id).remove(); } else { alert(msg); } }); } </script> </body> </html> |