{:tpl head}
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>留言管理</caption>
  <tr>
   <td>
    <strong>管理选项：</strong>
    <a href="?file={:$file}&action=manage&passed=1">已审核留言管理</a>&nbsp;|&nbsp;<a href="?file={:$file}&action=manage&passed=0">未审核留言管理</a>
   </td>
  </tr>
</table>
<!--{:if $a == 'edit'}-->
<form action="?file={:$file}&action={:$a}" method="post" name="myform">
<table cellpadding="0" cellspacing="1" class="table_form">
 <caption>修改留言</caption>
 <input type="hidden" name="gid" value="{:$data['gid']}" />
 <input type="hidden" name="forward" value="{:$referer}" />
 <tr>
  <td width="20%" align="right"><span class="fred">*</span>&nbsp;标 题：</td>
  <td><input type="text" name="title" value="{:$data['title']}" size="60" require="true" datatype="require" msg="标题不能为空" /></td>
 </tr>
 <tr>
  <td align="right"><span class="fred">*</span>&nbsp;内 容：</td>
  <td>
   {:tag_editor('content', 'content', $data['content'], 'guestbook', 300, '600px')}
  </td>
 </tr>
 <tr>
  <td align="right">选项：</td>
  <td>
   <input name='passed' type="checkbox" value='1'{:tag_ischecked($data['passed'],1)} />通过审核&nbsp;
   <input name='saveremote' type="checkbox" value='1' />远程上传
  </td>
 </tr>
 <tr>
  <td colspan="2" height="30" class="align_c"><button type="submit" name="submit" value="submit">提交</button></td>
 </tr>
</table>
</form>
<script type="text/javascript" src="../../images/js/validator.js"></script>
<script language="javascript" type="text/javascript">
$(function(){
	$('form').checkForm(1);
})
</script>
<!--{:elseif $a == 'view'}-->
<form action="?file={:$file}&action={:$a}" method="post" name="myform">
<table cellpadding="0" cellspacing="1" class="table_form">
 <caption>查看留言</caption>
 <input type="hidden" name="gid" value="{:$data['gid']}" />
 <input type="hidden" name="forward" value="{:$referer}" />
 <tr>
  <td width="20%" align="right">标题：</td>
  <td>{:$data['title']}</td>
 </tr>
 <tr>
  <td align="right">内容：</td>
  <td>{:$data['content']}</td>
 </tr>
 <tr>
  <td align="right">回复：</td>
  <td>{:tag_editor('content', 'content', $data['reply'], 'guestbook', 300, '600px', 'normal', 'require="true" datatype="require" msg="回复不能为空"')}</td>
 </tr>
 <tr>
  <td align="right">选项：</td>
  <td><input name='saveremote' type="checkbox" value='1' />远程上传</td>
 </tr>
 <tr>
  <td colspan="2" height="30" class="align_c"><button type="submit" name="submit" value="submit">回 复</button></td>
 </tr>
</table>
</form>
<script type="text/javascript" src="../../images/js/validator.js"></script>
<script language="javascript" type="text/javascript">
$(function(){
	$('form').checkForm(1);
})
</script>
<!--{:elseif $a == 'manage'}-->
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>{:if $passed==1}已{:else}未{:/if}审核留言管理</caption>
 <form name="myform" action="?file={:$file}&action={:$a}" method="post">
 <input type="hidden" value='' name="selids" />
 <tr align=center>
  <th width="5%" class="align_c"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.ids)" /></th>
  <th width="15%" class="align_c">标题</th>
  <th width="8%" class="align_c">用户名</th>
  <th width="15%" class="align_c">发表时间</th>
  <th class="align_c">内容</th>
  <th width="4%" class="align_c">回复</th>
  <th width="15%" class="align_c">管理操作</th>
 </tr>
 {:loop $data $v}
 <tr>
  <td class="align_c"><input name="ids" type="checkbox" value="{:$v['gid']}" /></td>
  <td>{:$v['title']}</td>
  <td class="align_c">{:if $v['userid']}<a href="?file=member&action=view&userid={:$v[userid]}" class="fred">{:$v['username']}</a>{:else}{:$v['username']}{:/if}</td>
  <td class="align_c">{:tag_date($v['addtime'],2)}</td>
  <td>{:tag_cut($v['content'],80,1)}</td>
  <td class="align_c">{:if $v['reply']}<span class="fgreen">√</span>{:/if}</td>
  <td class="align_c"><a href="?file={:$file}&action=view&gid={:$v['gid']}">查看</a>&nbsp;|&nbsp;{:if $passed == 0}<a href="?file={:$file}&action=check&selids={:$v['gid']}" class="fred">审核</a>&nbsp;|&nbsp;{:/if}<a href="?file={:$file}&action=edit&gid={:$v['gid']}">修改</a>&nbsp;|&nbsp;<a href="?file={:$file}&action=del&selids={:$v['gid']}">删除</a></td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="7" class="align_c">
   <button name="select1" onclick="selAll(this.form.ids)" type="button">全选</button>
   <button name="select2" onclick="noSelAll(this.form.ids)" type="button">反选</button>
   {:if !$passed}<button name="submitsh" type="button" onClick="subform(this.form,this.form.ids,'?file={:$file}&action=check','')">批量审核</button>{:/if}
   <button name="submitsc" type="button" onClick="subform(this.form,this.form.ids,'?file={:$file}&action=del','确认删除吗？此操作不可恢复')">删除</button>
  </td>
 </tr>
 </form>
</table>
{:if $pages}<div class="pages">{:$pages}</div>{:/if}
<!--{:/if}-->
{:tpl foot}