<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmCDN")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="用户名中有非法字符！"
ElseIf not IsNumeric(Request("CDNtype"))  Then
	ef=True
	ec="ID应该是数字！"
end If


if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&Request("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
	Set dsCDNpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_CDNProductlist where id='"&Request.Form ("CDNtype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsCDNpdlist.Open Sql,conn,1,1
if dsCDNpdlist.Eof then
	ef=True
	ec="产品不存在！"
Else
'读取月付
PAY_Month=dsCDNpdlist("PAY_Month")
PAY_Season=dsCDNpdlist("PAY_Season")
PAY_halfyear=dsCDNpdlist("PAY_halfyear")
PAY_Nextyear=dsCDNpdlist("PAY_Nextyear")
PAY_2year=dsCDNpdlist("PAY_2year")
PAY_3year=dsCDNpdlist("PAY_3year")
PAY_4year=dsCDNpdlist("PAY_4year")
PAY_5year=dsCDNpdlist("PAY_5year")
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="113"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="90" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="admCDN.asp"><font color="#FFFFFF"><strong>CDN管理</strong></font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="93">&nbsp;	  </TD>
      <TD width="113">&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"><br>
        <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("contact")%> 　联系人：<%=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("coreinfo")%></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>
        <br>
        <form action="admCDN3.asp" method="post" name="autoopen">
<DIV class="tableborder" id="table1"><table width="100%"  border="0" cellspacing="1">
        <tr >
          <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">开通新CDN</font></td>
        </tr>
        <tr bgcolor="#E4EAF2">
          <td width="9%" height="40" align="right" bgcolor="#E4EAF2">&nbsp;</td>
          <td width="91%" align="left">　用户名：
            <input name="username" type="text" id="username" value="<%=ds("username")%>" size="10" maxlength="14">
CDN产品:<%=dsCDNpdlist("CDNtype")%>
<input name="CDNtype" type="hidden" value="<%=dsCDNpdlist("id")%>">
<br>
　CDN面板独立用户名：
<input name="Ftpname" type="text" id="Ftpname" value="<%if Request("Ftpname")="" then%><%=ds("username")%><%else%><%=Request("Ftpname")%><%end if%>" size="10" maxlength="14">
<br>
　CDN面板独立密　码：
<input name="Ftppassword" type="text" id="Ftppassword" value="<%if Request("Ftppassword")="" then%><%=Ucase(Left(md5(now&ftpRkey),5))&right(md5(now&ftpRkey),4)%><%else%><%=Request("Ftppassword")%><%end if%>" size="10" maxlength="14"><br>
　期限：
<%usermoney=dsCDNpdlist("usermoney")%>
<input type="radio" name="year" value="999"  onClick="document.autoopen.usermoney.value =0;" <%if Clng(Request("year"))=999 then%>checked<%end if%>>
试用<%=Application("testtime")%>天
<input type="radio" name="year" value="<%=PAY_Month%>" onClick="document.autoopen.usermoney.value =Math.round(<%=PAY_Month*usermoney%>);" <%if Clng(Request("year"))=PAY_Month then%>checked<%end if%>>
一个月
<input type="radio" name="year" value="<%=PAY_Season%>" onClick="document.autoopen.usermoney.value =Math.round(<%=PAY_Season*usermoney%>);" <%if Clng(Request("year"))=PAY_Season then%>checked<%end if%>>
一季
<input type="radio" name="year" value="<%=PAY_halfyear%>" onClick="document.autoopen.usermoney.value =Math.round(<%=PAY_halfyear*usermoney%>);" <%if Clng(Request("year"))=PAY_halfyear then%>checked<%end if%>>
半年
<input type="radio" name="year" value="1" checked onClick="document.autoopen.usermoney.value =1*<%=usermoney%>;" <%if Clng(Request("year"))=1 then%>checked<%end if%>>
一年
<input type="radio" name="year" value="<%=PAY_2year%>" onClick="document.autoopen.usermoney.value =Math.round(<%=PAY_2year%>*<%=usermoney%>);" <%if Clng(Request("year"))=PAY_2year then%>checked<%end if%>>
两年
<input type="radio" name="year" value="<%=PAY_3year%>" onClick="document.autoopen.usermoney.value =Math.round(<%=PAY_3year%>*<%=usermoney%>);" <%if Clng(Request("year"))=PAY_3year then%>checked<%end if%>>
三年
<input type="radio" name="year" value="<%=PAY_4year%>" onClick="document.autoopen.usermoney.value =Math.round(<%=PAY_4year%>*<%=usermoney%>);" <%if Clng(Request("year"))=PAY_4year then%>checked<%end if%>>
四年
<input type="radio" name="year" value="<%=PAY_5year%>" onClick="document.autoopen.usermoney.value =Math.round(<%=PAY_5year%>*<%=usermoney%>);" <%if Clng(Request("year"))=PAY_5year then%>checked<%end if%>>
五年 <br>
　手工指定到期时间:
<input type="text" name="endtime" size="10" maxlength="10">
2012-7-24<br>
　用户金额中扣除：
<input name="usermoney" type="text" id="usermoney" size="8" value="">
元(如果不填写，将按产品默认金额扣除,也可以设成0)<br>
　域名允许绑定数量：
<input name="allowdomain" type="text" id="allowdomain" size="8" value="">
个(如果不填写，将按产品默认量) <br>
　月流量上限：
<input name="CDNMaxMb" type="text" id="CDNMaxMb" size="8" value="">
MB(如果不填写，将按产品默认量)<br><br>
　
<input name="Submit" type="submit" id="Submit" value="下一步"></td>
        </tr>
      </table>
         </div>
</form>	



<br>


</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%>
