<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "Include/Conn.asp"-->
<%
Action = Request.QueryString("action")
If Action="Reinstall" then
	Conn.Execute ("Delete From LiTong_Admin")
	Conn.Execute ("Delete From LiTong_System_Set")
	Response.Redirect("index.asp")
End If

If Action="install" then
	Host = lcase(Request.ServerVariables("HTTP_HOST"))
	Port = lcase(Request.ServerVariables("SERVER_PORT"))
	SiteName = ReplaceFunctionStr(Request.form("site_name"))
	WebHostName = ReplaceFunctionStr(Request.form("WebHostName"))
	CompanyName = ReplaceFunctionStr(Request.form("companyname"))
	Webaddress = ReplaceFunctionStr(Request.form("Webaddress"))
	Webtel = ReplaceFunctionStr(Request.form("webtel"))
	Webqq = ReplaceFunctionStr(Request.form("webqq"))
	WebFax = ReplaceFunctionStr(Request.form("WebFax"))
	Webemail = ReplaceFunctionStr(Request.form("Webemail")) 
	Webicp = ReplaceFunctionStr(Request.form("Webicp"))
	WebSpace = ReplaceFunctionStr(Request.form("WebSpace"))
	WebExpiryDate = ReplaceFunctionStr(Request.form("WebExpiryDate"))
	AdminUserName = ReplaceFunctionStr(Request.form("AdminUser"))
	AdminPassword = ReplaceFunctionStr(Request.form("AdminPassword"))
	WebAdminQuanxian = ReplaceFunctionStr(Request.form("WebAdminQuanxian"))
	Set cRs=Conn.Execute("Select * From LiTong_Content_Class order by ID")
	Do While Not cRs.Eof
		ClassPower=ClassPower&cRs(0)&"|"
	cRs.Movenext
	Loop
	cRs.Close
	Set cRs=Nothing
	Set Rs=Server.CreateObject("Adodb.Recordset")
	Sql="Select * From LiTong_Admin"
	Rs.Open Sql,Conn,3,3
	If Rs.Eof Then
	Rs.Addnew
	Rs(1)=True
	Rs(2)=AdminUserName
	Rs(3)=Encryption(AdminPassword)
	Rs(4)=WebAdminQuanxian
	Rs(5)=ClassPower
	Rs(6)="审核|推荐|排序|删除|激活|锁定|充值|邮件|转移|提交|恢复|更新|升级|"
	Rs(7)=WebExpiryDate
	Rs(8)=AdminPassword
	Rs(9)=True
	Rs(10)=AdminUserName
	Rs(11)=WebHostName
	Rs.Update
	End If
	Rs.Close
	Set Rs=Nothing
	Set Rs=Server.CreateObject("Adodb.Recordset")
	Sql="Select * From LiTong_System_Set"
	Rs.Open Sql,Conn,3,3
	If Rs.Eof Then
	Rs.Addnew
	Rs(1)=WebHostName
	Rs(2)=AdminUserName
	Rs(3)=WebAdminQuanxian
	Rs(4)="聚同CMS"
	Rs(5)="聚同CMS"
	Rs(6)="<a href=""http://www.jutongcms.com"" target=""_blank"">聚同CMS</a>"
	Rs(7)="本程序版权及最终解释权归李同个人所有，谢绝任何侵权行为！"
	Rs(8)=SiteName
	Rs(9)="http://"&WebHostName&":"&Port
	Rs(10)=companyname
	Rs(11)=Webaddress
	Rs(12)=Webtel
	Rs(13)=Webqq
	Rs(14)=WebFax
	Rs(15)=Webemail
	Rs(16)=Webicp
	Rs(18)=True
	Rs(19)=True
	Rs(20)=True
	Rs(21)=True
	Rs(22)=True
	Rs(23)=True
	Rs(24)=True
	Rs(25)=True
	Rs(26)=True
	Rs(27)=True
	Rs(42)=SiteName
	Rs(43)=SiteName
	Rs(44)=companyname
	Rs(45)="Main"
	Rs(46)=WebSpace
	Rs(47)=WebExpiryDate
	Rs(48)="管理首页|留言反馈|友情链接|问卷调查|自定义信息|添加信息|信息列表|简介管理|新闻管理|商品管理|图片管理|视频管理|下载管理|外链管理|分类管理|会员组管理|筛选管理|评论管理|会员管理|积分设置|订单管理|购物车|支付配置|送货配置|模板管理|模版商城|自定义表单|系统设置|账户管理|数据统计|修改密码|网站更新|数据库管理|"
	Rs.Update
	End If
	Rs.Close
	Set Rs=Nothing
	
	Set TempRs=Conn.Execute("Select * From LiTong_Skin_Temp Where isDefault=True")
	If Not TempRs.Eof Then
		Conn.Execute("Update LiTong_Skin_Temp Set SkinPath='http://"&WebHostName&"/Main/Skin/"&TempRs(7)&"' Where 1=1"&Sqlstr&" And isDefault=True")
	End If
	TempRs.Close
	Set TempRs=Nothing
	
	Call ChangeHost(Host)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
<title>聚同CMS-网站配置向导</title>
<Script type="text/javascript" src="Js/InstallAjax.js"></Script>
<style type="text/css">
<!--
body {margin:30px;text-align:center;}
#installhint {font-size:14px;color:#F00;}
#installhint a{font-size:14px;color:#00F;}
td {font-size:12px;text-align:center;}
strong {font-size:14px;}
A:link{text-decoration:underline;color:#00F;}
-->
</style>
</head>

<body><br><br>
<table width="500" align="center" border="0" cellpadding="8" cellspacing="1">
  <tr>
    <td style=" font-size:14px;font-weight:bold;color:#060;"><strong style="color:#000;">系统提示：</strong>软件安装成功</td>
  </tr>
  <tr>
    <td style="color:#F00">您可以选择以下操作：</td>
  </tr>
  <tr>
    <td>1、<a href="../admin">登录后台管理</a></td>
  </tr>
  <tr>
    <td>2、<a href="../Main/index.asp">访问网站首页</a></td>
  </tr>
  <tr>
    <td>3、<a href="Install.asp?action=Reinstall" target="_blank">重新安装</a></td>
  </tr>
  <tr>
    <td style=" font-size:14px;color:#F00;line-height:200%;"><b>特别注意：</b>安装完毕后如果出现前台样式无法正常显示，请登录后台更新网站。</td>
  </tr>
</table>
<div id="installhint">&nbsp;</div>
<script type="text/javascript">InstallIt('<%=GetIp()%>','<%=WebHostName%>','<%=SiteName%>','<%=WebAdminQuanxian%>',<%=WebSpace%>,'<%=WebExpiryDate%>','<%=AdminUserName%>','<%=AdminPassword%>');</script>
</body>
</html>
<%
End If
Call ConnClose()
%>