<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmIDC")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf RegExpTest("[^A-Za-z0-9]",Request.QueryString ("username")) Then
	ef=True
	ec="用户名中有非法字符！"
ElseIf RegExpTest("[^A-Za-z0-9]",Trim(Replace(Request.QueryString ("ip"),".",""))) Then
	ef=True
	ec="IP中有非法字符！"
ElseIf not IsNumeric(Request.QueryString ("id"))  Then
	ef=True
	ec="产品类型有非法字符！"
ElseIf Request("endtime")<>"" And Not IsDate(Request("endtime")) Then
	ef=True
	ec="时间格式无效endtime"
end If

if not ef Then

If Request("endtime")<>"" Then
Response.redirect "admidc.asp?endtime="&Request("endtime")
End If
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsIP = Server.CreateObject("ADODB.Recordset")	
if Request.QueryString ("ip") <>"" Then
Sql="Select * from FreeHost.FreeHost_IDCIP where ip like '%"&Trim(Request.QueryString ("ip"))&"%'"
'response.write sql
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsIP.Open Sql,conn,1,1
if dsIP.Eof then
	ef=True
	ec="没有此IDC产品！"
end If
end if
end If

if not ef Then
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_IDC where username='"&Request.QueryString ("username")&"'"
if Request.QueryString ("id") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_IDC where id='"&Request.QueryString ("id")&"'"
if Request.QueryString ("ip") <>"" Then 	Sql="Select * from FreeHost.FreeHost_Product_IDC where id in (Select PDID from FreeHost.FreeHost_IDCIP where ip like '%"&Trim(Request.QueryString ("ip"))&"%')"
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="没有此IDC产品！"
end if
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="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"><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"  onClick="table1.style.display='none';table2.style.display='none';table3.style.display='';" id="tableTop2" style="Cursor:hand"><font color="#FFFFFF"><a href="admidcrepair.asp"><font color="#FFFFFF"><strong>维护记录</strong></font></a><br>
            </font> </td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></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="80" align="center" valign="middle" background="img/r3.jpg" id="tableTop3" style="Cursor:hand"><a href="allsearch.asp"></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></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"> 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></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">代理名：</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("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")%></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="handIDC2.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 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="11%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">机　柜</font></td>
    <td width="11%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">IP 地址</font></td>
    <td width="10%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">用户备注</font></td>
    <td width="12%" height="24" 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="11%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">开通日期</font></td>
    <td width="11%" 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%>
  <tr align="center" bgcolor="#E4EAF2">
    <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%>></td>
    <td><%=dsph("IDCtype")%>
      <%
	IDCtype=dsph("IDCtype")
	Set ori_IDC_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_IDCProductlist where IDCtype='"&dsph("IDCtype")&"'"
		ori_IDC_name.Open Sql,conn,1,1
		if not ori_IDC_name.eof then	  
	  if ori_IDC_name("istg")=true then%>
[托管]
<%else%>
[租用]
<%end if
	  end if
	  ori_IDC_name.close
	  %><br>
<%if not isnull(dsph("repaymoney")) then%><br>
此产品已设置了单独续费价格：<%=dsph("repaymoney")%>元/年
<%end if%></td>
    <td width="7%" height="30"><a href="searchuser.asp?username=<%=dsph("username")%>"><%=dsph("username")%></a>
      <%if not isnull(dsph("kefu")) then%>
      <br>
      <a href="admkefu.asp?kefu=<%=dsph("kefu")%>">(<font color="#0000FF"><%=dsph("kefu")%>)</font></a>
      <%end if%></td>
    <td width="11%"><%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_IDCJG where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
If Not dsserver.eof then
%>
        <%=dsserver("jgname")%>
        <%dsserver.close%><%else%>这个机柜被删除了!<%End if%></td>
    <td width="11%"><%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_IDCIP where PDID="&dsph("id")
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
IP尚未分配
  <%else
while not dsX.eof
%>
  <%=dsX("IP")%> <br>
  <%
dsX.movenext
wend
end if%>
  <br>
  <a href="admidcrepair.asp?repairid=<%=dsph("id")%>">维护记录</a></td>
    <td><%=dsph("userremindinfo")%></td>
    <td width="12%" bgcolor="#E4EAF2"><%=dsph("openinfo")%> </td>
    <td><%=dsph("admremindinfo")%></td>
    <td width="11%"><%=dsph("starttime")%></td>
    <td width="11%"><%=dsph("endtime")%><br>
      <a href="moneyalllist.asp?op=search&selecttype=全部&usertype=用户或代理名&whichProduct=IDC产品&pdid=<%=dsph("id")%>" target="_blank">此产品财务信息</a></td>
    <td width="7%"><%if dsph("endtime")>NOW then%>
      <%if dsph("istest")="y" then%>
      <font color="#FF0000">试用</font><%else%>
      <%=dsph("status")%>
      <%end if%>
      <%else%>
      <font color="#FF0000">过期</font>
      <%if dsph("status")="暂停" then%>
      <br>
      <font color="#FF0000">暂停</font>
      <%end if%>
      <%end if%></td>
     </tr>

