<script language="javascript" src="<?=BASEURL?>public/admin/js/jquery.tablesorter.js"></script>
<script language="javascript">
$(
	function (){
		$(".adminlist").tablesorter({ headers: { 1: {sorter: false}, 6: {sorter: false}} });
	}
);
</script>
<table class="adminlist" cellpadding="0" cellspacing="0">
	<thead>
    	<tr width="5%"><th>#</th>
        <th width="5%"><input type="checkbox" name="toggle" id="toggle" value="all" /></th>
        <th width="5%">用户</th>
        <th width="15%">时间</th>
        <th width="10%">IP</th>
        <th width="52%">内容</th>
        <th width="8%">操作</th>
        </tr>
    </thead>
    <tbody>
    	<?php foreach($comments as $comment){ if(@!$a){ $a=1;}?>
        <tr>
        	<td><?=$a++?></td>
        	<td><input type="checkbox" name="select_id[]" value="<?=$comment->id?>" id="cb<?=$a?>"></td>
        	<td><?=($comment->user_name==''?"游客":$comment->user_name)?></td>
        	<td><?=date("Y-m-d H:i:s",$comment->dtime)?></td>
        	<td><?=$comment->ip?></td>
        	<td><?=$comment->msg?></td>
        	<td>
            	<a href="<?=BASEURI?>comment/edit/<?=$comment->id?>">回复</a>
            	<a href="<?=BASEURI?>comment/delete/<?=$comment->id?>" onclick="if(!confirm('确认是否删除')){return false;}">删除</a>
            </td>
        </tr>
        <?php }?>
    </tbody>
    <tfoot>
    	<tr>
        	<td colspan="7">
        	<input type="button" class="button" value="删除" onclick="select_control('<?=BASEURI?>comment/delete','确认是否删除')"/>
            </td>
        </tr>
        
    </tfoot>
</table>
