<!--#include virtual="/incs/config.asp" -->
<!--#include virtual="/incs/web_top.asp" -->
<%
chk_log_usr()
	sqnme=SafeRequest("sqnme")
	If  sqnme="" Then
	call errorpage(-2,"对不起，参数错误！")
	End If
	query="select * from v_sqllst where sq_unme='"&session("usrname")&"'  and sq_nme ='"&sqnme&"'"
	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 v_prclst where p_prcstr='"&sq_prcstr &"' and g_prd='"&sq_prd &"'  and p_cls="&session("usrclass")
	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="&session("usrclass")
	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=0 cellpadding=0 width="100%" border=0>
        <tbody> 
        <tr> 
          <td colspan=2><img height=3 
            src="/imgs/spacer.gif" width=3></td>
        </tr>
        <tr> 
          
          <td width=438 
          background=/imgs/bg_inside_pages_link.jpg 
          height=30><img height=11 
            src="/imgs/aword_square.gif" width=11 
            align=absMiddle> <a href="/">首 页</a> <strong>&gt;</strong> <a href="/control/">管理中心</a> 
            <b>&gt;</b> <a href="/control/sql_mng/sql_lst.asp">数据库管理</a></td>
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td colspan=2><img height=10 
            src="/imgs/shadow_inside_pages.jpg" 
        width=438></td>
        </tr>
        </tbody> 
      </table>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY> 
        <TR> 
          <TD vAlign=top width=180 bgColor=#f3f3f3> 
            <!--#include virtual="/incs/control_left.asp"-->
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
          </TD>
          <TD vAlign=top width=10 
          background=/imgs/bg_inside_pages_block.jpg><IMG 
            height=1 src="/imgs/bg_inside_pages_block.jpg" 
            width=10></TD>
          <TD vAlign=top> 
            <table cellspacing=2 cellpadding=0 width="100%" border=0>
              <tbody> 
              <tr> 
                <td  colspan=2 valign="middle"> 
                  <table class=line cellspacing=0 cellpadding=0 width="98%" 
                  border=0 align="center">
                    <tbody> 
                    <tr> 
                      <td valign=bottom width="25%" height=20><font color="#000000" class=ddropshadow><b><span class=enbold><strong>数据库<font color="#000000">列表<a href="index.asp"><font color="#FF0000">（查询）</font></a></font></strong></span></b></font></td>
                      <td valign=bottom noWrap align=right 
                        width="75%"><a href="sql_lst.asp?querytype=8"><font color="#000000">今天新开通</font></a> 
                        <font color="#000000">|</font> <a href="sql_lst.asp?querytype=9"><font color="#000000">本周新开通</font></a> 
                        <font color="#000000">|</font> <a href="sql_lst.asp?querytype=10"><font color="#000000">本周到期</font></a> 
                        <font color="#000000">| </font><a href="sql_lst.asp?querytype=11"><font color="#000000">本月到期</font></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 bgcolor="#5F5F5F"></td>
                    </tr>
                    </tbody> 
                  </table>
                  <br>
                </td>
              </tr>
              <tr> 
                <td  colspan=2 valign="middle" height="28"> 
                  <table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
                    <tr> 
                      <td> 
                        <!--#include file="menu.asp"-->
                      </td>
                    </tr>
                  </table>
                  <br>
                  <table   borderColor="#FFFFFF" cellPadding="0" cellSpacing="0" id="AutoNumber3" style="border-collapse: collapse" width="95%" height="218" align="center">
  <tr> 
    <td height="4" width="99%" valign="top" bgcolor="#FFFFFF" > 
      <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  cellpadding="0" cellspacing="0" >
              <tr> 
                <td height=1></td>
              </tr>
            </table>
                              <table align="center" border="0" cellpadding="4" cellspacing="1" width="100%" bordercolordark="#FFFFFF" bgcolor="#666666">
                                <tr align="middle"> 
                                  <td colspan=3 height="22" bgcolor="#8b8b8b"> 
                                    <div align="center"><b><font color="#FFFFFF">数据库升级</font></b> 
                                    </div>
                                  </td>
                                </tr>
                               
                                <form action="sql_upd_rez.asp" method =post name= f_sq_prdchg>
                                  <tr bgcolor="#FFFFFF"> 
                                    <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 bgcolor="#FFFFFF"> 
                                    <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="&session("usrclass")&" 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=(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 bgcolor="#FFFFFF"> 
                                    <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>
                                </form>
                                <tr bgcolor="#FFFFFF"> 
                                  <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>
      
    </td>
  </tr>
  <tr> 
    <td height="4" width="99%" valign="top" bgcolor="#FFFFFF" >&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>
          </TD>
        </TR>
        </TBODY> 
      </TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY> 
        <TR> 
          <TD bgColor=#cccccc><IMG height=1 
            src="/imgs/spacer.gif" 
      width=1></TD>
        </TR>
        </TBODY> 
      </TABLE>
      <!--#include virtual="/incs/web_bottom.asp"-->

