<{include file="index/header.html"}>
<div class="nav"><span>微信菜单</span></div> 
<div class="explain">
	<div class="name"><span>操作提示</span></div>
	<div class="con">
		<p>一级菜单为3个，二级菜单最多为5个，请自行控制数量。</p>
		<p>浏览事件的地址为微信手机端访问的地址，请自行设置。</p>  
	</div> 
</div> 
<div class="filter">
	<a href="javascript:;" onClick="add_menu('菜单添加','?m=wchat&a=menu_edit')" class="add">菜单添加</a>
	<a href="javascript:;" onClick="syn_weixin('?m=wchat&a=menu_create_json')" class="button">同步到微信客服端</a>
</div>
<div class="main">  
	<table width="100%" class="ltable">
	  	<thead>
		  	<tr>
				<th width="150">名称</th>
				<th width="60">事件</td>
				<th width="120">点击事件</th>
				<th width="360">浏览事件</th>
				<th width="150">操作</th>
				<th width="120">添加时间</th>
				<th></th>
		  	</tr>
	  	</thead>
		<tbody>
	<{if $data}>
		<{foreach item=i from=$data}>
			<tr> 
				<td><{$i.name}></td>
				<td><{$i.event}></td>
				<td><{$i.click_key}></td>
				<td><{$i.view_url}></td> 
				<td>
					<a href="javascript:;" onClick="update_menu('修改微信','?m=wchat&a=menu_edit&cid=<{$i.cid}>');" class="edit">修改</a> 
					<a href="?m=wchat&a=menu_del&cid=<{$i.cid}>" class="del">删除</a>
				</td> 
				<td><{$i.addtime|date_format:'%Y-%m-%d %H:%M'}>'</td>
				<td></td>
			</tr>
			<{foreach item=p from=$i.pmenu}>
				<tr> 
					<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|-- <{$p.name}></td>
					<td><{$p.event}></td>
					<td><{$p.click_key}></td>
					<td><{$p.view_url}></td> 
					<td>
						<a href="javascript:;" onClick="update_menu('修改微信','?m=wchat&a=menu_edit&cid=<{$p.cid}>');" class="edit">修改</a> 
						<a href="?m=wchat&a=menu_del&cid=<{$p.cid}>" class="del">删除</a>
					</td> 
					<td><{$p.addtime|date_format:'%Y-%m-%d %H:%M'}>'</td>
					<td></td>
				</tr>
			<{/foreach}>
		<{/foreach}>
	<{else}>
	  	<tr><td colspan="6">还没有数据，赶快添加吧！</td></tr>
	<{/if}>
		</tbody> 
	</table> 
</div>
<{include file="index/footer.html"}>
<script type="text/javascript">
function add_menu(name,url){  
	parent.dialog(name, url, 500, 190); 
}
function update_menu(name,url){
	parent.dialog(name, url, 500, 190); 
}
function syn_weixin(url){
	parent.ajax_alert(url);
}
</script>