<%
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>单独设置<br>
    它的续费价格</td>
    <td height="30" align="left">　
        <input name="repaymoney" type="text" id="repaymoney" size="4" maxlength="6">
    元/年
    <input type="submit" name="Submit" value="单独设置续费价格"> 　
    <input type="submit" name="Submit" value="取消单独续费价格"> 
    </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="30" align="left">　
      <input type="submit" name="Submit" value="修改">
　　　　　　　　　　　　　　　　　　　　　　　
<input type="button" name="Submit" value="删除"  onclick="JavaScript:if(confirm('确定删除吗？')){document.form1.dodel.value = '删除';this.disabled=true;this.value='请您稍等，正在删除中....';document.form1.submit();}">
<input type="hidden" name="dodel" value="">
(删除是不可恢复的删除)
<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>
<br>
<DIV class="tableborder">
<%If Request.QueryString("repairid")<>"" And IsNumeric(Request.QueryString("repairid"))  Then
	Set dsrepair = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_IDC_repair where id='"&Request.QueryString ("repairid")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsrepair.Open Sql,conn,1,1
If not dsrepair.eof Then
username=dsrepair("username")
repairid=dsrepair("ID")
idctitle=dsrepair("idctitle")
idctype=dsrepair("idctype")
status=dsrepair("status")
moreinfo=dsrepair("moreinfo")
opusername=dsrepair("opusername")
end If
dsrepair.close
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维护记录</font></td>
    </tr>
    <tr bgcolor="#E4EAF2">
      <td width="24%" align="right">&nbsp;</td>
      <td width="76%" align="left">　标题：
          <input name="idctitle" type="text" id="idctitle" value="<%=idctitle%>" size="44" maxlength="100">
          <input name="repairid" type="hidden" id="repairid" value="<%=repairid%>">
          <%if scon<>"" then type1= typeid
	  %>
          <br>
      　分类：
      <select name="idctype" id="idctype">
        <option value="服务器重启" <%if idctype="服务器重启" then%>selected<%end if%>>服务器重启</option>
        <option value="重装操作系统" <%if idctype="重装操作系统" then%>selected<%end if%>>重装操作系统</option>
        <option value="服务器软件设置" <%if idctype="服务器软件设置" then%>selected<%end if%>>服务器软件设置</option>
        <option value="服务器安全检查" <%if idctype="服务器安全检查" then%>selected<%end if%>>服务器安全检查</option>
        <option value="服务器其他类" <%if idctype="服务器其他类" then%>selected<%end if%>>服务器其他类</option>
        <option value="网络维护" <%if idctype="网络维护" then%>selected<%end if%>>网络维护</option>
        <option value="攻击类维护" <%if idctype="攻击类维护" then%>selected<%end if%>>攻击类维护</option>
        <option value="交换机维护" <%if idctype="交换机维护" then%>selected<%end if%>>交换机维护</option>
        <option value="路由器维护" <%if idctype="路由器维护" then%>selected<%end if%>>路由器维护</option>
      </select>
      <br>
      　进度：
      <select name="status" id="status">
        <option value="等待处理" <%if status="等待处理" then%>selected<%end if%>>等待处理</option>
        <option value="处理中" <%if status="处理中" then%>selected<%end if%>>处理中</option>
        <option value="联络用户中"  <%if status="联络用户中" then%>selected<%end if%>>联络用户中</option>
        <option value="处理完成" <%if status="处理完成" then%>selected<%end if%>>处理完成</option>
      </select>      <br>
      　维护的工作人员姓名：
      <input name="opusername" type="text" id="opusername" value="<%=opusername%>" size="31" maxlength="44">
      <br>
　内容：
      <textarea name="moreinfo" cols="50" rows="10" id="con" style="font-size: 9pt;" ><%=moreinfo%></textarea>
      </td>
    </tr>
    <tr bgcolor="#E4EAF2">
      <td colspan="2" align="center"><input type="submit" name="Submit" value="<%if Request("repairid")="" then%>提交<%else%>修改<%end if%>">
</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%>
