<!--{template 'head'}-->
<!--{if $action=='manage'}-->
<table cellpadding="2" cellspacing="1" border="0" align=center class="tableborder" width="100%">
	<tr>
		<td class="tablerow"><b>管理选项：</b><a href="{W_P}index.php?ac=guestbook" target="_blank">查看</a> | <a href="plugin.php?plugin=guestbook&action=manage">留言管理</a> | <a href="###" onclick="return qmeCms.dialogView.get('留言设置', 'plugin.php?plugin=guestbook&action=set', {width:400});">留言设置</a></td>
	</tr>
</table>
<table cellpadding="0" cellspacing="0" class="tableborder bg border">
	<tr align="center">
		<td width="40" class="tablerowhighlight"></td>
		<td width="64" class="tablerowhighlight">头像</td>
		<td class="tablerowhighlight">内容</td>
		<td width="220" class="tablerowhighlight">信息</td>
		<td width="120"  class="tablerowhighlight">时间</td>
		<td width="80"  class="tablerowhighlight">状态</td>
		<td width="100"  class="tablerowhighlight">管理操作</td>
	</tr>
	<!--{if $data}-->
	<!--{loop $data $item}-->
	<tr align="center" class="item" id="item-{$item['gid']}">
		<td><input type="checkbox" name="gid[]" id="ids_{$item[gid]}" value="{$item[gid]}" /></td>
		<td align="left" style="padding:0"><img src="{W_P}images/head/{$item['pic']}.gif" /></td>
		<td align="left" style="padding-left:10px;vertical-align:top;" valign="top">{$item[message]}</td>
		<td align="left" style="padding-left:10px;"> 
			QQ：{$item['qq']}<br />
			Mail：{$item['email']}<br />
			IP：<!--{echo long2ip($item[ip])}-->
		</td>
		<td><!--{echo qbase::formatTime('Y-n-d H:i', $item[dateline])}--></td>
		<td><!--{if $item['has_reply']}-->已回复<!--{else}-->待回复<!--{/if}--></td>
		<td><a href='###' onclick="return qmeCms.dialogView.get('回复', 'plugin.php?plugin=guestbook&action=reply&gid={$item[gid]}');">回复</a> | <a href='plugin.php?plugin=guestbook&action=delete&gid={$item[gid]}' onclick="return makeSure();">删除</a></td>
	</tr>
	<!--{/loop}-->
	<tr>
		<td colspan="7" class="tablerow">
			<!--{eval new Pager($total,$limit);}-->
		</td>
	</tr>
	<!--{else}-->
	<tr>
		<td colspan="7"><p style="padding:25px;text-align:center">还没有相关数据</p></td>
	</tr>
	<!--{/if}-->
</table>
<!--{elseif $action == 'reply'}-->
<form name="ajaxForm" id="ajaxForm" action="plugin.php?plugin=guestbook&action=reply&gid={$gid}" method="post">
	<p><textarea name="reply" id="replyText" style="width:470px;height:150px;" class="f-text">{$data['reply']}</textarea></p>
</form>
<script type="text/javascript" reload="1">
(function(){	
	qmeCms.dialogView.setSubmit(true, "提交", function(){
		if(!$('replyText').value.trim()){
			alert("需要输入回复内容");
			$('replyText').focus();
			return false;
		}
		qmeCms.dialogView.setSubmit(true, "提交....", function(){});
		Form.send('ajaxForm', function(resp){
			qmeCms.dialogView.setMessage(resp);
			qmeCms.dialogView.setSubmit(false, "", function(){});
		});
	});
})();
</script>
<!--{elseif $action == 'set'}-->
<form name="ajaxForm" id="ajaxForm" action="plugin.php?plugin=guestbook&action=set" method="post">
	<p class="padding"><label for="guestbook_open" class="f-label">开启留言本</label><input type="checkbox" value="1" id="guestbook_open" name="plugin_guestbook_open"<!--{if $_SET['plugin_guestbook_open']}--> checked<!--{/if}--> /></p>
	<p class="padding"><label for="guestbook_verify" class="f-label">留言启用验证码</label><input type="checkbox" value="1" id="guestbook_verify" name="plugin_guestbook_verify"<!--{if $_SET['plugin_guestbook_verify']}--> checked<!--{/if}--> /></p>
</form>
<script type="text/javascript" reload="1">
(function(){	
	qmeCms.dialogView.setSubmit(true, "提交", function(){
		qmeCms.dialogView.setSubmit(true, "提交....", function(){});
		Form.send('ajaxForm', function(resp){
			qmeCms.dialogView.setMessage(resp);
			qmeCms.dialogView.setSubmit(false, "", function(){});
		});
	});
})();
</script>
<!--{/if}-->

<!--{template 'foot'}-->
