Files
wnmj/GonghuiWeb/www/adminxx/user/add.php
2026-02-24 09:25:17 +08:00

89 lines
5.2 KiB
PHP

<?php
include_once("../../../inc/admin.inc.php");
include_once("../../../inc/admin.config.php");
include_once("../../../inc/class.php");
include_once("../../../inc/admin.smarty.php");
include_once("../../../inc/admin.power.php");
include_once("../../../inc/ip.php");
include_once("../../../inc/rule.php");
$GG=$db->getpost($GG,"id|num,sy|num,yx|num,jy|num");
if($GG['submit']){
if($GG['pass']==$CONFIG['ADMIN']['pass']){
if($GG['agent']){
$info = $db->fetch_one("select * from QPTreasureDB.dbo.GameScoreInfo where UserID='".$GG['id']."'");
if($info){
$save = [
"UserID"=>$GG['id'],
"PayMoney"=>$GG['je'],
"Price"=>sprintf("%.3f", $GG['je']/$GG['fk']),
"LeftCount"=>$info['InsureScore'],
"OperCount"=>$GG['fk'],
"AddIP"=>$db->getip()
];
$db->insert("AgentRecharge",$save);
$savea = [
"InsureScore"=>$info['InsureScore']+$GG['fk'],
"AgentMoney"=>$info['AgentMoney']+$GG['je']
];
$db->update('QPTreasureDB.dbo.GameScoreInfo',$savea,"UserID='".$GG['id']."'");
echo "<script>location.href='add.php?id=".$GG['id']."&ok=ok';</script>";
exit;
}else{
$ppxq -> assign('Edit_Error',"获取数据错误!");
}
}else{
$save = [
"InsureScore"=>$GG['sy'],
"PlayCount"=>$GG['yx'],
"AgentMoney"=>$GG['czje'],
"Grade"=>$GG['jy'],
"LotteryGame"=>$GG['cjjs'],
"UnionID"=>$GG['unionid'],
"YuanBao"=>$GG['yuanbao']
];
$db->update('QPTreasureDB.dbo.GameScoreInfo',$save,"UserID='".$GG['id']."'");
$ssav = [
'Nullity' => $GG['dj'] ? 1 : 0,
'SpreaderID' => $GG['dl'] ? 1 : 0,
'Remark' => $GG['remark']
];
$db->update('AccountsInfo',$ssav,"UserID='".$GG['id']."'");
}
$ppxq -> assign('Edit_Ok',"修改成功!");
}else{
$ppxq -> assign('Edit_Error',"操作密码错误!");
}
}
if($GG['ok']){
$ppxq -> assign('Edit_Ok',"充值成功!");
}
$info = $db->fetch_one("select a.UserID,a.GameID,a.NickName,a.Nullity,a.WXShareTimes,a.SpreaderID,a.Gender,a.LastLogonIP,a.RegisterIP,a.Remark,b.HeadHttp,c.ConsumeScore,c.InsureScore,c.PlayCount,c.AgentMoney,c.Grade,c.YuanBao,c.LotteryHit,c.LotteryGame,c.Zjf,convert(char,a.RegisterDate,120) as RegDate,convert(char,a.LastLogonDate,120) as LastDate,d.UnionID,d.UnionName from AccountsInfo as a LEFT JOIN IndividualDatum as b ON(a.UserID=b.UserID) LEFT JOIN QPTreasureDB.dbo.GameScoreInfo AS c ON(a.UserID=c.UserID) LEFT JOIN QPTreasureDB.dbo.GameUnion As d ON(c.UnionID=d.UnionID) where a.UserID='".$GG['id']."'");
$data = $db->fetch_all("select top 10 a.*,convert(char,a.InsertTime,120) as Date,b.GameID,b.NickName,d.UnionID,d.UnionName from QPTreasureDB.dbo.PayToPlayerLog as a LEFT JOIN AccountsInfo as b ON(a.UserID=b.UserID) LEFT JOIN QPTreasureDB.dbo.GameScoreInfo AS c ON(a.UserID=c.UserID) LEFT JOIN QPTreasureDB.dbo.GameUnion As d ON(c.UnionID=d.UnionID) where a.ToID='".$GG['id']."' order by ID desc");
//if($info['SpreaderID']){//代理充值
$ppxq -> assign('rec', $db->fetch_all("select top 10 *,convert(char,AddDate,120) as Date from AgentRecharge where UserID='".$GG['id']."' order by Rid desc"));
$ppxq -> assign('ghrec', $db->fetch_all("select top 10 *,convert(char,InsertTime,120) as Date from QPTreasureDB.dbo.GameUnionCard where UserID='".$GG['id']."' order by UnionCardID desc"));
$ppxq -> assign('log', $log = $db->fetch_all("select top 10 a.*,convert(char,a.InsertTime,120) as Date,b.GameID,b.UserID,b.NickName,d.UnionID,d.UnionName from QPTreasureDB.dbo.PayToPlayerLog as a LEFT JOIN AccountsInfo as b ON(a.ToID=b.UserID) LEFT JOIN QPTreasureDB.dbo.GameScoreInfo AS c ON(b.UserID=c.UserID) LEFT JOIN QPTreasureDB.dbo.GameUnion As d ON(c.UnionID=d.UnionID) where a.UserID='".$GG['id']."' order by ID desc"));
//}
//公会
$ppxq -> assign('union', $db->fetch_all("select * from QPTreasureDB.dbo.GameUnion order by UnionID asc"));
//普通开房记录
$ppxq -> assign('ptkf', $db->fetch_all("select top 5 *,convert(char,CostTime,120) as Date from QPTreasureDB.dbo.GameScoreLog where UserID='".$GG['id']."' order by id desc"));
//公会开房记录
if($info['UnionID']){
$ppxq -> assign('ghkf', $db->fetch_all("select top 5 a.*,convert(char,a.InsertTime,120) as addTime,g.UnionName,g.UnionCard,g.UnionCode from QPTreasureDB.dbo.GameUnionConsumer as a LEFT JOIN QPTreasureDB.dbo.GameUnion AS g ON(a.UnionID=g.UnionID) where a.UserIDa='".$GG['id']."' or a.UserIDb='".$GG['id']."' or a.UserIDc='".$GG['id']."' or a.UserIDd='".$GG['id']."' or a.UserIDe='".$GG['id']."' order by UnionConsumerID desc"));
}
//操作记录
$ppxq -> assign('czjl', $db->fetch_all("select top 10 a.*,convert(char,a.EnterTime,120) as eDate,convert(char,a.LeaveTime,120) as lDate,b.ServerName from QPTreasureDB.dbo.RecordUserInout as a LEFT JOIN QPPlatformDB.dbo.GameRoomInfo as b ON(a.ServerID=b.ServerID) where a.UserID='".$GG['id']."' order by ID desc"));
$ppxq -> assign('rule',$rule);
//print_r($data);exit;
$ppxq -> register_function('timename','timename');
$ppxq -> register_function('convertip','convertip');
$ppxq -> assign('toux', $info['HeadHttp'] ? $info['HeadHttp'] : '/m/img/toux.jpg');
$ppxq -> assign('info',$info);
$ppxq -> assign('data',$data);
$ppxq -> assign('GG',$GG);
$ppxq -> assign('md5',md5("wn".date('Ym')."mj".$info['GameID']));
$ppxq -> display('user/add.tpl');
$db->close();
unset($GG,$ppxq,$db);
?>