<?php
if(empty($op)) $op='cz';
?>
  <!--- content -->
  <div class="neir">
    <div class="top">在线充值</div>
      <div class="content">
		<div class="main_nav">
			<ul>
				<li class="<?php if($op=='cz'){ echo 'nava_4';}else{ echo 'navb_5';}?>"><a href="?ac=pay&op=cz">充值金币</a></li>
				<li class="<?php if($op=='vip'){ echo 'nava_4';}else{ echo 'navb_5';}?>"><a href="?ac=pay&op=vip">升级VIP</a></li>
				<li class="<?php if($op=='jl'){ echo 'nava_4';}else{ echo 'navb_5';}?>"><a href="?ac=pay&op=jl">充值记录</a></li>
			</ul>
		</div>
<?php if($op=='cz'){ ?>
<script language="javascript">
$(document).ready(function(){
	$("#paygo").click(function(){
	var CS_RMB=$("#CS_RMB").val();
	if(CS_RMB==''){
		$("#CS_RMB").css("border","1px solid red");
                alert("请先填写充值数量！");
		return false;
	}else{
               alert('温馨提示：\n\t在网上支付过程中，请不要中途关闭页面，以免交易失败！');
	       return true;
        }
	});
});
</script>
	             <form action="pay.php" method="post">
				<div class="pay1">
					<div class="reg">
						<h2>金币充值</h2>
						<div class="kj">
						<table class="reg_info">
							<tr>
								<th><font color=red>*</font>我要充值：</th>
							  <td class="tdw"><input type="text" name="CS_RMB" id="CS_RMB" value="50" size="15" /> 个
                                  <select name="select" onChange='CS_RMB.value=this.value;'>
                                    <option value="0">快速选择</option>
                                    <option value="10">10</option>
                                    <option value="20">20</option>
                                    <option value="30">30</option>
                                    <option value="50">50</option>
                                    <option value="80">80</option>
                                    <option value="100">100</option>
                                    </select></td>
								<td><font color=red>1元=1金币</font></td>
							</tr>
						</table>
						</div>
						
						<div class="vip_xz"><span><b>使用网上银行付款</b></span></div>
						<div class="tsMb">
							<div class="kj" id="kj" style="display:">
							    <table class="reg_info zhifu" cellpadding="0" cellspacing="0">
                                                      <?php if(CS_ZfbFun==0){ ?>
								    <tr>
									    <th><input type="radio" id="alipay" name="rdbpay" value="alipay" <?php if(CS_PayFun==2) echo 'checked="checked"';?>/></th>
									    <td class="tdw"><label for="alipay"><img class="pic" src="images/zhifubao.gif" alt="支付宝" title="alipay" onClick="javascript:document.getElementById('alipay').checked = true;"></label></td>
									    <td><span>*推荐使用</span><br />支持国内所有银行卡付款，安全支付<br />网上支付 支付实时,实时结算</td>
								    </tr>
                                                      <?php } if(CS_TenFun==0){ ?>
                                                                    <tr>
									    <th><input type="radio" id="tenpay" name="rdbpay" value="tenpay" <?php if(CS_PayFun==3) echo 'checked="checked"';?>/></th>
									    <td class="tdw"><label for="tenpay"><img class="pic" src="images/tenpay.png" alt="财付通" title="Tenpay" onClick="javascript:document.getElementById('tenpay').checked = true;"/></label></td>
									    <td>支持国内所有银行卡付款，安全支付<br />网上支付 支付实时,实时结算</td>
								    </tr>
                                                      <?php } if(CS_YeeFun==0){ ?>
								    <tr>
									    <th style="border-bottom:none;"><input type="radio" id="yeepay" name="rdbpay" value="yeepay" <?php if(CS_PayFun==1) echo 'checked="checked"';?>/></th>
									    <td class="tdw" style="border-bottom:none;"><label for="yeepay"><img class="pic" src="images/yeepay.jpg" title="yeepay" alt="易宝支付" onClick="javascript:document.getElementById('yeepay').checked = true;" /></label></td>
									    <td style="border-bottom:none;">要通过银行网点进行汇款支付<br />交易订单处理的时间会比较久</td>
								    </tr>
                                                      <?php } ?>
							    </table>
						    </div>
					    </div>   
	<div style="padding-top:10px;margin-left:150px;"><span class="button-main"><span><button type="submit" id="paygo" >确定充值</button></span></span><div id="Msg"></div></div>
	</form>
					</div>
<?php }elseif($op=='vip'){ ?>
<script language="javascript">
$(document).ready(function(){
	$("#vipgo").click(function(){
	var CS_RMB=$("#CS_RMB").val();
	if(CS_RMB==''){
                alert("请选择升级时间！");
		return false;
	}else{
               alert('温馨提示：\n\t在网上支付过程中，请不要中途关闭页面，以免交易失败！');
	       return true;
        }
	});
});
</script>
	             <form action="pay.php" method="post">
				<div class="pay1">
					<div class="reg">
						<div class="vip_xz"><span><b>您当前级别：<font color=#ff6600><?php echo $cscms_vip?></font></b><?php if($cscms_vip=='VIP会员') echo '&nbsp;&nbsp;&nbsp;&nbsp;到期时间:<font color=#ff6600>'.$cscms_viptime.'</font>';?></span></div>
						<div class="kj">
						<table class="reg_info">
							<tr>
								<th><font color=red>*</font>升级时间：</th>
							  <td class="tdw">
							      <input type="radio" id="rmb1" name="CS_RMB" onclick="document.getElementById('xyjb').innerHTML='<?php echo CS_VipDs1?>';" value="30"/><label onclick="document.getElementById('rmb1').checked = true;document.getElementById('xyjb').innerHTML='<?php echo CS_VipDs1?>';">30天</label>&nbsp;&nbsp;
							      <input type="radio" id="rmb2" name="CS_RMB" onclick="document.getElementById('xyjb').innerHTML='<?php echo CS_VipDs2?>';" value="180" checked="checked"/><label onclick="document.getElementById('rmb2').checked = true;document.getElementById('xyjb').innerHTML='<?php echo CS_VipDs2?>';">180天</label>&nbsp;&nbsp;
							      <input type="radio" id="rmb3" name="CS_RMB" onclick="document.getElementById('xyjb').innerHTML='<?php echo CS_VipDs3?>';" value="365"/><label onclick="document.getElementById('rmb3').checked = true;document.getElementById('xyjb').innerHTML='<?php echo CS_VipDs3?>';">365天</label>&nbsp;&nbsp;
							  </td>
								<td><font color=red>3&nbsp;&nbsp;0天VIP&nbsp;--&nbsp;<?php echo CS_VipDs1?>个金币<br>180天VIP&nbsp;--&nbsp;<?php echo CS_VipDs2?>个金币<br>365天VIP&nbsp;--&nbsp;<?php echo CS_VipDs3?>个金币</font></td>
							</tr><input type="hidden" name="vip" value="1">
						</table>
						</div>
						
						<div class="vip_xz"><span id="wycc"><b><input onclick="document.getElementById('wy').checked = true;document.getElementById('wypay').style.display='';document.getElementById('jbpay').style.display='none';" type="radio" id="wy" name="pay" value="0" checked="checked"/>&nbsp;&nbsp;<a href="javascript:;" onclick="document.getElementById('wy').checked = true;document.getElementById('wypay').style.display='';document.getElementById('jbpay').style.display='none';">使用网上银行付款</a></b></span><span><b><input onclick="document.getElementById('jb').checked = true;document.getElementById('wypay').style.display='none';document.getElementById('jbpay').style.display='';" type="radio" id="jb" name="pay" value="1"/>&nbsp;&nbsp;<a href="javascript:;" onclick="document.getElementById('jb').checked = true;document.getElementById('wypay').style.display='none';document.getElementById('jbpay').style.display='';">使用金币付款</a></b></span></div>
						<div class="tsMb">
							<div class="kj">
							    <table class="reg_info zhifu" cellpadding="0" cellspacing="0" id="wypay" style="display:">
                                                      <?php if(CS_ZfbFun==0){ ?>
								    <tr>
									    <th><input type="radio" id="alipay" name="rdbpay" value="alipay" <?php if(CS_PayFun==2) echo 'checked="checked"';?>/></th>
									    <td class="tdw"><label for="alipay"><img class="pic" src="images/zhifubao.gif" alt="支付宝" title="alipay" onClick="javascript:document.getElementById('alipay').checked = true;"></label></td>
									    <td><span>*推荐使用</span><br />支持国内所有银行卡付款，安全支付<br />网上支付 支付实时,实时结算</td>
								    </tr>
                                                      <?php } if(CS_TenFun==0){ ?>
                                                                    <tr>
									    <th><input type="radio" id="tenpay" name="rdbpay" value="tenpay" <?php if(CS_PayFun==3) echo 'checked="checked"';?>/></th>
									    <td class="tdw"><label for="tenpay"><img class="pic" src="images/tenpay.png" alt="财付通" title="Tenpay" onClick="javascript:document.getElementById('tenpay').checked = true;"/></label></td>
									    <td>支持国内所有银行卡付款，安全支付<br />网上支付 支付实时,实时结算</td>
								    </tr>
                                                      <?php } if(CS_YeeFun==0){ ?>
								    <tr>
									    <th style="border-bottom:none;"><input type="radio" id="yeepay" name="rdbpay" value="yeepay" <?php if(CS_PayFun==1) echo 'checked="checked"';?>/></th>
									    <td class="tdw" style="border-bottom:none;"><label for="yeepay"><img class="pic" src="images/yeepay.jpg" title="yeepay" alt="易宝支付" onClick="javascript:document.getElementById('yeepay').checked = true;" /></label></td>
									    <td style="border-bottom:none;">要通过银行网点进行汇款支付<br />交易订单处理的时间会比较久</td>
								    </tr>
                                                      <?php } ?>
							    </table>
							    <table class="reg_info zhifu" cellpadding="0" cellspacing="0" id="jbpay" style="display:none">
								    <tr>
									    <th></th>
									    <td class="tdw"><h2>应付总价：<font id="xyjb" color=#ff6600><?php echo CS_VipDs2?></font> 个金币 </h2>
                                                                                 <br>您当前的金币为：<font color=#ff6600><?php echo $cscms_cion?></font>个 
                                                                            </td>
									    <td></td>
								    </tr>
							    </table>
						    </div>
					    </div>   
	<div style="padding-top:10px;margin-left:150px;"><span class="button-main"><span><button type="submit" id="vipgo" >确定升级</button></span></span><div id="Msg"></div></div>
	</form>
					</div>
<?php }else{ ?>
		<div class="main_nav2">
			<ul>
			       <li class="<?php if($id=='') echo 'nav2a_4';?>"><a href="?ac=pay&op=jl">全部记录</a></li>
			       <li class="<?php if($id==1) echo 'nav2a_4';?>"><a href="?ac=pay&op=jl&id=1">成功记录</a></li>
                               <li class="<?php if($id==2) echo 'nav2a_4';?>"><a href="?ac=pay&op=jl&id=2">失败记录</a></li>
			</ul>
		</div>

		<div  class="favoritesList">
      <?php
        $j=1;
	$sql="select * from ".Getdbname('pay')." where cs_user='".$cscms_name."'";
        if($id==2) $id=0;
        if(!empty($id)) $sql.=' and cs_pid='.$id;
        $sql.=' order by cs_addtime desc';
		$Arr=getuserpage($sql,"15");//sql,每页显示条数
		$result=$db->query($Arr[2]);
		$numdate="a";
		if($result){
			while ($row = $db ->fetch_array($result)){
		        $numdate="b";
                        if($row['CS_PID']==1){$jieguo='<font color=#0000ff>成功</font>';}else{$jieguo='<font color=red>失败</font>';}
                        if($row['CS_Type']=='vip'){$vip='(升级VIP)';}else{$vip='(充值金币)';}
                   echo '<li><span class="cbox">'.$j.'</span><span class="mname">'.$row['CS_Dingdan'].' -- '.$vip.'</span><span class="mclass" title="支付结果">'.$jieguo.'</span><span class="mtime" title="支付IP">'.$row['CS_Ip'].'</span><span class="mtime" title="支付时间">'.datetime($row['CS_AddTime']).'</span><span class="mdel" title="删除" onClick="Paydel('.$row["CS_ID"].');"></span></li>';

                        $j=$j+1;
	                }
                }
        if($numdate=="a") echo '<li>没有相关记录!</li>';
      ?>
		</ul>
		</div>
		<div class="page">
		<div class="pages">
                       <?php echo $Arr[0];?>
               </div>
<?php } ?>
	</div>
      </div>
    <div class="end"></div>
  </div>