<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("username")="" Then
If Application("canuseorder")=true and Request.ServerVariables("HTTP_FreeHostAPI")<>"7i24.com" Then Response.Redirect "order.asp?type=其他产品&id="&Request.QueryString ("id")
	ef=True
	ec="请您先登陆会员区。"
ElseIf Request.QueryString ("id")="" Then
	ef=True
	ec="请选择产品！"
ElseIf Instr(1, Request.QueryString ("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
ElseIf not IsNumeric(Request.QueryString ("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")

agentname=session("agentname")
if session("AgnRunasUser")=True then 
	Set dsagent = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent where username='"&agentname&"'"
		dsagent.Open Sql,conn,1,1
if Not dsagent.eof then
Set dsagnettype = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Agent_pers where agenttype='"&dsagent("agenttype")&"'" 
		dsagnettype.Open Sql,conn,1,1
if Not dsagnettype.eof Then
canshowagnpric=True
Else
canshowagnpric=false
End if
end If
dsagent.close
end If

	Set dsOtherpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_OtherProductlist where id='"&Request.QueryString ("id")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsOtherpdlist.Open Sql,conn,1,1
if dsOtherpdlist.Eof then
	ef=True
	ec="产品不存在！"
else
   if dsOtherpdlist("isbyhost")="y" then
   	ef=True
	ec="赠送的只能自动开通！"
   end If
'读取月付
PAY_Month=dsOtherpdlist("PAY_Month")
PAY_Season=dsOtherpdlist("PAY_Season")
PAY_halfyear=dsOtherpdlist("PAY_halfyear")
PAY_Nextyear=dsOtherpdlist("PAY_Nextyear")
PAY_2year=dsOtherpdlist("PAY_2year")
PAY_3year=dsOtherpdlist("PAY_3year")
PAY_4year=dsOtherpdlist("PAY_4year")
PAY_5year=dsOtherpdlist("PAY_5year")   
end if
end if
if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>
　其他类开通
<%=htmlwrite("html3")%>
<br>
<form action="selfOther2.asp" method="post" name="form1">
  <TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
    <TBODY>
      <TR>
        <TD width="17%" vAlign=middle bgColor=#9E9E9E>&nbsp; <font color="#FFFFFF">开通其他类：</font></TD>
        <TD height="40" colspan="2" bgColor=#ffffff><%
	info=dsOtherpdlist("info")
	Othertype=dsOtherpdlist("Othertype")
	remindinfo=dsOtherpdlist("remindinfo")
if agentname<>"n" then 
	Set newname_Other = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_OtherProductlist_AGN where agent1='"&agentname&"' and id='"&dsOtherpdlist("id")&"'"
		newname_Other.Open Sql,conn,1,1
if not newname_Other.eof then
info=newname_Other("info")
Othertype=newname_Other("Othertype")
remindinfo=newname_Other("remindinfo")
newname_Other.close
end if
end If
%>　<a href="/style/info/othermore.asp?id=<%=Request.QueryString ("id")%>" target="_blank"><strong><font size="3"><%=Othertype%></font></strong></a></TD>
      </TR>
      <TR>
        <TD width="17%" rowspan="5" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      </TR>
<%if dsOtherpdlist("canshowyear")<>"y" then%>
<input type="hidden" name="year" value="1">
<%else%>
      <TR>
        <TD width="18%" height="50" bgColor=#ffffff><font color="#000000">　有效期限：</font></TD>
        <TD width="65%" height="50" bgColor=#ffffff><select name="year"onChange="chusrm(this.options[this.options.selectedIndex].value)">
<option value="0" selected>请您选择</option>		
          <%if dsOtherpdlist("cantest")="y" then%>
          <option value="999">试用<%=Application("testtime")%>天</option>
          <%end if%>
          <%if dsOtherpdlist("canmonth")="y" then%>
          <option value="<%=PAY_Month%>">一个月</option>
          <%end if%>
<%if dsOtherpdlist("canseason")="y" then%>
		<option value="<%=PAY_Season%>">三个月</option>
<%end if%>
<%if dsOtherpdlist("canhalfyear")="y" then%>
        <option value="<%=PAY_halfyear%>">半年</option>
<%end if%>
          <option value="1">一年</option>
<option value="<%=PAY_2year%>">两年</option>
<option value="<%=PAY_3year%>">三年</option>
<option value="<%=PAY_4year%>">四年</option>
<option value="<%=PAY_5year%>">五年</option>
        </select>
          
		  

          <%
usermoney=dsOtherpdlist("usermoney")
if agentname<>"n" then
	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='其他产品' and username='"&agentname&"' and id="&dsOtherpdlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if not dsendmoney.eof then
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
end if
if canshowagnpric then%>　　<font color=red>(代理成本价格
<%
	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and username='"&agentname&"' and id="&dsOtherpdlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
usermoney=dsOtherpdlist("usermoney")*dsagnettype("pers")
else
usermoney=dsagnpri("usermoney")
end if
dsagnpri.close
%>)</font><%End if%>

        <input name="moneynow" type="text" value="" size="7" readonly="true" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" ></TD>
      </TR>
<%end if%>

      <TR>
        <TD height="100" bgColor=#ffffff>　开通说明：</TD>
        <TD height="100" bgColor=#ffffff><%=remindinfo%></TD>
      </TR>
      <TR>
        <TD height="103" bgColor=#ffffff>　请输入备注：</TD>
        <TD height="103" bgColor=#ffffff><textarea name="userremindinfo" cols="40" rows="5" id="userremindinfo"></textarea></TD>
      </TR>
      <TR>
        <TD height="50" colspan="2" bgColor=#ffffff>　
        <input name="Submit" type="submit" id="Submit" value="马上下订单">
<input type="hidden" name="id" value="<%=Request.QueryString ("id")%>">		
		</TD>
      </TR>
    </TBODY>
  </TABLE>
</form>
<script language="JavaScript" type="text/JavaScript">
function chusrm(s)
{
	document.all.moneynow.value=Math.round((s*<%=usermoney%>)*100)/100+' 元';
	if (s==999)
	document.all.moneynow.value='0'+' 元';
}
</script>
<%=htmlwrite("html4")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
