<!--#include virtual="/incs/config.asp" -->
<!--#include virtual="/incs/top.asp" -->
<%
chk_log()
chk_newpwr 1,2,1

	sqnme=SafeRequest("sqnme")
	If sqnme="" Then
	call errorpage(-2,"对不起，参数错误！")
	End If
if session("sysclass")>=5 then
query="select * from v_sqllst   where sq_nme ='"&sqnme&"'"
elseif session("sysclass")>=4 then
query="select * from v_sqllst  where sq_nme ='"&sqnme&"'  and  ((("&session("sysarestr")&" or u_myare=0) and u_rotnme='') or u_rotnme='"&session("usrname")&"')"
else
query="select * from v_sqllst   where sq_nme ='"&sqnme&"' sq_unme='"&session("usrname")&"'"
end if
	conn.open constr

	rs.open query,conn,1,1
    if rs.recordcount<>1 then
	rs.close
	conn.close
	call errorpage(-2,"对不起，该订单不存在或者不属于您的会员号，管理员请先切换到该订单会员！")
	response.end
	end if
	sq_svrip=rs("sq_svrip")
	sq_prd=rs("sq_prd")
	g_tag=trim(rs("g_tag"))
	g_pdtcls=rs("g_pdtcls")
    dbname=trim(rs("sq_nme"))
	sq_prcstr=(rs("sq_prcstr"))
	g_nme=trim(rs("g_nme"))
		query="select * from memlst where u_nme='"&rs("sq_unme")&"'"
rs1.open query,conn,1,1
if not rs1.eof then
ownerclass=rs1("u_prc")
owneruser=rs("sq_unme")
ownerpass=rs1("u_pss")
end if
rs1.close

	query="select * from v_prclst where p_prcstr='"&sq_prcstr &"' and g_prd='"&sq_prd &"'  and p_cls="&ownerclass
	rs1.open query,conn,1,1
	if rs1.eof then
	rs1.close
	query="select * from v_prclst where  g_prd='"&sq_prd &"'  and p_cls="&ownerclass
	rs1.open query,conn,1,1
	end if
	if rs1.eof then
	call errorpage(-2,"对不起，系统价格定义错误！")
	else
	oldprc=rs1("p_prc")
	oldsze=rs1("g_sze")
	g_tag=rs1("g_tag")
	oldclsnme=rs1("pc_nme")
	 g_sst=rs("sq_sst")
	 sq_yar=rs1("p_yar")
	 p_tmetpe=rs1("p_tmetpe")
	end if
	rs1.close
%>
<%
                months=datediff("m",now(),cdate(rs("sq_exptme")))
				years=datediff("yyyy",now(),cdate(rs("sq_exptme")))
if years<=0 then
years=1
end if
if months<=0 then
months=1
end if
		%>
