{* <?php die('duotaopu');?> *}
{include file="common/header.php"}
<body class="body-main">

<ul id="admin_sub_title">
	<li class="unsub"><a href="?m=cache">缓存设置</a></li>
	<li class="sub"><a href="?m=delcache">清除缓存</a></li>
</ul>

<div id="admin_right_b">

  <table border="0" style="width:100%" align="center" cellpadding="3" cellspacing="1" class="table_b">

	<tr align='center'>
	  <td class="title_bg">缓存说明</td>
      <td class="title_bg" width="120">缓存大小</td>
      <td width="100" class="title_bg">操作</td>
    </tr>

	<tr class="tdbg">
		<td style="padding-left:20px">模板编译缓存 (<span>修改模板后，需要清除模板缓存才能生效</span>)</td>
		<td align='center'><font color='green'>{$compile_cache} MB</font></td>
		<td align='center' id="compile"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('compile');">清除缓存</button></div></td>
	</tr>

	<tr class="tdbg">
		<td style="padding-left:20px">首页缓存</td>
		<td align='center'><font color='green'>{$index_cache} MB</font></td>
		<td align='center' id="index"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('index');">清除缓存</button></div></td>
	</tr>

	<tr class="tdbg">
		<td style="padding-left:20px">列表页缓存</td>
		<td align='center'><a id="c_list" onclick="checkcache('list');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="list"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('list');">清除缓存</button></div></td>
	</tr>

	<tr class="tdbg">
		<td style="padding-left:20px">内容页缓存</td>
		<td align='center'><a id="c_view" onclick="checkcache('view');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="view"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('view');">清除缓存</button></div></td>
	</tr>

	<tr class="tdbg">
		<td style="padding-left:20px">搜索引擎蜘蛛爬行记录 (<span>搜索引擎蜘蛛爬行的记录文件大小</span>)</td>
		<td align='center'><font color='green'>{$robot_cache} MB</font></td>
		<td align='center' id="robotlog"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('robotlog');">清除缓存</button></div></td>
	</tr>

  </table>
<script type="text/javascript">
function delcache(dir){
	$('#'+dir).html("<img src='public/images/load_blue.gif'>");
	$.ajax({
	   type: "POST",
	   url: "?m=delcache&a=do",
	   dataType: "json",
	   data: "action=del&file="+dir+"&t_="+Math.random(),
	   success: function(a){
		   if(a.status==1){
				$('#'+dir).html("<font color='green'>清除成功</font>");
		   }else{
				$('#'+dir).html("<font color='red'>"+a.info+"</font>");
		   }
	   }
	});
}
function checkcache(dir){
	$('#c_'+dir).html("<img src='public/images/load_blue.gif'>");
	$.ajax({
	   type: "POST",
	   url: "?m=delcache&a=do",
	   dataType: "json",
	   data: "action=checksize&file="+dir+"&t_="+Math.random(),
	   success: function(a){
		   if(a.status==1){
				$('#c_'+dir).html("<font color='green'>"+a.size+"</font>");
		   }else{
				$('#c_'+dir).html("<font color='red'>"+a.info+"</font>");
		   }
	   }
	});
}
</script>
<div class="runtime"></div>  
</div>
</body>
</html>