<!-- #include file="include/con_music.asp" -->
<!-- #include file="include/con_music_other.asp" -->
<%
tit_fir="音乐频道"
tit="音乐充值"

call web_head(2,0,0,0,0)
%>
<TABLE width=770 border=0 align="center" cellPadding=0 cellSpacing=0 
background="image/music/j7.gif">
  <TBODY>
    <TR> 
      <TD width=58 height=38><IMG height=38 
      src="image/music/j8.gif" width=107 border=0> 
      <TD vAlign=center align=middle width=672> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD vAlign=center align=middle width="100%"> 
                <%
			  call music_head()
			  %>
              </td>
            </tr>
          </TBODY>
        </TABLE>
      <TD width=10 height=38> <P align=right><IMG height=38 src="image/music/j9.gif" 
      width=6 border=0></P></TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=770 align=center border=0>
  <TBODY>
    <TR> 
      <TD width=176 vAlign=top bgcolor="#eef7fd"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD> </TD>
            </TR>
            <TR> 
              <TD bgColor=#eef7fd><IMG height=52 
            src=image/music/left02.jpg width=176 
            border=0> <TABLE  cellSpacing=4 cellPadding=0 width="86%" 
            align=center bgColor=EEF7FD border=0>
                  <TBODY>
                    <TR> 
                      <TD> 
                        <%
					  call music_sea( )
					  %>
                      </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
            <TR> 
              <TD bgColor=#eef7fd><IMG height=52 
            src=image/music/left06.jpg width=176 
            border=0><BR> <TABLE height=134 cellSpacing=4 cellPadding=0 width="86%" 
            align=center bgColor=EEF7FD border=0>
                  <TBODY>
                    <TR> 
                      <TD height=76> <DIV align=center><IMG class=imgb height=60 
                  src="image/music/foto.gif" width=140 
                  border=0></DIV></TD>
                    </TR>
                    <TR> 
                      <TD height=46> 
                        <%
					  call music_top(10,10)
					  %>
                      </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
            <TR> 
              <TD><IMG height=57 src="image/music/left03.jpg" 
            width=176 border=0></TD>
            </TR>
            <TR> 
              <TD> <TABLE cellSpacing=0 cellPadding=0 width=173 bgColor=#eef7fd 
            border=0>
                  <TBODY>
                    <TR> 
                      <TD> <TABLE height=117 cellSpacing=4 cellPadding=0 width="87%" 
                  align=center bgColor=EEF7FD border=0>
                          <TBODY>
                            <TR> 
                              <TD height="66" valign="top"><div align="center"><IMG class=imgb height=60 
                        src="image/music/newcd.jpg" 
                        width=140></div></TD>
                            </TR>
                            <TR> 
                              <TD> 
                                <%
					  call disk_top(10,10)
					  %>
                              </TD>
                            </TR>
                          </TBODY>
                        </TABLE></TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE></TD>
      <TD vAlign=top bgcolor="A0CAED"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD bgColor=#ffffff height=5></TD>
            </TR>
          </TBODY>
        </TABLE>
        <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff 
        border=0>
          <TBODY>
            <tr> 
              <TD width=593><div align="right"><IMG src="image/music/m17.gif" width=593 height=37 border=0></div></TD>
            </tr>
            <TR> 
              <TD> <TABLE width="593" border=0 align="right" cellPadding=0 cellSpacing=0>
                  <TBODY>
                    <TR> 
                      <TD 
                background="image/music/middlebg02.gif" 
                height=182> 
                        <%
	response.write vbcrlf&"<table cellspacing=1 cellpadding=4>"
call music_buy_main()
call music_remark()
response.write vbcrlf&"</table>"
   %>
                      </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE>
        <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD bgColor=A0CAED 
height=5></TD>
            </TR>
          </TBODY>
        </TABLE></TD>
    </TR>
  </TBODY>
</TABLE>
<%
set music_se=nothing
call web_end(0,0)

sub music_remark()
response.write vbcrlf&music_bar_top("center_buy_remark",1)
%>
<tr ><td align=center colspan=2>
  <table border=0>
  <tr><td><font class=red>1、针对免费用户</font></td></tr>
  <tr><td>管理员给予设定免费试听或下载所有歌曲！</td></tr>
  <tr><td height=5></td></tr>
  <tr><td><font class=red>2、针对注册用户</font></td></tr>
  <tr><td>试听或下载所有歌曲需扣取相应虚拟货币！</td></tr>
  <tr><td height=5></td></tr>
  <tr><td><font class=red>3、针对特定用户</font></td></tr>
  <tr><td><b>月卡</b>：支付虚拟货币购买月卡，所属 IP 一个月内免登陆即可免费试听或下载所有歌曲！<br>现在所需费用：<font class=red><%response.write music_dim(0)&" 个"&web_dim(9)%> / 每月</font></td></tr>
  <tr><td><b>季卡</b>：支付虚拟货币购买季卡，所属 IP 一个季度内免登陆即可免费试听或下载所有歌曲！<br>现在所需费用：<font class=red><%response.write music_dim(1)&" 个"&web_dim(9)%> / 每季</font></td></tr>
  <tr><td><b>年卡</b>：支付虚拟货币购买年卡，所属 IP 一年内免登陆即可免费试听或下载所有歌曲！<br>现在所需费用：<font class=red><%response.write music_dim(2)&" 个"&web_dim(9)%> / 每年</font></td></tr>
  <tr><td height=5></td></tr>
  <tr><td><font class=red>提醒：使用不固定 IP 登陆后同样可免费试听！</font></td></tr>
  </table>
<%
  response.write vbcrlf&music_bar_end()
