<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(Request("ServerlistID"))  Then
	ef=True
	ec="产品ID应该是数字！"
elseIf session("canadmidc")="" Then
	ef=True
	ec="您没有此操作的权限。"
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.Form ("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 dshost = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_IDCProductlist where IDCtype='"&Request.Form ("IDCtype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dshost.Open Sql,conn,1,1
if dshost.Eof then
	ef=True
	ec="产品不存在！"
Else
'读取月付
PAY_Month=dshost("PAY_Month")
PAY_Season=dshost("PAY_Season")
PAY_halfyear=dshost("PAY_halfyear")
PAY_Nextyear=dshost("PAY_Nextyear")
PAY_2year=dshost("PAY_2year")
PAY_3year=dshost("PAY_3year")
PAY_4year=dshost("PAY_4year")
PAY_5year=dshost("PAY_5year")

end if
end If

if not ef then
	Set dsX = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_IDCJG where id='"&Request.Form ("ServerlistID")&"'"
If Request.Form ("ServerlistID")=0 Then 	Sql="Select * from FreeHost.FreeHost_IDCJG where id='"&dshost ("ServerlistID")&"'"
	dsX.Open Sql,conn,1,1
if dsX.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="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="admidc.asp"><font color="#FFFFFF"><strong>IDC管理</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">
	  <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#C8DAFF" id="t1">
  <tr height="24">
    <td width="13%" align="right" bgcolor="#ECF2FF"> 用户名：</td>
    <td width="87%" align="left" bgcolor="#FAFAFA">　<a href="searchuser.asp?username=<%=ds("username")%>" target="_blank"><%=ds("username")%></a> 　 <a href="javascript:document.formTop.action='/user/changeuser.asp';document.formTop.username.value='<%=ds("username")%>';document.formTop.submit();"><font color="#000000">切换成此用户角色>>>(用户区点注销会自动退回管理区)</font></a>　 <a href="#"  onClick="t1.style.display='none';"><font color="#6595D6">X</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")%> </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("postid")%> </td>
  </tr>
  <tr height="24">
    <td bgcolor="#ECF2FF" align="right"> 电话：</td>
    <td align="left" bgcolor="#FAFAFA">　<%=ds("tel")%> 　传真：<%=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>
<form action="admidc3.asp" method="post" name="autoopen">
<DIV class="tableborder" id="table1" <%if Request.QueryString ("op")<>"" then%> style="display:xnone"<%end if%>><table width="100%"  border="0" cellspacing="1">
        <tr >
          <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">开通IDC业务或录入IDC资源</font></td>
        </tr>
        <tr bgcolor="#E4EAF2">
          <td width="9%" height="40" align="right" bgcolor="#E4EAF2">&nbsp;</td>
          <td width="91%" align="left">　IDC产品：
            <input name="IDCtype" type="hidden" value="<%=Request.Form("IDCtype")%>">
<%=Request.Form ("IDCtype")%>
　　　所在的机柜：
<input name="ServerlistID" type="hidden" value="<%=dsX("id")%>">
<%JGID=dsX("id")%>
<%=dsX("id")%>.<%=dsX("jgname")%>[<%=dsX("jfname")%>]
<input name="username" type="hidden" id="username" size="10" maxlength="14" readonly value="<%=ds("username")%>">
<br>
<br>
　分配IP：<br>
<%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_IDCIP where pdid=0 and JGID='"&JGID&"' order by id asc"
'response.write sql
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
　IP列表为空.
<%else%>
<%while not dsX.Eof%>
　<input name="IPID<%=dsX("id")%>" type="checkbox" value="<%=dsX("id")%>"><%=dsX("ip")%><br>
<%
dsX.movenext
wend%>
<%end if%>
<br><br>
　
期限：
<%usermoney=dshost("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">
2015-7-24<br>
　用户金额中扣除：
<input name="usermoney" type="text" id="usermoney" size="8" value="">
元(如果不填写，将按产品默认金额扣除,也可以设成0)<br> 
<!--　初始管理名用户名：
<input name="admname" type="text" id="admname" size="10" maxlength="14">
初始管理员密码：
<input name="admpass" type="password" id="admpass" size="10" maxlength="20">
<br>-->
　状态：
  <select name="status" id="status">
  <option value="等待处理">等待处理</option>
    <option value="准备上架">准备上架</option>
    <option value="正常" selected>正常</option>
    <option value="暂停">暂停</option>
    <option value="过期">过期</option>
	<option value="空闲">空闲</option>
  </select>
  状态选空闲将作为IDC资源录入，不会扣费，但也有到期时间。<br>
  <br>
　修改用户备注：
<textarea name="userremindinfo" cols="50" id="host1"><%=userremindinfo%></textarea>
<br>
　修改处理返回信息：
<textarea name="openinfo" cols="50" id="host1"><%=openinfo%></textarea>
<br>
　内部记录：
<input name="admremindinfo" type="text" id="admremindinfo" size="70" maxlength="200">
<br>
　
<input name="Submit" type="submit" id="Submit" value="下一步"></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%>