<table cellspacing=2 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td  colspan=2 valign="middle"> 
      <table class=line cellspacing=0 cellpadding=0 width="100%" 
                  border=0 align="center">
        <tbody> 
        <tr> 
          <td valign=bottom width="25%" height=20><b>数据库列表</b><a class=commonface href="index.asp"><font color="#FF0000">（查询）</font></a></td>
          <td valign=bottom noWrap align=right 
                        width="75%"><a class=commonface  href="sql_lst.asp?querytype=8">今天新开通</a> 
            | <a  class=commonface href="sql_lst.asp?querytype=9">本周新开通</a> | 
            <a class=commonface  href="sql_lst.asp?querytype=10">本周到期</a> | <a  class=commonface href="sql_lst.asp?querytype=11">本月到期</a></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=5></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=2 class=menuline></td>
        </tr>
        </tbody> 
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <td  colspan=2 valign="middle" height="28"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td> 
            <!--#include file="menu.asp"-->
          </td>
        </tr>
      </table>
      <br>
      <table cellPadding="0" cellSpacing="0" id="AutoNumber3" style="border-collapse: collapse" width="100%" align="center" border="0">
        <tr> 
          <td height="4" width="99%" valign="top"  > 
            <table cellpadding="0" cellspacing="0" id="AutoNumber3" style="border-collapse: collapse" width="100%" height="118" border="0">
              <tr> 
                <td height="14" width="100%" valign="top"> 
                  <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class=datalist>
                    <tr align="middle"> 
                      <th class=datalistheader colspan=3 height="22"> 
                        <div align="center"><b>数据库型号升级</b></div>
                      </th>
                    </tr>
                    <form action="sql_upd_rez.asp" method =post name= f_sq_prdchg>
                      <%if trim(owneruser)<>trim(entryuser) then %>
                      <tr > 
                        <td height="28" class=datalistgrida  align=center>注意事项: 
                        </td>
                        <td height="28" class=datalistgrida colspan=2>该产品所属会员为：<b><%=owneruser%></b>，升级将扣除会员 
                          <b><%=owneruser%></b> 的款项！ </td>
                      </tr>
                      <%end if %>
                      <tr> 
                        <td height="35" class=datalistgrida  width="22%"> 
                          <div align="center">当前数据库类型：</div>
                        </td>
                        <td colspan="2"  class=datalistgrida > 
                          <input type="radio" name="oldh_prd" value="radiobutton" disabled=1 checked>
                          <%=g_nme%>(<%=h_prd%>.<%=oldclsnme%>)</td>
                      </tr>
                      <tr> 
                        <td  class=datalistgrida > 
                          <div align="center">可选升级类型：</div>
                        </td>
                        <td colspan="2" class=datalistgrida  style="line-height:150%" > 
                          <% 
				i=1
				query="select * from v_prclst where p_cls="&ownerclass&" and g_tag='"&g_tag&"' and (g_sze >= "&oldsze&" )and p_yar="&sq_yar&" and p_prc> "&oldprc &" and   g_sst="&g_sst&" and g_shw=1 and p_tmetpe="&p_tmetpe&" order by p_prc"
				
				rs1.open query,conn,1,1
							  				if rs1.eof then
				response.write "<font color=#ff0000>对不起，当前没有可升级产品！</font>"
				end if
			while not rs1.eof	
		  				newprc = get_cst(p_tmetpe, 5, 1, 1, clng(rs1("p_prc"))/clng(rs1("p_yar")))
   %>
                          <input type=hidden name="newprdprc<%=rs1("g_prd")%>" value="<%=newprc%>">
                          <input type="radio" name="newprd" value="<%=rs1("g_prd")%>" onclick="javascript:document.f_sq_prdchg.p_prohg.value=Math.round((document.f_sq_prdchg.newprdprc<%=rs1("g_prd")%>.value-<%=oldprc%>)*<%=months%>/12);">
                          <%=rs1("g_nme")%>（<%=rs1("g_prd")%>.<%=rs1("pc_nme")%>） 
                          <br>
                          <% 
			
				 rs1.movenext
				 wend
				rs1.close
				 %>
                        </td>
                      </tr>
                      <tr> 
                        <td  class=datalistgrida  height="35" align="center"> 
                          需要支付的费用：</td>
                        <td  class=datalistgrida  height="22"> 
                          <input class="input" name="p_prohg" size="10" maxlength="50" value=""  disabled=1>
                          元人民币 </td>
                        <td  class=datalistgrida  width="20%"> 
                          <input name="Clear2" type="button" value="升 级"  class=btxx onClick="javascript:confirm_h_prdchg();">
                          <input type=hidden name="dbname" value="<%=dbname%>" >
                          <input type=hidden name=module value="prd">
                        </td>
                      </tr>
                      <tr > 
                        <td   a class=datalistgrida align="center" >特殊价格：</td>
                        <td  class=datalistgrida align="left" colspan=2 > 
                          <input type="text" name="newprice" class=normalform   size="28">
                          元 (如果特殊价格不为空，则所扣金额以特殊价格为准；特别注意：如果特殊价格填写为0，则扣款时将扣0元) 
                        </td>
                      </tr>
                    </form>
                    <tr> 
                      <td height="22" class=datalistgrida  >&nbsp;</td>
                      <td colspan="2" class=datalistgrida  style="line-height:150%" ><br>
                        数据库型号升级的付费算法：M = ( P2 - P1 ) * (总月数 - 已使用月数) / 12<br>
                        P2：是指升级后的型号的年价。<br>
                        P1：是指升级前的型号的年价。<br>
                        <br>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <%
rs.close
conn.close
%>
          </td>
        </tr>
        <tr> 
          <td height="4" width="99%" valign="top"  >&nbsp;</td>
        </tr>
      </table>
      <br>
      <br>
      <script language="javascript">
function confirm_h_prdchg()
{
if(confirm("如果确认升级数据库型号，系统将自动扣除您的款项，是否确认此升级操作？"))
document.f_sq_prdchg.submit();
}

</script>
      <br>
    </td>
  </tr>
  </tbody> 
</table>
<!--#include virtual="/incs/bottom.asp"-->


