<?php
    include('header.html');
?>
<script type='text/javascript'>
function doAjax(url, param, callback, type) {
	function createAjax() {
		var xhr;
		if (window.XMLHttpRequest) {
			xhr = new XMLHttpRequest();
			if(xhr.overrideMimeType){
				xhr.overrideMimeType("text/html");
			}
		} else if (window.ActiveXObject) {
			try {
				xhr = new ActiveXObject("Xsxml2.XMLHTTP");
			} catch(e) {
				try {
					xhr = new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {}
			}
		}
		return xhr; //返回XMLHTTP对象实例
	}

	var dl_xhr = createAjax();
	dl_xhr.onreadystatechange = function(){
		if (dl_xhr.readyState == 4) {
			if (dl_xhr.status == 200) {
				var data = dl_xhr.responseText;
				if (callback && typeof callback == "function") {
					callback(data);
				}
				dl_xhr = null;
			}
		}
	};
	var pstr = "_t=" + new Date().getTime();
	for (var i = 0; i < param.length; i++) {
		var pitem = param[i];
		pstr += "&" + pitem.name + "=" + encodeURI(pitem.value);
	}
	dl_xhr.open("POST", url, type ? type : true);
	dl_xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
	dl_xhr.send(pstr);
}

function ID(id) {
    return document.getElementById(id);
}
function updateImg(){
	 ID('key_notice').innerHTML = '<img src="./themes/install/images/020.gif" />正在更新，请稍后.....';
	doAjax('install_test.php?action=updateImg', '', updateImg_callback, false) ;
}
function updateImg_callback(result)
{	
	if ( result == 1){
		window.location.href="install_test.php?action=three&type=agin";
	}

}
</script>
<div class="setup step3">
<h2>3.验证文件</h2>
</div>
<div class="stepstat">
<ul>
<li class="unactivated">1</li>
<li class="unactivated">2</li>
<li class="current">3</li>
<li class="unactivated last">4</li>
</ul>
<div class="stepstatbg stepstat3"></div>
</div>
</div> 
<form action="?mod=install&code=config&op=save" method="post">
<div class="main">
<h2 class="title">灯鹭插件关键文件验证</h2>
<table class="tb" style="margin:20px 0 20px 55px;">
<?php
foreach($back_v as $v=>$val){
?>
<tr> 
<td>网站根目录下是否存在<?php echo $v ?>.php文件</td>
<td class="<?php echo $val?w:nw ?> pdleft1" style="color:red">
<?php echo $val ?'':'请检查网站目录下，确定'.$v.'.php文件存在'?>
</td>
</tr>
<?php
}
?>
<tr> 
<td>网站根目录下是否存在ucenter目录</td>
<td class="<?php echo $dir_uc?w:nw ?> pdleft1" style="color:red">
<?php echo $dir_uc ?'':'请检查网站目录下，确定ucenter目录存在'?>
</td>
</tr>

<tr> 
<td>社会化平台素材图片验证</td>
<td class="<?php echo $tb?w:nw?> pdleft1" style="color:red">
<?php echo $tb ?'':'素材图片缺失，点击按钮更新<input type="button" onclick="javascript:updateImg()" value="更新"/>'?>
</td>
<td id="key_notice"></td>
</tr>
<tr> 
</table>

<h2 class="title">需要修改的文件</h2>
<table class="tb" style="margin:20px 0 20px 55px;">
<?php
foreach($modify_file as $v){
?>
<tr> 
<td><?php echo $v?></td>
<td class="w pdleft1">
准备修改
</td>
</tr>
<?php
}
?>
</table>

<div class="btnbox marginbot">
<input type="button" onclick="history.back();" value="上一步" />
<input type="button" value="下一步" onclick="javascript:window.location='?action=four';"/>
</div>
</div>
</form>
<?php
    include('footer.html');
?>