<!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=form}-->
<!--{include file=elements/header.js.html type=blockui}-->
</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>网站管理&nbsp;&gt;&nbsp;系统优化&nbsp;&gt;&nbsp;清理缓存
				</div>
			</div>
			<div class="tabcontent">
				<a href="index.php?r=Cache.cacheset&menu_id=14" class="link">缓存设置</a>
				<a href="index.php?r=Cache.clearCache&menu_id=14" class="nolink">清理缓存</a>
			</div>
			<div id="secrightContent">
				<div class="tableContent">
					<form action="index.php?r=Cache.clearCache"   method="post" id="setForm">
						
						<table class="tbl_edit" width="100%">
							<tr>
								<td class="td_name"><label><input type="checkbox" class="checkall"/>全部清理<label></label></td>
								<td class="td_content"></td>
							</tr>
							<tr>
								<td class="td_name"><input type="checkbox" class="checkid" name="data[WEB_CACHE_SIZE]" value="1"/>前台数据缓存</td>
								<td class="td_content"><!--{$WEB_CACHE_SIZE}--></td>
							</tr>
							
							<tr>
								<td class="td_name"><input type="checkbox" class="checkid" name="data[WEB_SMARTY_CACHE_SIZE]" value="3"/>前台模板缓存</td>
								<td class="td_content"><!--{$WEB_SMARTY_CACHE_SIZE}--></td>
							</tr>
							
							<tr>
								<td class="td_name"><input type="checkbox" class="checkid" name="data[ADMIN_SMARTY_CACHE_SIZE]" value="4"/>后台模板缓存</td>
								<td class="td_content"><!--{$ADMIN_SMARTY_CACHE_SIZE}--></td>
							</tr>
							
							<tr>
								<td class="noborder"></td>
								<td class="noborder"><button type="submit" class="butsubmit">清理</button></td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>

<script>

$(document).ready(function(){
	$("#setForm").submit(function(){
		var next = false;
		$(".checkid").each(function(){
			if($(this).attr("checked")){
				next = true;
			}
		});
		
		if(!next)
		{
			$.errorUI({
				message:"请选择要清除的目录！",
				showOverlay:true,
				autoHide:false,
				confirm:function(){}
			});
			return false;
		}
		
		$(this).ajaxSubmit({
			success:function(data){
				var o = eval("("+data+")");
				if(o.status==1){
					$.successUI({
						message:"清除成功！",
						showOverlay:true,
						confirm:function(){setTimeout($.unblockUI, 300);window.location.reload();}
					});
					
				}else{
					$.errorUI({
						message:"无法清除，请检查缓存目录权限！",
						showOverlay:true
					});
				}
				
			}
		});
		return false;
	});
	
	$(".checkall").click(function(){
		if($(this).attr("checked"))
		{
			$(".checkid").each(function(){
				$(this).attr("checked",true);
			});
		}else{
			$(".checkid").each(function(){
				$(this).attr("checked",false);
			});
		}
	});
	
});
</script>
</body>
</html>