<meta http-equiv="content-type" content="text/html;charset=utf8" />
<?php
error_reporting(0);
///////////////数据库配置//////////////////////
$dbip = '127.0.0.1';
$dbname ='s1';
$dbuser ='root';
$dbpass ='root';
///////////////以下都不要动////////////////////////
$tt = $_POST['t'];
$pID = $_POST['pID'];
$yb = $_POST['yb'];
$playerID = $_POST['playerID'];
$playerID = '';
$conn = mysql_connect($dbip,$dbuser,$dbpass);
mysql_query("set names 'utf8'");
if(!$conn){
die("连接数据库失败,请配置好!!!");
}
$db_select = mysql_select_db($dbname);
if(!$db_select){
die("连接数据库".$dbname."失败!请填写好数据库名~~~~");
}
$sql = "select * from player where puid ='".$pID."'";
$result = mysql_query($sql,$conn);
$row = mysql_fetch_array($result);
$playerID = $row['id'];
if('pay' == $tt){
$url = "http://127.0.0.1:5321/recharge?".urlencode("params=playerid:{$playerID};rechargeNum:{$yb}");
$ch = curl_init();
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ( $ch, CURLOPT_HEADER, 0);
curl_setopt ( $ch, CURLOPT_URL, $url . http_build_query($data));
$output = curl_exec( $ch );
$reset = json_decode($output);
if ($reset) {
echo "充值成功";
echo "<script>alert('充值成功');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
} else {
echo "充值失败";
echo "<script>alert('充值失败');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
}
curl_close($ch);
}
if("sq" == $tt){
if($json_string = file_get_contents('vip.json')){
$data = json_decode($json_string, true);
}else{
$arr = array();
$data = json_encode($arr);
file_put_contents('vip.json', $data);
$json_string = file_get_contents('vip.json');
$data = json_decode($json_string, true);
}
$b = count($data);
for( $i=0;$i<=$b;$i++ ){
if($pID == $data[$i]){
echo "<script>alert('已经添加过了!!!');history.go(-1)</script>";
exit;
}
}
$data[$b] = $pID;
$new = json_encode($data);
file_put_contents('vip.json', '');
file_put_contents('vip.json', $new);
fclose('vip.json');
}
if('mail' == $tt){
$itemid=$_POST['itemid'];
$itemnum=$_POST['itemnum'];
$url = "http://127.0.0.1:5321/changeplayer?".urlencode("params=playerid:{$playerID};type:5;value:{$itemid},{$itemnum}");
$ch = curl_init();
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ( $ch, CURLOPT_HEADER, 0);
curl_setopt ( $ch, CURLOPT_URL, $url . http_build_query($data));
$output = curl_exec( $ch );
$reset = json_decode($output);
if ($reset) {
echo "发送成功";
echo "<script>alert('发送成功');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
} else {
echo "发送失败";
echo "<script>alert('发送失败');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
}
curl_close($ch);
}
if('mail1' == $tt){
$reward=$_POST['reward'];
$itemnum=$_POST['itemnum'];
$url = "http://127.0.0.1:5321/playerreward?".urlencode("params=playerid:{$playerID};reward:{$reward}_{$itemnum};message:物品");
$ch = curl_init();
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ( $ch, CURLOPT_HEADER, 0);
curl_setopt ( $ch, CURLOPT_URL, $url . http_build_query($data));
$output = curl_exec( $ch );
$reset = json_decode($output);
if ($reset) {
echo "发送成功";
echo "<script>alert('发送成功');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
} else {
echo "发送失败";
echo "<script>alert('发送失败');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
}
curl_close($ch);
}
if('mail2' == $tt){
$type=$_POST['type'];
$num=$_POST['num'];
$url = "http://127.0.0.1:5321/changeplayer?".urlencode("params=playerid:{$playerID};type:{$type};value:{$num}");
$ch = curl_init();
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ( $ch, CURLOPT_HEADER, 0);
curl_setopt ( $ch, CURLOPT_URL, $url . http_build_query($data));
$output = curl_exec( $ch );
$reset = json_decode($output);
if ($reset) {
echo "发送成功";
echo "<script>alert('发送成功');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
} else {
echo "发送失败";
echo "<script>alert('发送失败');location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
}
curl_close($ch);
}
?>
<fieldset><legend>授权系统</legend>
<form method="post" action="">游戏账号:<input type="text" name="pID" value="" size="12">
<input type="hidden" value="sq" name="t">
<input type="submit" value="发送" name="t3"></form>
</fieldset>
<fieldset><legend>充值系统</legend>
<form method="post" action="">游戏账号:<input type="text" name="pID" value="" size="12">
<input type="text" name="yb" value="" size="12" placeholder="元宝数量">
<input type="hidden" value="pay" name="t">
<input type="submit" value="充值" name="t3"></form>
</fieldset>
<fieldset><legend>修改系统</legend>
<form method="post" action="">游戏账号:<input type="text" name="pID" value="" size="12">
<select name="type" id="city" class="city pickout" placeholder="选择修改项" value="">
<option data-icon='♂' type='radio' value='1'>元宝
</option><option data-icon='♂' type='radio' value='2'>金币
</option><option data-icon='♂' type='radio' value='3'>增加经验
</option><option data-icon='♂' type='radio' value='4'>增加弟子经验
</option><option data-icon='♂' type='radio' value='5'>道具
</option><option data-icon='♂' type='radio' value='6'>英雄
</option><option data-icon='♂' type='radio' value='7'>影子
</option><option data-icon='♂' type='radio' value='8'>装备
</option><option data-icon='♂' type='radio' value='9'>体力
</option><option data-icon='♂' type='radio' value='10'>精力
</option><option data-icon='♂' type='radio' value='11'>魂玉
</option><option data-icon='♂' type='radio' value='12'>能量
</option><option data-icon='♂' type='radio' value='13'>vip
</option><option data-icon='♂' type='radio' value='14'>个人军团贡献
</option><option data-icon='♂' type='radio' value='15'>军团贡献
</option><option data-icon='♂' type='radio' value='16'>竞技场积分
</option><option data-icon='♂' type='radio' value='17'>玩家精力上限
</option>
</select>
<input type="text" name="num" value="" size="12" placeholder="单位">
<input type="hidden" value="mail2" name="t">
<input type="submit" value="发送" name="t3"></form>
</fieldset>
<fieldset><legend>物品系统</legend>
<form method="post" action="">游戏账号:<input type="text" name="pID" value="" size="12">
<input type="text" name="itemid" value="" size="12" placeholder="物品ID">
<input type="text" name="itemnum" value="" size="12" placeholder="数量">
<input type="hidden" value="mail" name="t">
<input type="submit" value="发送" name="t3"></form>
</fieldset>
<fieldset><legend>邮件系统</legend>
<form method="post" action="">游戏账号:<input type="text" name="pID" value="" size="12">
<label for="city">选择道具:</label>
<select name="reward" id="city" class="city pickout" placeholder="选择道具" value="">
<option data-icon='♂' type='radio' value='61001_10015'>进阶圣水</option>
<option data-icon='♂' type='radio' value='61001_10013'>刷新卡
</option><option data-icon='♂' type='radio' value='41000_3101'>高级经验宝珠
</option><option data-icon='♂' type='radio' value='41000_3102'>高级经验引擎
</option><option data-icon='♂' type='radio' value='61001_20009'>布欧巧克力
</option><option data-icon='♂' type='radio' value='61001_20010'>战力探测器
</option><option data-icon='♂' type='radio' value='11001_1002'>金币
</option><option data-icon='♂' type='radio' value='11001_1001'>钻石
</option><option data-icon='♂' type='radio' value='61001_10034'>1000圣水
</option><option data-icon='♂'