end sub

sub music_buy_main()
  dim buytype,buytim,buyip,buyusername,lasttim,view_buytype
response.write vbcrlf&music_bar_top("center_buy_main",1)
%>
<tr><td align=center colspan=2 height=100>
<%
if music_se.free_ip or music_se.free_mode or music_se.free_username then
  response.write "<font class=red>您的IP或用户名已经被设定为免费试听，或者你是免费用户组成员，无需充值！</font>"
  response.write "</td></tr>"
  response.write "<tr><td height=5 colspan=2></td></tr>"
  exit sub
end if
  sql="select top 1 * from music_free where username='"&login_username&"' or userip='"&user_ip&"'"
  set rs=joekoe_cms.exec(sql,1)
  if rs.eof and rs.bof then
    rs.close
    call music_buy()
    exit sub
  end if
  buytype=int(rs("freetype"))
  buytim=rs("tim")
  buyip=rs("userip")
  buyusername=rs("username")
  rs.close
  view_buytype=music_se.buy_types(buytype)
  if music_se.fc_tim(buytim,buytype) then
    call joekoe_cms.exec("delete from music_free where username='"&login_username&"' or userip='"&user_ip&"'",0)
    call web_js_msg(1,view_buytype&" 已经到期！请重新购买！","music_buy.asp")
    exit sub
  end if
  lasttim=music_se.last_tim(buytim,buytype)
%>
<tr class=bg_td><td width='20%'>购买帐号：</td><td width='80%'>&nbsp;<%response.write buyusername%></td></tr>
<tr class=bg_td><td>购买地IP：</td><td>&nbsp;<%response.write buyip%></td></tr>
<tr class=bg_td><td>购买类型：</td><td>&nbsp;<%response.write view_buytype%></td></tr>
<tr class=bg_td><td>购买时间：</td><td>&nbsp;<font class=blue><%response.write joekoe_cms.time_type(buytim,1)%></font></td></tr>
<tr class=bg_td><td>到期时间：</td><td>&nbsp;<font class=red><%response.write joekoe_cms.time_type(lasttim,1)%></font></td></tr>
<tr><td height=9></td></tr>
<%
  response.write vbcrlf&music_bar_end()
end sub

sub music_buy()
  if joekoe_cms.chk() then
  dim emoney_1,buymoney,buytype,viewtype
  buytype=trim(request.form("types"))
  buytype=int(buytype)
  sql="select top 1 * from user_data where username='"&login_username&"' order by id"
  set rs=joekoe_cms.exec(sql,1)
  if rs.eof and rs.bof then
    rs.close
    call web_js_msg(1,"没有找您的注册帐号！","music_buy.asp")
    exit sub
  end if
  emoney_1=rs("emoney")
  rs.close
  buymoney=music_se.buy_money(buytype)
  if emoney_1<buymoney then
    call web_js_msg(1,"您的只有 "&emoney_1&"个"&web_dim(9)&"，不够支付费用！","music_buy.asp")
    exit sub
  end if
  emoney_1=emoney_1-buymoney
  viewtype=music_se.buy_types(buytype)
  call joekoe_cms.exec("update user_data set emoney="&emoney_1&" where username='"&login_username&"'",0)
  call joekoe_cms.exec("insert into music_free(username,userip,tim,freetype) values('"&login_username&"','"&user_ip&"','"&joekoe_cms.now_time&"',"&buytype&")",0)
  call web_js_msg(1,"您已经支付 "&viewtype&" 费用，"&buymoney&"个"&web_dim(9)&"！","music_buy.asp")
  end if
%>
<script language=javascript>
<!--
function buy_checkreturn()
{
  var ss=document.music_buy.types.value;
  var buytypes='月 卡';
  var num='<%response.write music_se.buy_money(1)%>';
  if (ss==2)
  {
      buytypes='季 卡';
      num='<%response.write music_se.buy_money(2)%>';

  }
  if (ss==3)
  {
      buytypes='年 卡';
      num='<%response.write music_se.buy_money(3)%>';
  } 
  return click_return('您确定要购买 '+buytypes+' 吗？\n\n您将支付 '+num+' 个虚拟币！\n\n点击确定进行购买……',1) 
}
-->
</script>
  <table border=0 cellspacing=1 cellpadding=0 width='100%'>
  <form name=music_buy action='?' method=post onsubmit="javascript:frmusic_submitonce(this);">
  <input type=hidden name=chk value='yes'>
  <tr height=20 class=bg_tds><td width='15%' align=center>登陆帐号：</td><td width='85%'>&nbsp;<input type=text name=username value='<%response.write login_username%>' size=15 maxlength=20 readonly style="text-align: center;cursor: hand;"></td></tr>
  <tr height=20 class=bg_tds><td align=center>登陆 I P：</td><td>&nbsp;<%response.write user_ip%></td></tr>
  <tr height=20 class=bg_tds><td align=center>绑定 I P：</td><td>&nbsp;<input type=checkbox name=userip value='yes' class=bg_tds>&nbsp;<font class=red2>选择绑定后该 IP 所有用户都将可免登陆收听歌曲</font></td></tr>
  <tr height=20 class=bg_tds><td align=center>购买期限：</td><td>&nbsp;<select name=types size=1><option value=1>月卡</option><option value=2>季卡</option><option value=3>年卡</option></select></td></tr>
  <tr height=20 class=bg_tds align=center><td colspan=2>&nbsp;<input type=submit value='音乐充值' onclick="javascript:return buy_checkreturn();"></td></tr>
  </form>
  </table>
</td><tr>
<tr><td height=5 colspan=2></td></tr>
<%
end sub
%>