⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prodsubmit.asp

📁 蓝芒3.0A最新所有功能完整破解版
💻 ASP
📖 第 1 页 / 共 2 页
字号:
	BPCode=Rs("BPCode")
	MaxSecDN=Rs("ThiNB")
	ProdName=Rs("ProdName")
	ServerPubIP=Rs("ServerPubIP")
	
	MaxIIS=RS("MaxIIS")
	MaxCPU=RS("MaxCPU")
	MaxBandWidth=RS("MaxBandWidth")	
	
	Rs.Close
	
	strSQL="Select * from T_DNS_AllVH where VHName='" & FtpAccount & "' or VHName='" & HostName & "'"
	Rs.open strSQL,Cn
	if not Rs.eof then
		Rs.Close
		Response.Write "此虚拟主机名重复了,请重新输入虚拟主机名!"
		Call PrintPageBottom
		Response.End
	end if
	Rs.Close
	Set Rs=Nothing
	
	if IsFtpUserExist(ServerIP,FtpAccount)=0 then
		Response.Write "该FTP用户已经存在, 请重新输入用户名称!"
		Call PrintPageBottom
		Response.End
	end if
	
	if CreateWebDirectory(ServerIP,FtpAccount)<>0 then
		Response.Write "建立虚拟主机失败, 请重新尝试! 错误码: 1"
		Call PrintPageBottom
		Response.End
	end if
	
	if Trim(Domain)="" then
		ReDim Bindings(0)
		Bindings(0)=":80:" & FtpAccount & ServerDomain
	else
		ReDim Bindings(1)
		Bindings(0)=":80:" & FtpAccount & ServerDomain
		if IsNULL(DomainHead) or Trim(DomainHead)="" then
			Bindings(1)=":80:" & Domain
		else
			Bindings(1)=":80:" & DomainHead & "." & Domain
		end if
	end if
	
	if CreateIISServer(ServerIP,FtpAccount,FtpAccount & "\" & Opt_System_UserWebRoot,Bindings,ServerType,SiteNum)<>0 then
		Response.Write "建立虚拟主机失败, 请重新尝试! 错误码: 2"
		Call PrintPageBottom
		Response.End
	end if
	
	if CreateFtpUser(ServerIP,FtpAccount,FtpPassword,FtpAccount,CStr(Cint(SiteSize)*1000*1024),strEndDate)<>0 then
		Response.Write "建立虚拟主机失败, 请重新尝试! 错误码: 3"
		Call PrintPageBottom
		Response.End
	end if
	
	if SetLogFileDirectory(ServerIP,SiteNum,GetUserHomeDir(ServerIP,FtpAccount) & Opt_System_UserLogRoot)<>0 then
		Response.Write "建立虚拟主机失败, 请重新尝试! 错误码: 4"
		Call PrintPageBottom
		Response.End
	end if
	
	if CreateDBVisualPath(ServerIP, SiteNum, FtpAccount & "\" & Opt_System_DBRoot,"DataBase")<>0 then
		Response.Write "建立虚拟主机失败, 请重新尝试! 错误码: 5"
		Call PrintPageBottom
		Response.End
	end if
	
	if SetMaxConnections(ServerIP, SiteNum, MaxIIS)<>0 then
		Response.Write "建立虚拟主机失败, 请重新尝试! 错误码: 6"
		Call PrintPageBottom
		Response.End
	end if
	
	Set RsNo= Cn.Execute("SP_PublicNObyRs 'P1120'")
	VHID=RsNo("Result")
	RsNo.Close
	Set RsNo=Nothing
	
	if ServerType="HTML" then
		DefaultPage="default.html, default.htm, index.html, index.htm"
	elseif ServerType="ASP" then
		DefaultPage="default.asp, index.asp, default.html, default.htm, index.html, index.htm"
	else
		DefaultPage="default.asp, index.asp, default.html, default.htm, index.html, index.htm"
	end if
	
	strSQL="insert into T_DNS_AllVH (VHID,UOID,BPCode,STime,UYear,ETime,UserName,PSW,ServerCode,VHDir,VHName,MaxSecDN,MaxSize,ThiDN,BindDomain,DNSeq,DefHomePage,IfWebLogin,FeeStat,WebStat,FTPStat,VHStat,UserID,Stat,MaxIIS,MaxCPU,MaxBandWidth) values('" & +_
	VHID & "','" & UOID & "','" & BPCode & "',getdate()," & HowLong & ",'" & strEndDate & "','" & FtpAccount & "','" & +_
	FtpPassword & "','" & ServerCode & "','" & FtpAccount & "','" & HostName & "'," & MaxSecDN & "," & SiteSize & +_
	",'" & FtpAccount & ServerDomain & "','" & Domain & "'," & SiteNum & ",'" & DefaultPage & "','N','1','1','1','2'," & UserID & ",'1'," & MaxIIS & "," & MaxCPU & "," & MaxBandWidth & ")"
	Cn.Execute(StrSQL)
	
	if Trim(Domain)<>"" then
		Set RsNo= Cn.Execute("SP_PublicNObyRs 'P1080'")
		BDNID=RsNo("Result")
		RsNo.Close
		Set RsNo=Nothing
		if IsNULL(DomainHead) or Trim(DomainHead)="" then
			strSQL="Insert into T_DNS_AllBDN (BDNID,VHID,BDN,APDNTime) values('" & +_
			BDNID & "','" & VHID & "','" & Domain & "',getdate())"
		else
			Domain = DomainHead & "." & Domain
			strSQL="Insert into T_DNS_AllBDN (BDNID,VHID,BDN,APDNTime) values('" & +_
			BDNID & "','" & VHID & "','" & Domain & "',getdate())"
		end if
		Cn.Execute(StrSQL)
	end if
	
	strSQL="Update T_DNS_ServerInfo Set RealSize=RealSize+" & SiteSize & ",RealUser=RealUser+1 Where ServerCode='" & ServerCode & "'"
	Cn.Execute(StrSQL)
	
	if InStr(strDSM,"D")>0 then '如套餐包含域名,则添加主机的DNS绑定
		' 如果是本地的DNS
		if (lcase(DNS1Name)=lcase(Sys_Opt_DNS1_Name) and lcase(DNS2Name)=lcase(Sys_Opt_DNS2_Name)) or (lcase(DNS1Name)=lcase(Sys_Opt_DNS2_Name) and lcase(DNS2Name)=lcase(Sys_Opt_DNS1_Name)) then
			if IsNULL(DomainHead) or Trim(DomainHead)="" then
				DH="@"
			else
				DH=DomainHead
			end if
			if AddHost(Sys_Opt_DNS1_IP,DomainName,DH,ServerPubIP,RetStr)=0 then
				Set RsNo= Cn.Execute("SP_PublicNObyRs 'P1170'")
				DRID=RsNo("Result")
				RsNo.Close
				Set RsNo=Nothing
				
				strSQL="Insert into T_DNS_DNSResolve (DRID,DNID,HostName,TTL,RRType,Reference,RRData,CrtDate) values('" & +_
					DRID & "','" & DNID & "','" & DomainHead & "','3600','" & "A" & "','" & +_
					"-" & "','" & ServerPubIP & "',getdate())"
				Cn.Execute(StrSQL)
			end if
		end if
	end if
			
				
	
	Subject="开通虚拟主机成功! --" & Opt_System_CompanyName
	MailFile = "../../../Include/MailTemplate/open.txt"
	Send_Email Email,Subject,MailFile,"$注册人$",UserName,"$主机名$",HostName,"$绑定域名$",Domain,"$系统绑定三级域名$",FtpAccount & ServerDomain,"$密码$",FtpPassword,"$年限$",CStr(HowLong),"$开通日期$",strBeginDate,"$到期日期$",strEndDate,"$产品名$",ProdName,"$用户名$",FtpAccount,"$服务器IP$",ServerPubIP,"$默认文档$",DefaultPage
end if

'==========================================如果包含邮局======================================
strIfHaveMail="0"
if InStr(strDSM,"M")>0 then 
	strIfHaveMail="1"
	ProdInfo=ProdInfo & "邮局:" & MailDomain & " "
	strSQL="exec SP_CreateMail " & +_
		"'" & Session("UserID") & "'," & +_
		"'" & "查询" & "'," & +_
		"'" & Request.ServerVariables("REMOTE_ADDR") & "'," & +_
		"'" & ProdCode & "'"
	
	Set Rs= Cn.Execute(strSQL)
	if Rs("result")<>0 then
		Rs.Close
		Response.Write Rs("msg")
		Call PrintPageBottom
		Response.End
	end if
	ServerCode=Rs("ServerCode")
	ServerIP=Rs("ServerIP")
	MailSize=Rs("MailSize")
	MailUser=Rs("MailUser")
	MailSiteNum=Rs("SiteNum")
	BPCode=Rs("BPCode")
	ProdName=Rs("ProdName")
	ServerPubIP=Rs("ServerPubIP")
	Rs.Close
	
	strSQL="Select * from T_DNS_AllPost where BPostDN='" & MailDomain & "'"
	Rs.open strSQL,Cn
	if not Rs.eof then
		Rs.Close
		Response.Write "此邮局域名重复了,请重新输入邮局域名!"
		Call PrintPageBottom
		Response.End
	end if
	Rs.Close
	Set Rs=Nothing
	
	MailDomainList=GetMailDomainList(ServerIP)
	if InStr(MailDomainList,MailDomain)>0 then
		Response.Write "此虚拟主机名重复了,请重新输入邮局域名!"
		Call PrintPageBottom
		Response.End
	end if
	
	if CreateMailDomain(ServerIP,MailDomain)<>0 then
		Response.Write "建立邮局失败, 请重新尝试! 错误码: 1"
		Call PrintPageBottom
		Response.End
	end if
	
	if CreateMailUser(ServerIP,MailDomain,Opt_System_MailManager,MailPassword,"0")<>0 then
		Response.Write "建立邮局失败, 请重新尝试! 错误码: 2"
		Call PrintPageBottom
		Response.End
	end if
	
	if ChangeMailDomainProp(ServerIP,MailDomain,Opt_System_MailManager & "@" & MailDomain, MailUser, CStr(Cint(MailSize)*1000))<>0 then
		Response.Write "建立邮局失败, 请重新尝试! 错误码: 3"
		Call PrintPageBottom
		Response.End
	end if
	
	if AddIISSiteBindings(ServerIP,MailSiteNum,":80:mail." & MailDomain) then
		Response.Write "建立邮局失败, 请重新尝试! 错误码: 4"
		Call PrintPageBottom
		Response.End
	end if
	
	Set RsNo= Cn.Execute("SP_PublicNObyRs 'P1140'")
	PostID=RsNo("Result")
	RsNo.Close
	Set RsNo=Nothing
	
	strSQL="Insert into T_DNS_AllPost (PostID,UOID,BPCode,STime,UYear,ETime,UserName,PSW,ServerCode,BPostDN,MaxSize,MaxUser,FeeStat,PostStat,UserID,Stat,IfSubmit) values('" & +_
	PostID & "','" & UOID & "','" & BPCode & "',getdate()," & HowLong & ",'" & strEndDate & "','" & Opt_System_MailManager & +_
	"','" & MailPassword & "','" & ServerCode & "','" & MailDomain & "'," & MailSize & "," & MailUser & ",'1','1','" & UserID & "','1','0')"
	Cn.Execute(StrSQL)
	
	strSQL="Update T_DNS_ServerInfo Set RealSize=RealSize+" & MailSize & ",RealUser=RealUser+" & MailUser & " Where ServerCode='" & ServerCode & "'"
	Cn.Execute(StrSQL)
	
	if InStr(strDSM,"D")>0 then '如套餐包含域名,则添加邮局的DNS绑定
		' 如果是本地的DNS
		if (lcase(DNS1Name)=lcase(Sys_Opt_DNS1_Name) and lcase(DNS2Name)=lcase(Sys_Opt_DNS2_Name)) or (lcase(DNS1Name)=lcase(Sys_Opt_DNS2_Name) and lcase(DNS2Name)=lcase(Sys_Opt_DNS1_Name)) then
			CmdStr=" /RecordAdd " & DomainName & " " & "mail" & " MX " & "10" & " " & ServerPubIP
			if ExecuteDNSCommand(Sys_Opt_DNS1_IP,CmdStr,RetStr)=0 then
				Set RsNo= Cn.Execute("SP_PublicNObyRs 'P1170'")
				DRID=RsNo("Result")
				RsNo.Close
				Set RsNo=Nothing
				
				strSQL="Insert into T_DNS_DNSResolve (DRID,DNID,HostName,TTL,RRType,Reference,RRData,CrtDate) values('" & +_
					DRID & "','" & DNID & "','" & "mail" & "','3600','" & "MX" & "','" & +_
					"10" & "','" & ServerPubIP & "',getdate())"
				Cn.Execute(StrSQL)
			end if
		end if
	end if
	
	Subject="开通专业邮局成功! --" & Opt_System_CompanyName
	MailFile = "../../../Include/MailTemplate/openmail.txt"
	Send_Email Email,Subject,MailFile,"$产品名$",ProdName,"$服务器IP$",ServerPubIP,"$绑定域名$",MailDomain,"$年限$",CStr(HowLong),"$密码$",MailPassword,"$用户名$",Opt_System_MailManager & "@" & MailDomain,"$开通日期$",strBeginDate,"$到期日期$",strEndDate,"$注册人$",UserName,"","","","","",""
	%>
		<P align='center' class='titletext'>
		<form name="form1" method="post" action="ProdSubmit2.asp">
		<input type="hidden" name="ID" value="<%=PostID%>">
		<font color=red>您已经完成支付! 购买本服务产品成功。<br>为保证系统正确建立邮局信息,请点击下面按钮再次确认!</font><br>
		<input type="submit" name="Submit" value="再次确认邮局购买信息" class="button">
		</form>
		</p>
<%
end if

'=======================================全部处理完毕========================================

strSQL="Exec SP_BuyCombine 'Complete','" & UOID & "','" & ProdInfo & "'," & UserID & ",'" & session("P_ID") & "','" & IP & "'"
Set Rs= Cn.Execute(strSQL)
If Rs("result")="0" Then
	Response.Write Rs("msg")
	Rs.Close
	Cn.Close
	Call PrintPageBottom
	Response.End
end if
Set Rs=Nothing

strSQL="Delete from T_DNS_CurBuy where PID='" & session("P_ID") & "'"
cn.Execute(strSQL)
session("P_ID")=""
session("P_DSM")=""
if strIfHaveMail="0" then
%>
	恭喜,您的 <font color="#FF9900"><%=ProdName%></font> 服务购买成功,并已经开通!谢谢惠顾
	<br><br><br><br>
	<input type="button" class="button" name="back" value="继续购买其他产品服务" onclick="window.location='../ProductList.asp'">
<%
end if
Cn.Close
Call PrintPageBottom
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -