<?php
require 'config.php';
if (empty($_POST)) $_POST = $_GET;  //如果为GET方式访问
$serverid = $_GET['serverId'];
//分区ID里包含s
if(strpos(strtolower($serverid),'s') !== false){ 
  $serverid = intval(str_replace("s","",$serverid));
}
$actorid = $_GET['actorid'];
$money = $_GET['amount'];
$db_name = $db[$serverid];
//查询角色名称
$conn = new mysqli(HOST,USER, PASS, $db_name,PORT);
// 检测连接
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}
$sql = "SELECT * FROM `actors` WHERE actorid = '{$actorid}'  limit 1";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$actorname = $row['actorname'];
//拼接参数（分区ID_角色ID_角色名称）
$account = $serverid."_".$actorid."_".$actorname;
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>游戏赞助页面</title>
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
	<!--引入阿里字体图标-->
	<link rel="stylesheet" type="text/css" href="static/css/iconfont.css" />
	<!--引入jquery-->
	<script src="static/js/jquery.min.js" charset="utf-8"></script>
	<!--引入jquery-weui框架-->
	<link rel="stylesheet" href="static/weui/css/weui.min.css">
	<link rel="stylesheet" href="static/weui/css/jquery-weui.min.css">
	<script src="static/weui/js/jquery-weui.min.js" charset="utf-8"></script>
	<link rel="stylesheet" href="static/css/pay.css" type="text/css">
</head>
<body class="center">
	<!--头部  star-->
	<!--<header>
		<div class="title-box">
			<a href="javascript:close();" class="title-left"><i class="iconfont" style="font-size:16px;">&#xe635;</i>返回游戏</a>
			<a class="title-center">游戏赞助页面</a>
			<a href="https://18pay.net/pay/query.html" class="title-right"><i class="iconfont" style="font-size:16px;">&#xe6b4;</i>订单查询</a>
		</div>
	</header>-->
	<!--头部 end-->
    <form action="<?php echo $payurl;?>" method="post">
        <div class="weui-pay">
            <h1 class="weui-payselect-title">充值金额</h1>
            <p class="weui-pay-num">￥<?php echo $money?>.00</p>
            <p class="weui-pay-info"><label class="label f-red b-red f16">充值角色 → 【<?php echo $actorname?>】</label></p>
            <!--支付 star-->
			<div class="pay-box">
				<div class="pay-box-cell">
					<li>
					<label>
					<img src="static/images/pay-zfb.jpg">
					<input name="paytype" value="1" type="radio" checked='true'>
					<span></span>
					</label> 
					</li>
					<li>
					<label>
					<img src="static/images/pay-wx.jpg">
					<input name="paytype" value="2" type="radio">
					<span></span>
					</label> 
					</li>
				</div>
			</div>
			<!--支付 end-->
            <div class="pay-div">
				<input type='hidden' name='hidetitle' value ='true'/>
                <input type='hidden' name='money' value ='<?php echo $money;?>'/>
                <input type='hidden' name='account' value ='<?php echo $account;?>'/>
                <button type="submit" class="weui-btn weui-btn_primary">立即支付</button>
            </div>
        </div>
    </form>
</body>
</html>