<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.QueryString ("username")<>"" and RegExpTest("[^A-Za-z0-9]",Request.QueryString ("username")) Then
	ef=True
	ec="用户名中有非法字符！"
ElseIf Request("id")<>""  and not IsNumeric(Request("id")) Then
	ef=True
	ec="请输入正常的ID！"
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_Sql where username='"&Request.QueryString ("username")&"' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') "
if Request.QueryString ("id") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Sql where id='"&Request.QueryString ("id")&"' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') "
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,1
if dsph.Eof then
	ef=True
	ec="此用户并没有开通数据库产品！"
end If
end if

if not ef then
	Set ds = Server.CreateObject("ADODB.Recordset")	
				Sql="Select * from FreeHost.FreeHost_USER where  (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and username='"&dsph ("username")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		ds.Open Sql,conn,1,1
if ds.eof then
	ef=True
	ec="用户不存在!"
end if
end if


if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>
 　用户数据库管理
 <%=htmlwrite("html6")%>
<br>用户名：<%=ds("username")%>
<br>金额：<%=ds("usermoney")%>
<br>电子邮件：<a href=mailto:<%=ds("Email")%>><%=ds("Email")%></a>
<br>QQ：<%=ds("qq")%>
<br>中文名：<%=ds("truename")%>
<br>联系地址：<%=ds("address")%>
<br>电话：<%=ds("tel")%>
<br>注册ip：<%=ds("regip")%>
<br>注册时间：<%=ds("regtime")%>

              <form action="handSql2.asp" method="post" name="form1">
<%while not dsph.Eof%>	
<%=dsph("id")%>.
<input type="radio" name="id" value="<%=dsph("id")%>" <%if dsph.RecordCount=1 then%>checked<%end if%>>
产品类型：<%=dsph("Sqltype")%> 所在服务器:<%=dsph("ServerlistID")%> 状态：<%if dsph("endtime")>NOW then%>
<%if dsph("istest")="y" then%>
      <strong><font color=red>目前处于试用期!</font></strong>
      <%else%>
	  <%=dsph("status")%>
	  <%end if%>  
  <%else%>
	  <font color=red><strong>已过期！</strong></font>
<%if dsph("status")="暂停" then%><font color=blue>并且已暂停!</font><%end if%>
 	  <%end if%> 开通时间:<%=dsph("starttime")%> 到期时间:<%=dsph("endtime")%>　数据库登陆名:<%=dsph("sqlname")%>　数据库登陆密码:<%=dsph("sqlpassword")%> <%if not isnull(dsph("byhost")) then%>　购买了<a href="hostadm2.asp?id=<%=dsph("id")%>&go=a" target="_blank"><font color="red">虚拟主机(<%=dsph("byhost")%>)</font></a>所赠送<%end if%>
<br>
<%
dsph.movenext
wend
%>
<input name="username" type="hidden" value="<%=ds("username")%>">
新数据库密码:
<input name="password" type="text" id="password" size="14" maxlength="14">
<input type="submit" name="Submit" value="重设数据库密码">
<input type="submit" name="Submit" value="暂停">
<input type="submit" name="Submit" value="恢复">
<input type="submit" name="Submit" value="修改">　　　
<input type="submit" name="Submit" value="删除">
              
              </form>
<%=htmlwrite("html7")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
