<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Option Explicit
Response.buffer=True
Response.Charset="utf-8"
Dim Act
Act=Trim(Request.Form("act"))
%>
<!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>欢迎安装 快问知道问答系统</title>
<style type="text/css">
<!--
body{
	margin: 10px;
	padding: 0px;
	font-family: "宋体";
}
input { padding: 5px 3px 3px 3px; font-size: 14px; color: #333; }
.sn {
	padding: 5px 3px 3px 3px;
	font-size: 12px;
	color: #333;
}
.title { font-size: 16px; font-weight: bold; height: 38px; }
.list { font-size: 14px; height:25px; }
.intro { font-size: 12px; color: #999; width: 150px; }
#link{ font-size: 14px; line-height: 150%; font-weight: normal; color: #000000; background-color: #FDFDFD; margin: 120px 120px 0px 120px; padding: 20px; border: 1px solid #B6B6B6; }
#link a{ font-weight: normal; text-decoration: underline; color: #0000FF; }
#link a:hover{ color: #FF0000; text-decoration: none; }
-->
</style>
<script language="javascript">
function CheckForm()
{
  if (document.frm.siteurl.value=="")
   {
	alert("服务器地址不能为空");
	document.frm.siteurl.focus();
	return false;
   }
  if (document.frm.sitepath.value=="")
   {
	alert("系统安装位置不能为空");
	document.frm.sitepath.focus();
	return false;
   }
  if (document.frm.sitename.value=="")
   {
	alert("系统名称不能为空");
	document.frm.sitename.focus();
	return false;
   }
  if (document.frm.adminpath.value=="")
   {
	alert("后台地址不能为空");
	document.frm.adminpath.focus();
	return false;
   }   
   
  if (document.frm.adminname.value=="")
   {
	alert("管理员帐号不能为空");
	document.frm.adminname.focus();
	return false;
   }
  if (document.frm.adminpsd.value=="")
   {
	alert("管理员密码不能为空");
	document.frm.adminpsd.focus();
	return false;
   }
   
   var sqltype;
     for(var i=0;i<frm.sqltype.length;i++)   
     {   
            if(frm.sqltype[i].checked)
            { 
              sqltype=frm.sqltype[i].value;
            }
      }
   if(sqltype=="0")
   {
   
  if (document.frm.accpath.value=="")
   {
	alert("Acc数据库名不能为空");
	document.frm.accpath.focus();
	return false;
   }
   }
   else
   {
  if (document.frm.source.value=="")
   {
	alert("数据库服务器不能为空");
	document.frm.source.focus();
	return false;
   }
  if (document.frm.catalog.value=="")
   {
	alert("数据库名不能为空");
	document.frm.catalog.focus();
	return false;
   }
  if (document.frm.user.value=="")
   {
	alert("数据库用户名不能为空");
	document.frm.user.focus();
	return false;
   }
   }

  if (document.frm.predb.value=="")
   {
	alert("表名前缀不能为空");
	document.frm.predb.focus();
	return false;
   }
  if (document.frm.sn.value=="没有请留空")
   {
	document.frm.sn.value="";
   }
 }
</script>
</head>
<body>
<%
Dim installD
IF not IsObjInstalled("KwAsk.Install") Then
Response.Write("<div id=""link""><font color=red>该服务器空间未安装快问组件，请联系空间商安装！</font></div>")
Response.End()
End IF
Set installD = Server.CreateObject("KwAsk.Install")
	IF Act="step4" Then
	   Call installD.Step4()
	Else
	   Call installD.LockSetup(0)
		Select Case Act
		   Case "step1"
			  Call installD.step1()
		   Case "step2"
			  Call installD.step2()
		   Case "step3"
			  Call installD.step3()
		   Case else
			  Call installD.Main()
		End Select
	End IF
Set installD = Nothing

Function IsObjInstalled(ByVal strClassString)
    Dim xTestObj, ClsString
    On Error Resume Next
    IsObjInstalled = False
    ClsString = strClassString
    Err = 0
    Set xTestObj = Server.CreateObject(ClsString)
    If Err = 0 Then IsObjInstalled = True
    If Err = -2147352567 Then IsObjInstalled = True
    Set xTestObj = Nothing
    Err = 0
    Exit Function
End Function
%>
</body>
</html>