<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>心挂Q 用户中心数据导入</title>
<link rel="stylesheet" href="{$tplroot}/admin/images/ucstyle.css" type="text/css" media="all" />
<script type="text/javascript">
	function $(id) {

		return document.getElementById(id);

	}



	function showmessage(message) {

		document.getElementById('notice').innerHTML += message + '<br />';

	}

</script>
<meta content="iZzx.Cc" name="Copyright" />
</head>
<div class="container">

	<div class="header">

		<h1>心挂Q数据导入系统</h1>

		<span>iQQol 简体中文 UTF8 版 20130728</span>	

	<?php
	global $r;
        if($r=='10'){
        
            $header='<div class="setup step1">

			<h2>Error！</h2>

			<p>您已经导入过了。</p>

			</div>';
}
		elseif(!isset($_POST['step']) and $r=='20')
		{
			$header='<div class="setup step1">

			<h2>打开您的UC用户中心</h2>

			<p>请按下图所示添加应用</p>

			</div>';
		}
		elseif($_POST['step']=='2' and $r=='20')
		{
			$header='<div class="setup step2">

			<h2>按找下方提示找到数据</h2>

			<p>找到数据就可以下一步喽！</p>
			
			</div>';

		}
		elseif($_POST['step']=='3' and $r=='20')
		{
			$header='<div class="setup step3">

			<h2>开始导入吧</h2>

			<p>将您所得到的配置信息填入下方文本框！</p>
			
			</div>';

		}
		elseif($_POST['step']=='4' and $r=='20')
		{
			$header='<div class="setup step4">

			<h2>导入成功</h2>

			<p>返回首页看看吧！</p>
			
			</div>';

		}
		echo $header;
		?>
<?php
if($r=='20'){
	echo '<div class="stepstat">

		<ul>

			<li class="current">打开UC用户中心</li>
			<li class="current">添加应用并获得配置信息</li>
			<li class="current">导入数据</li>
			
		</ul>

		

	</div>

</div>';}
else {
echo '	<div class="stepstat">

		<ul>

			<li class="current">NO</li>
			<li class="current">NO</li>
			<li class="current">NO</li>
			
		</ul>

		

	</div>

</div>
<br><br><div align=center>您已经完成了导入，重新导入请删除 data/uc_config.lock<br><br><a href="index.php">回到首页</a></div><br><br><br><br>
';
}
?>
<?php
if(!isset($_POST['step']) and $r=='20')
{
echo '<br><br><div align=center><img border="2" src="'.$tplroot.'/admin/images/uc_step1.png"><br><br>
<form  name="form1" method="post" action="admin.php?action=uc_config&nodb=1">
<input name="step" type="hidden" value="2">
<input type="submit" class="g-button g-button-red" name="Submit" value="下一步" /><br>
</form><br>
</div>';
}
elseif($_POST['step']=='2' and $r=='20'){
echo '<br><br><div align=center><img border="2" src="'.$tplroot.'/admin/images/uc_step2.png"><br><img border="2" src="'.$tplroot.'/admin/images/uc_step3.png"><br><img border="2" src="'.$tplroot.'/admin/images/uc_step4.png"><br><br>
<h1>--添加完成应用之后，一切都还没有结束 不要急！--</h1>
<br><br><h1>--下面我们要--</h1><br><br><img border="2" src="'.$tplroot.'/admin/images/uc_step5.png"><br><img border="2" src="'.$tplroot.'/admin/images/uc_step6.png"><br><br>
<form  name="form1" method="post" action="admin.php?action=uc_config&nodb=1">
<input name="step" type="hidden" value="3">
<input type="submit" class="g-button g-button-red" name="Submit" value="下一步" /><br>
</form><br>
</div>';
}
elseif($_POST['step']=='3' and $r=='20'){
	echo'<br><br><div align=center><img border="2" src="'.$tplroot.'/admin/images/uc_step6.png"><br><form  name="form1" method="post" action="admin.php?action=uc_config&nodb=1">
      <p> 
		<textarea name="txt" cols="150" rows="18"></textarea>
		<input name="step" type="hidden" value="4">
      </p>
	  <br>
      <p>
        <input type="submit" class="g-button g-button-red" name="Submit" value="保存" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="reset" class="g-button g-button-red" name="return" value="重置" />
      </p><br>
</form></div>';
}
elseif($_POST['step']=='4' and $_POST['txt']!='' and $r=='20')
{
    $php='<?php

';
	$fp=fopen("data/uc_config.php",'w');
	$fpa=fopen("data/uc_config.lock",'w+');
	fwrite($fp,stripslashes($php.$_POST['txt']));
	fwrite($fpa,'导入成功');
	fclose($fp);
	echo'<br><br><br><div align=center>已经成功啦！是不是有点快？';
	echo'<br><br>       <a href="index.php">回到首页</a></div>';
}
?>