<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--{include file=elements/header.css.html}-->
<!--{include file=elements/header.js.html type=common}-->
<!--{include file=elements/header.js.html type=popbox}-->
</head>
<body>
<div id="outside">
	<!--{include file=frame/top.html}-->
	<div id="mainareaContent">
		<!--{include file=frame/left.html}-->
		<div id="rightContent">
			<div id="topContent">
				<div class="sitmap">
					<span class="r"><!--{include file="elements/uuadvad.html"}--></span>VIP服务&nbsp;&gt;&nbsp;模块超市&nbsp;&gt;&nbsp;已安装模块
				</div>
			</div>
			<div class="tabcontent">
				<a href="index.php?r=Plugin.newplugin&menu_id=55" class="link">最新模块</a>
				<a href="index.php?r=Plugin.pluginlist&menu_id=55" class="nolink">已安装模块</a>
				<a href="index.php?r=Plugin.preview&menu_id=55" class="link">模块预告</a>
			</div>
			<div id="secrightContent">
				<div class="tableContent2">
					<div class="operation">
						<button type="button" class="but2font" onclick="batchOperate('index.php?r=Plugin.updatestatus&status=1&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '确定开启？')">开启</button>
						<button type="button" class="but2font" onclick="batchOperate('index.php?r=Plugin.updatestatus&status=2&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '确定关闭？')">关闭</button>
					</div>
					<table class="tbl_list" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr class="thead">
							<td width="5%"><input type="checkbox" class="checkall"/></td>
							<td width="15%">插件名称</td>
							<td width="20%">图片</td>
							<td width="10%">版本</td>
							<td width="20%">插件说明</td>
							<td width="10%">安装时间</td>
							<td width="10%">状态</td>
							<td width="10%">操作</td>
						</tr>
						<!--{foreach from=$datalist item=data}-->
						<tr onmouseover="chgTrColor(this)" onmouseout="chgTrColor(this)">
							<td><input type="checkbox" name="recordId" value="<!--{$data.id}-->"/></td>
							<td><!--{$data.plugin_name}--></td>
							<td><img src="../plugins/<!--{$data.plugin_code}-->/preview.jpg"/></td>
							<td><!--{$data.plugin_version}--></td>
							<td><!--{$data.description}--></td>
							<td><!--{$data.install_time}--></td>
							<td><!--{if $data.status == 1}-->已开启<!--{else}-->未开启<!--{/if}--></td>
							<td>
								<a href="javascript:updateplugin()">升级</a> <a href="index.php?r=<!--{$data.plugin_code}-->&plugin=<!--{$data.plugin_code}-->">统计</a>
							</td>
						</tr>
						<!--{foreachelse}-->
						<tr><td colspan="8">没有对应数据</td></tr>
						<!--{/foreach}-->
					</table>
					<div class="operation">
						<button type="button" class="but2font" onclick="batchOperate('index.php?r=Plugin.updatestatus&status=1&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '确定开启？')">开启</button>
						<button type="button" class="but2font" onclick="batchOperate('index.php?r=Plugin.updatestatus&status=2&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '确定关闭？')">关闭</button>
					</div>
					<div class="page"><!--{$pager}--></div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script>
function updateplugin(){
	popup("installPlugin", "升级插件");
	var str = "<table width=\"100%\"><tr><td height=\"50px\" align=\"center\"><img src=\"images/ajax.gif\"/>正在检测版本......</td></tr></table>";
	setpopupcontent(str);
	$.ajax({
		url: "index.php?r=Plugin.checkver",
		type: "get",
		cache: false,
		success: function(data){
			if (data == 1) {
				str = "<table width=\"100%\"><tr><td height=\"50px\" align=\"center\">该插件已经是最新版本</td></tr></table>";
				setTimeout("setpopupcontent('"+str+"')", 3000);
			} else {
				str = "<table width=\"100%\"><tr><td height=\"50px\" align=\"center\"><img src=\"images/ajax.gif\"/>开始更新......</td></tr></table>";
				setpopupcontent(str);
				$.ajax({
					url: "index.php?r=Plugin.install",
					type: "get",
					cache: false,
					success: function(data){
						if (data == 1) {
							str = "<table width=\"100%\"><tr><td height=\"50px\" align=\"center\">更新完成</td></tr></table>";
							setTimeout("setpopupcontent('"+str+"')", 7000);
						}
					}
				});
			}
		}
	});
}
</script>
</html>