<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%server.ScriptTimeout =240
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmOther")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf Request.Form ("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf Instr(1, Request.Form ("id"), "'", 1)>0 then
	ef=True
	ec="产品ID有非法字符！"
ElseIf Request.Form ("username")="" Then
	ef=True
	ec="请输入用户名！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request.Form ("username")) 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 dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Other where id='"&Request.Form ("id")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"

Response.End

end if
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="不存在的其他产品ID！"
end if
end if

if not ef then
	Set dspdl = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_OtherProductlist where Othertype='"&dsph ("Othertype")&"'"
		dspdl.Open Sql,conn,1,1
If dspdl.Eof Then
	ef=True
	ec="不存在的其他产品类型！"
end if
end if

if not ef then
If Request.Form ("newusername")<>"" then
	Set dsNew = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&Request.Form ("newusername")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsNew.Open Sql,conn,1,1
if dsNew.eof then
	ef=True
	ec="要转移的用户不存在!"
end if
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 align="left"><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="admother.asp"><font color="#FFFFFF"><strong>其他类管理</strong></font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></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="65%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
	
	
	<br><DIV class="tableborder">	  
<%if Request.Form ("dodel")="删除" then%>


<%
ret="删除成功"
FreeHost_clientlog conn,dsph ("username"),session("admusername"),"超级管理员操作","其他产品",dsph ("id"),"删除","","",ret
dsph.delete
dsph.close
response.write ret%>

<%end if

if Request.Form ("Submit")="单独设置续费价格" and Request.Form ("repaymoney")<>"" then
if IsNumeric(Request.Form ("repaymoney")) and Request.Form ("repaymoney")>0 then
dsph ("repaymoney")=Request.Form ("repaymoney")
dsph.update
Response.Write "此产品的续费价格已单独更新为："&Request.Form ("repaymoney")&"元"
else
Response.Write "请输入大于0的价格。"
end if 
end If

if Request.Form ("Submit")="取消单独价格" then
dsph ("repaymoney")=null
dsph.update
Response.Write "此产品的续费价格已恢复为默认价格"
end if


if Request.Form ("Submit")="马上转移" then

FreeHost_oplog session("admusername"),"信息","管理员转移"&dsph ("username")&"其他类产品ID("&dsph ("id")&") 给"&Request.Form ("newusername")

dsph("username")=Request.Form ("newusername")
response.write "此产品已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
dsph("agent1")=dsNEW("agent1")
if dsph("agent1")<>"n" then
response.write "此产品已转移到代理："&dsph("agent1")&" 名下。<br>"
end if
dsph.update
dsph.close
end if

%>	  
	</div>

	
	
	</td>
  </tr>
</table>
	  <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> </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>

      <br>
      <%


if Request.Form ("Submit")="修改" then
		%>
		<DIV class="tableborder">
<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center">
  <tr bgcolor="#C1BFBF" align="center">
    <td width="8%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">编号</font></td>
    <td 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="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>
  <tr align="center" bgcolor="#E4EAF2">
    <td width="8%"><%=dsph("id")%></td>
    <td><%=dsph("Othertype")%><br>
      此类型产品金额：<%=dspdl("usermoney")%>元<br>
<%if not isnull(dsph("repaymoney")) then%><br>
此产品已设置了单独续费价格：<%=dsph("repaymoney")%>元/年
<%end if%></td>
    <td height="30"><a href="searchuser.asp?username=<%=dsph("username")%>"><%=dsph("username")%></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")%></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>
</table>
		</div>


		
		
        <br>

<form name="form4" method="post" action="handOther3.asp">
<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">
      修改订单</font></td>
    </tr>
  <tr align="center" bgcolor="#E4EAF2">
    <td>详细管理</td>
    <td height="30" align="left"><%if not isnull(dsph("repaymoney")) then%>
<font color="red">此产品已设置了单独续费价格：<%=dsph("repaymoney")%>元/年</font>
<%end if%>　
      <%if dspdl("canshowyear")<>"y" then%>
      <input type="hidden" name="year" value="1">
      <%else%>
      <br>
      <br>
      <p> 　手工指定开通时间：
          <input type="text" name="starttime" size="18"  value="<%=dsph("starttime")%>">
  2005-7-24<br>
  　手工指定到期时间：
  <input type="text" name="endtime" size="18"  value="<%=dsph("endtime")%>">
  2005-7-24<br>
  <br>
  <%end if%>
      </p>
      　 
      <font color="#FF0000">从用户金额中扣除</font> 价格：
      <input name="usermoney" type="text" id="usermoney" size="8">
元<br>
<br>
　 订单状态：
<select name="status" id="status">
  <option value="等待处理" <%if dsph("status")="等待处理" then%>selected<%end if%>>等待处理</option>
  <option value="正常"  <%if dsph("status")="正常" then%>selected<%end if%>>正常</option>
  <option value="暂停" <%if dsph("status")="暂停" then%>selected<%end if%>>暂停</option>
  <option value="过期" <%if dsph("status")="过期" then%>selected<%end if%>>过期</option>
</select>
<br>
<br>
　修改用户备注：
<textarea name="userremindinfo" cols="50" id="host1"><%=dsph("userremindinfo")%></textarea>
<br>
　修改订单处理信息：
<textarea name="openinfo" cols="50" id="host1"><%=dsph("openinfo")%></textarea>
<br>
　内部记录：
<input name="admremindinfo" type="text" id="admremindinfo" size="70" maxlength="200" value="<%=dsph("admremindinfo")%>">
<input name="id" type="hidden" value="<%=Request.Form ("id")%>">
<input name="username" type="hidden" value="<%=ds("username")%>">
<br>
　
<input type="submit" name="Submit" value="提交">
</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>
<%end if%>


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