<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%'on error resume next
 
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf RegExpTest("[^A-Za-z0-9]",Request.QueryString ("username")) Then
	ef=True
	ec="用户名中有非法字符！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request.QueryString ("ftpname")) Then
	ef=True
	ec="FTP名中有非法字符！"	
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
elseIf session("canadmhostset")="" and session("canadmhost")="" 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
hostname=trim(replace(Request("hostname"),"http://",""))
if hostname<>"" then hostname=ComX.idntoac_7i24_com(cstr(hostname))
hostnamecheck=replace(hostname,".","")
hostnamecheck=replace(hostnamecheck,"xn--","")
If RegExpTest("[^A-Za-z0-9--]",hostnamecheck) Then
	ef=True
	ec="请输入合法的域名！"
end if
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_NetCn where username='"&Request.QueryString ("username")&"'"
if Request.QueryString ("id") <>"" then Sql="Select * from FreeHost.FreeHost_Product_NetCn where id='"&Request.QueryString ("id")&"'"
if Request.QueryString ("ftpname") <>"" then Sql="Select * from FreeHost.FreeHost_Product_NetCn where ftpname='"&Request.QueryString ("ftpname")&"'"
if Request.QueryString ("hostname")<>"" then Sql="Select * from FreeHost.FreeHost_Product_NetCn where hostname like '%"&ComX.idntoac_7i24_com(cstr(hostname))&"%'"
if Instr(1,sql, ";", 1)>0 or Instr(1,replace(sql,"xn--",""), "--", 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
subweb=0
domaincount=0
If Request.QueryString ("id") <>"" Or Request.QueryString ("hostname") <>"" Or Request.QueryString ("ftpname") <>"" Then


starttime=dsph("starttime")
endtime=dsph("endtime")
repaymoney=dsph("repaymoney")
corewhat=dsph("corewhat")


	Set dspdl = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_NetCNProductlist where productid='"&dsph ("productid")&"'"
		dspdl.Open Sql,conn,1,1
If dspdl.Eof Then
	ef=True
	ec="不存在的产品类型！"
Else
'读取月付
PAY_Month=dspdl("PAY_Month")
PAY_Season=dspdl("PAY_Season")
PAY_halfyear=dspdl("PAY_halfyear")
PAY_Nextyear=dspdl("PAY_Nextyear")
PAY_2year=dspdl("PAY_2year")
PAY_3year=dspdl("PAY_3year")
PAY_4year=dspdl("PAY_4year")
PAY_5year=dspdl("PAY_5year")
end If
End if
else
starttime="2007-7-24"
endtime="2008-7-24"
End if


if not ef then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where 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("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand" onClick="t1.style.display='';"><a href="netcnhost1.asp"><font color="#FFFFFF">主机管理</font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF">
	    <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#C8DAFF">
          <tr height="24">
            <td width="13%" align="right" bgcolor="#ECF2FF"> 用户名：</td>
            <td width="87%" align="left" bgcolor="#FAFAFA">　<%=ds("username")%> 　 <a href="javascript:document.formTop.action='/user/changeuser.asp';document.formTop.username.value='<%=ds("username")%>';document.formTop.submit();"><font color="#000000">切换成此用户角色>>>(用户区点注销会自动退回管理区)</font></a> </td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 金额：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("usermoney")%> 　</td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 电子邮件：</td>
            <td align="left" bgcolor="#FAFAFA">　<a href=mailto:<%=ds("email")%>><font color="#000000"><%=ds("email")%></font></a> 　<a href="emailone.asp?email=<%=ds("email")%>&title=<%=ds("username")%>用户您好" target="_blank">发邮件给这个用户&gt;&gt;&gt;</a></td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> QQ：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("qq")%> 　<a href="tencent://message/?uin=<%=ds("qq")%>&Site=<%=Request.ServerVariables("SERVER_NAME")%>&Menu=yes" title="发送即时消息给用户"" target="_blank">发送即时消息给用户&gt;&gt;</a>　　　　　　　　　　　　　　　　<a href="deluser.asp?username=<%=ds("username")%>"><font color="#000000">马上删除此用户&gt;&gt;&gt;</font></a>　 </td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right">代理名：</td>
            <td align="left" bgcolor="#FAFAFA">　
                <%if ds("agent1")<>"n" then%>
                <a href="searchagent.asp?username=<%=ds("agent1")%>" target="_blank"><font color="blue"><%=ds("agent1")%></font></a>
                <%end if%></td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"><div align="right">中文名：</div></td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("truename")%> </td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 联系地址：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("address")%> 　联系人：<%=ds("contact")%> 邮编：<%=ds("postid")%> </td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 电话：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("tel")%> 　手机：<%=ds("mobi")%> 传真：<%=ds("fax")%> </td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 手机：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("mobi")%>　 <a href="smsone.asp?SendNum=<%=ds("mobi")%>&Content=<%=ds("username")%>用户您好" target="_blank">发短信给这个手机&gt;&gt;&gt;</a></td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 备注：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("coreinfo")%>　<a href="javascript:document.formTop.action='/user/changeuser.asp?gourl=/user/modify.asp';document.formTop.username.value='<%=ds("username")%>';document.formTop.submit();"><font color="#000000">修改用户资料>>>(用户区点注销会自动退回管理区)</font></a></td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 身份证号码：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("perid")%></td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 注册ip：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("regip")%> </td>
          </tr>
          <tr height="24">
            <td bgcolor="#ECF2FF" align="right"> 注册时间：</td>
            <td align="left" bgcolor="#FAFAFA">　<%=ds("regtime")%> </td>
          </tr>
        </table>
	    <form action="handhostnetcn2.asp" method="post" name="form1">
<%if not dsph.eof then%>
<DIV class="tableborder">
<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center">
  <tr bgcolor="#C1BFBF" align="center">
    <td height="24" colspan="2" background="img/tablebg.gif"><font color="#FFFFFF">编号</font></td>
    <td width="22%" background="img/tablebg.gif"><font color="#FFFFFF">产品类型</font></td>
    <td width="8%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">用户名</font></td>
    <td width="10%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">域　名</font></td>
    <td width="9%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">FTP/Pass</font></td>
    <td width="8%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">IP 地址</font></td>
    <td width="13%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">开通/到期</font></td>
    <td width="6%" background="img/tablebg.gif"><font color="#FFFFFF">操作</font></td>
    <td width="7%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">状态</font></td>
    <td width="7%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">查万网</font></td>
  </tr>
<%

while not dsph.Eof%><%
	productid=dsph("productid")
	Set ori_host_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_NetCNProductlist where productid='"&dsph("productid")&"'"
		ori_host_name.Open Sql,conn,1,1
		if not ori_host_name.eof Then
Hosttype=ori_host_name("Hosttype")		
HosttypeORI=ori_host_name("HosttypeORI")		
'Set newname_host = Server.CreateObject("ADODB.Recordset")	
'Sql="Select * from FreeHost.FreeHost_NetCNProductlist_AGN where agent1='"&dsph("agent1")&"' and id='"&ori_host_name("id")&"'"
	'	newname_host.Open Sql,conn,1,1
'if not newname_host.eof then
'Hosttype=newname_host("Hosttype")
'end if
		end if
	%>
  <tr align="center" bgcolor="#E4EAF2" title="<%=dsph("corewhat")%>">
    <td width="6%"><%=dsph("id")%></td>
    <td width="4%"><input type="radio" name="id" value="<%=dsph("id")%>" <%if dsph.RecordCount=1 then%>checked<%end if%> onClick="window.location='handhost1.asp?id='+this.value"></td>
    <td><%=Hosttype%><br>
      <%=HosttypeORI%><br>

<%if not isnull(dsph("repaymoney")) then%>
此产品已设置了单独续费价格：<%=dsph("repaymoney")%>元/年
<%end if%>

</td>
    <td height="30"><a href="searchuser.asp?username=<%=dsph("username")%>"><%=dsph("username")%></a><br>
      <%if dsph("agent1")<>"n" then%>
(<a href="searchagent.asp?username=<%=dsph("agent1")%>" target="_blank"><font color="#FF0000"><%=dsph("agent1")%></font></a>)
<%end if%></td>
    <td><a href="http://<%=dsph("domain")%>" target=_blank><%=dsph("domain")%></a></td>
    <%
'
%>
    <td bgcolor="#E4EAF2"><%=dsph("ftpname")%><br>
      <%=dsph("ftppassword")%><br>
      <a target="_blank" href="ftp://<%=dsph("ftpname")%>:<%=dsph("ftppassword")%>@<%=lcase(dsph("ipaddress"))%>"> 连接FTP</a></td>
    <td>      
      <%=dsph("ipaddress")%><br></td>
    <td width="13%"><%=formatdatetime(dsph("starttime"),1)%><br>
      <%If Not IsNull(dsph("endtime")) then%>
      <%=formatdatetime(dsph("endtime"),1)%>
      <%End if%>
      <br>
      <a href="moneyalllist.asp?op=search&selecttype=全部&usertype=用户或代理名&whichProduct=万网主机产品&pdid=<%=dsph("id")%>" target="_blank">此产品财务信息</a></td>
    <td><a href="http://cp.hichina.com/login.asp?username=<%=dsph("ftpname")%>" target=_blank><font color="#000000">登陆面板</font></a></td>
    <td width="7%"><%if dsph("endtime")>NOW then%>

      <%=dsph("status")%>

      <%else%>
      <font color="#FF0000">过期</font>
      <%if dsph("status")="暂停" then%>
      <br>
      <font color="#FF0000">暂停</font>
      <%end if%>
      <%end if%></td>
    <td width="7%"><a href="hostnetcnadminfo.asp?id=<%=dsph("id")%>" target="_blank">查询</a>
</td>
  </tr>
<%username=dsph("Ftpname")


if (instr(1,returnstr,"用户不存在！")>0) then %>
<font color=red>服务器上没有找到此用户，修复此用户</font>
<input type="submit" name="Submit" value="马上重开此用户"><br>
<%end if
if returnstr="" then
%>
<!--无法连接此服务器，请检查-->
<%=returnstr%><%
end if 
%>

<%
dsph.movenext
wend%></table>
</div>

<%dsph.close
set dsph=nothing
else%>
<DIV class="tableborder"><br>
<br>
没有相关的记录。<br>
<br>
</div>
<%end if%>
<br>
<DIV class="tableborder">
<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center">
  <tr bgcolor="#C1BFBF" align="center">
    <td width="15%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">类型</font></td>
    <td height="24" background="img/tablebg.gif"><font color="#FFFFFF">
      <input name="username" type="hidden" value="<%=ds("username")%>">
      操作</font></td>
    </tr>
  <tr align="center" bgcolor="#E4EAF2">
    <td>修改FTP密码</td>
    <td height="30" align="left">　新FTP密码：
        <input name="password" type="text" id="password" size="14" maxlength="14">
        <input type="submit" name="Submit" value="重设FTP密码">　</td>
  </tr>
  <tr align="center" bgcolor="#E4EAF2">
    <td>转移产品</td>
    <td height="30" align="left">　转移此产品给新用户：
      <input name="newusername" type="text" id="newusername" size="14">
      <input type="submit" name="Submit" value="马上转移"></td>
  </tr>
  <tr align="center" bgcolor="#E4EAF2">
    <td>延期</td>
    <td height="103" align="left">　
        <%if repaymoney<>"" then%>
        <font color="red">此产品已设置了单独续费价格：<%=repaymoney%>元/年</font>
        <%end if%>
        <input type="radio" name="year" value="<%=PAY_Nextyear%>" checked>
    一年
    <input type="radio" name="year" value="<%=PAY_2year%>">
    两年
    <input type="radio" name="year" value="<%=PAY_3year%>">
    三年
    <input type="radio" name="year" value="<%=PAY_4year%>">
    四年
    <input type="radio" name="year" value="<%=PAY_5year%>">
    五年<br>
    　用户金额中扣除：
    <input name="usermoney" type="text" id="usermoney" size="3" value="">
    元(如果不填写，将按产品默认金额扣除,也可以设成0)
    <input type="submit" name="Submit" value="马上调整"></td>
  </tr>
<%if ostype="windows" then%>
<%end if%>
<%if ostype="windows" then%>
<%end if%>  
<%if ostype="linux" then%>
<%end if%>

<%if ostype="windows" then%>
<%end if%>
<%if ostype="windows" then%>
<%end if%>

  <tr align="center" bgcolor="#E4EAF2">
    <td height="40">强行删除</td>
    <td height="40" align="left">　
      <input type="submit" name="Submit" value="删除"  onclick="JavaScript:if(confirm('确定删除吗？')){document.form1.submit();}">
(删除是不可恢复的删除，只在本地操作，万网中并不会变化)
<script language=JavaScript>
<!--
	function chkForm(theform)
	{
			if(! confirm("请确认是否要删除?\n注意，如果删除是没有办法恢复的。"))
				return false;
	}
//-->
</script></td>
  </tr>

  <tr align="center" bgcolor="#E4EAF2">
    <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
    </tr>
</table>
</div>
</form></TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>
<%=htmlwrite("html10")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
