<script language="javascript">
$(document).ready(function(){
	$("#submit1").click(function(){
		var v_amount=$("#v_amount").val();
		var s_xid=$("#s_xid").val();
		$("#v_amount").css("border-color","#666 #ccc #ccc #666");
	        $("#Ss_xid").text("");
		if(v_amount==""){
			$("#v_amount").css("border","1px solid red");
			return false;
			};
		if(s_xid==""){
		   $("#Ss_xid").text("请选择支付方式").css("color","red");
		   jAlert("出错了，请选择支付方式！","操作提示");
		   return false;}
	});
});
</script>
<?php
$id=SafeRequest("id","get");
if($op==""){
$op="add";
}?>
 		<div class="userMain">
			<div class="uMain_title"><span class="pay">在线充值</span></div>
			<div class="uMain_content">
				<div class="stageBox">
					<div class="stageBoxTop"><span></span></div>
					<div class="stageBoxCenter">
						<div class="stageBoxCenterContent">
							<div class="main_nav">
								<ul>
									<li class="navb_4"><a href="?ac=pay&op=<?php if($chsh_usertype==1){echo'yue">月';}else{echo'dian">点';}?>卡列表</a></li>				 
									<li class="navb_4"><a href="?ac=pay&op=my">我的卡号</a></li>
									<li class="navb_4"><a href="?ac=change">在线升级</a></li>
									<li class="navb_4 <?php if($op=="add") echo 'nava_4'?>"><a href="?ac=paycz&op=add">在线充值</a></li>
									<li class="navb_4 <?php if($op=="list") echo 'nava_4'?>"><a href="?ac=paycz&op=list">定单查询</a></li>
								</ul>
															</div>
							<div class="minHeight500">
							<div class="main_nav2">
								<ul>
								<li <?php if($id==1){ echo "class='nav2a_4'";}else{ echo "";}?>><a href="?ac=paycz&op=list&id=1">失败定单</a></li>
								<li <?php if($id==2){ echo "class='nav2a_4'";}else{ echo "";}?>><a href="?ac=paycz&op=list&id=2">成功定单</a></li>
 
								</ul>
							</div>

<?php
if($op=="add"){
?>
								<div class="profile">
									<div class="title">
										<div class="name">在线充值</div>
									</div>
									<ul><form  name="form1" action="pay.php" method="post" target="_blank">
										<li>
											<div class="name">用户名：</div>
											<div class="input"><span class="nickname"><?php echo $chsh_username?></span></div>
										</li>
										<li>
											<div class="name">金额：</div>
											<div class="input"><input type="text" style="width:90px;" class="input_normal" name="v_amount" id="v_amount" value="50"  onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/><label id="tisih3"></label></div>
											<div class="input_msg" id="maddress">请输入充值金额，必须为整数。</div>
										</li>
										<li>
											<div class="name">支付方式：</div>
											<div class="input">
                                                                                                <?php if(S_WyFun==1){ ?>
                                                                                                <input type="radio" name="s_xid" id="s_xid" value="1" class="radio" <?php if(S_MrFun==1) echo "checked='checked'";?>/>网银在线&nbsp;
                                                                                                <?php }  if(S_ZfbFun==1){?>
                                                                                                <input type="radio" name="s_xid" id="s_xid" value="2" class="radio" <?php if(S_MrFun==4) echo "checked='checked'";?>/>支付宝&nbsp;
                                                                                                <?php }  if(S_TenFun==1){?>
                                                                                                <input type="radio" name="s_xid" id="s_xid" value="3" class="radio" <?php if(S_MrFun==2) echo "checked='checked'";?>/>财富通&nbsp;
                                                                                                <?php }  if(S_YeeFun==1){?>
                                                                                                <input type="radio" name="s_xid" id="s_xid" value="4" class="radio" <?php if(S_MrFun==3) echo "checked='checked'";?>/>易宝支付&nbsp;
                                                                                                <?php } ?>
											</div>
											<div class="input_msg" id="xid">请选择支付方式。</div>
										</li>
										<li>
											<div class="name"></div>
											<div class="input"><span class="button-main"><span><button type="submit" id="submit1" >确定充值</button></span></span></div>
										</li></form>
									</ul>
									<div class="pages"></div>
								</div>
															</div>
						</div>
					</div>
					<div class="stageBoxBottom"><span></span></div>
				</div>
			</div>
<?php
}elseif($op=="list"){
?>

								<div class="paylist"><ul>
<?php
$a=1;
	global $db;
if($id==1){
	$sql="select * from s_pay where S_Payuser ='".$chsh_username."' and S_Vid=0 order by s_id desc";
}else{
	$sql="select * from s_pay where S_Payuser ='".$chsh_username."' and S_Vid=1 order by s_id desc";
}
		$Arr=getuserpage($sql,"20");//sql,每页显示条数
		$result=$db->query($Arr[2]);
		$numdate="a";
		if($result){
			while ($row = $db ->fetch_array($result)){
		$numdate="b";
?>
<li>
<span class="cbox"><?php echo $a?>.</span>
<span class="mnamec">定单号：<font color="#0000ff"><?php echo $row["S_Payid"]?></font></span>
<span class="mclass">金额：<font color="#009966"><?php echo $row["S_Payrmb"]?></font></span>
<?php 
if($row["S_Vid"]==0){
?>
<span class="mclass">状态：<font color="#ff0000">失败</font></span>
<?php
}else{
?>
<span class="mclass">状态：<font color="#ff0000">成功</font></span>
<?php
}
?>
<span class="mnameb">时间：<?php echo $row["S_Paytime"]?></span>
</li>
<?php
$a=$a+1;
}
if($numdate=="a"){
		echo("<div class='nothing'>目前没有充值定单。</div>");
}
?>
</ul>																</div>
																<div class="page">
		
									<div class="pages"><?php echo $Arr[0];?></div>
								</div>
															</div>
						</div>
					</div>
					<div class="stageBoxBottom"><span></span></div>
				</div>
			</div>
<?php
}
}
?>