<?php
define('IN_ECS', true);
require('../../includes/init.php');
$step = isset($_REQUEST['step']) ? intval($_REQUEST['step']) : 1;
//安装数据库
if(strtoupper($_SERVER['REQUEST_METHOD']) == 'POST'){
	$sql ="INSERT INTO " . $ecs->table('shop_config') . " (`id` ,`parent_id` ,`code` ,`type` ,`store_range` ,`store_dir` ,`value` ,`sort_order` )VALUES ('10', '0', 'robot', 'group', '', '', '', '1')";
	$db->query($sql);
	
	$sql ="INSERT INTO " . $ecs->table('shop_config') . " (`id` ,`parent_id` ,`code` ,`type` ,`store_range` ,`store_dir` ,`value` ,`sort_order`)VALUES (NULL , '10', 'send_confirm_qqmsg', 'select', '1,0', '', '1', '1'),(NULL , '10', 'send_ship_qqmsg', 'select', '1,0', '', '1', '1'),(NULL , '10', 'send_cancel_qqmsg', 'select', '1,0', '', '1', '1'),(NULL , '10', 'send_invalid_qqmsg', 'select', '1,0', '', '1', '1'),(NULL , '10', 'send_service_qqmsg', 'select', '1,0', '', '1', '1'),(NULL , '10', 'send_payed_qqmsg', 'select', '1,0', '', '1', '1'),(NULL , '10', 'qqmsg_qq', 'text', '', '', '', '1')";
	$db->query($sql);
	header('Location:install.php?step=2');
}
?>
<!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>QQ机器人 — 安装</title>
<style type="text/css">
body,p,td,th,div {
  font:12px Arial, Helvetica, sans-serif;
  line-height:130%;
}

body,p,td,th,div {
  color: #192E32;
}

html {
  overflow-y:scroll;
}

body {
  margin: 0px;
  padding: 0px;
  text-align:center;
  background: #ddeef2;
}
p{
  font-size:12px;
  color:#555;
  text-align:left;
  margin:0px;
}

h2,h3,h4 {
  font-family:Arial, Helvetica, sans-serif;
  color:#fff;
  margin:15px 0 5px 0;
}

h4 {
  font-size:12px;
}
input.button {
  padding: 2px 8px 0px;
  margin: 2px 2px;
  border: 1px solid #2D5082;
  background: url(images/button_bg.gif) repeat-x top center;
}
</style>
</head>

<body>
<!--第一步-->
<?php if($step == 1){?>
<form action="" method="post" name="form1">
<table width="400" border="0" cellspacing="1" cellpadding="0" align="center" style="margin-top:100px;" bgcolor="#BBDDE5">
  <tr>
    <td height="50" align="center" valign="middle" bgcolor="#80BDCB"><h2>确定安装QQ机器人吗？</h2></td>
  </tr>
  <tr>
    <td height="30" align="center" valign="middle" bgcolor="#FFFFFF">
    <input name="sub" type="submit" value="确   定" class="button" />&nbsp;&nbsp;&nbsp;
    <input name="cancel" type="button" value="取   消" class="button" onclick="window.location.href='../../';" />
    </td>
  </tr>
</table>
</form>
<?php }?>
<!--第一步 END-->
<!--第二步-->
<?php if($step == 2){?>
<table width="470" border="0" cellspacing="1" cellpadding="0" align="center" style="margin-top:100px;" bgcolor="#BBDDE5">
  <tr>
    <td height="50" align="center" valign="middle" bgcolor="#80BDCB"><h2>QQ机器人安装成功</h2></td>
  </tr>
  <tr>
    <td height="30" align="center" valign="middle" bgcolor="#80BDCB"><h2>请登录网店管理后台，进入网店设置，设置QQ机器人参数</h2></td>
  </tr>
  <tr>
    <td height="30" align="center" valign="middle" bgcolor="#FFFFFF">
    <input name="cancel" type="button" value="确   定" class="button" onclick="window.location.href='../../';" />
    </td>
  </tr>
</table>
<?php }?>
<!--第二步 END-->
</body>
</html>