<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
dadd=0 '要增加的时间,单位是天
serverlistid=0 '服务器编号
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmhost")="" And session("canadmhostadd")="" And session("canadmhostset")="" And session("canadmhostch")="" And session("canadmhostmidsub")="" And session("canadmhostmiddomain")="" And session("canadmhostmidcpu")="" And session("canadmhostmidrepay")="" And session("canadmhostdel")="" And session("canadmhostoth")="" Then
	ef=True
	ec="您没有此操作的权限。"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Product_Host where ServerlistID = '"&serverlistid&"' order by id desc"
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="此类内容不存在！"
end if
end if

if not ef then
while not dsph.eof
dsph("endtime")=dateadd("d",dadd,dsph("endtime"))
dsph.update
response.write dsph("username")&" 新时间："&dsph("endtime")&"<br>"


'开通邮箱
Set dsphemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Email where byhost='"&dsph("id")&"' and username='"&dsph ("username")&"'"
	dsphemail.Open Sql,conn,1,3
if not dsphemail.Eof then
dsphemail("endtime")=dsph("endtime")
response.write dsph("username")&" 邮箱也更改新时间："&dsph("endtime")&"<br>"
dsphemail.update
dsphemail.close
end if



'Sql

Set dsphSql = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Sql where byhost='"&dsph("id")&"' and username='"&dsph ("username")&"'"
	dsphSql.Open Sql,conn,1,3
while not dsphSql.Eof
dsphSql("endtime")=dsph("endtime")
response.write dsph("username")&" 数据库也更改新时间："&dsph("endtime")&"<br>"
dsphSql.update
dsphSql.movenext
wend
dsphSql.close



dsph.movenext
wend
dsph.close
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>