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

117 lines
5.5 KiB
PHP

<?php
include_once("../../../inc/admin.inc.php");
include_once("../../../inc/class.php");
include_once("../../../inc/admin.smarty.php");
include_once("../../../inc/admin.power.php");
include_once("../../../inc/rule.php");
$db->links();
if($GG['delauto'] && $GG['id']){
$db->deldate("QPPlatformDB.dbo.UnionRoomInfo","id='".$GG['delauto']."'");
//$db->deldate("QPTreasureDB.dbo.GameUnionConsumer","UnionID='".$GG['id']."' and GameRule='".$GG['rule']."'");
echo "<script>location.href='gh-data.php?id=".$GG['id']."';</script>";
exit;
}
if($GG['qk'] == 'all' && $GG['id']){
$union = $db->fetch_one("select * from QPTreasureDB.dbo.GameUnion where UnionID='".$GG['id']."'");
$db->deldate("QPPlatformDB.dbo.UnionRoomInfo","UnionCode='".$union['UnionCode']."'");
$db->deldate("QPTreasureDB.dbo.GameUnionConsumer","(GameOK='2' or GameOK='1') and UnionID='".$GG['id']."'");
echo "<script>location.href='gh-data.php?id=".$GG['id']."';</script>";
exit;
}
if($GG['ucid'] && $GG['id']){
$db->deldate("QPTreasureDB.dbo.GameUnionConsumer","UnionConsumerID='".$GG['ucid']."'");
echo "<script>location.href='gh-data.php?id=".$GG['id']."';</script>";
exit;
}
if($GG['submit']){
if($GG['pass']==$CONFIG['ADMIN']['pass']){
if($GG['agent']){
$union = $db->fetch_one("select * from QPTreasureDB.dbo.GameUnion where UnionID='".$GG['id']."'");
if($union && $GG['fk']){
if($GG['je']>0){
$save = [
"UserID"=>$union['UserID'],
"UnionID"=>$GG['id'],
"PayMoney"=>$GG['je'],
"Price"=>sprintf("%.3f", $GG['je']/$GG['fk']),
"OperCount"=>$GG['fk'],
"AddIP"=>$db->getip()
];
$db->insert("AgentRecharge",$save);
}
$savea = [
"UnionID"=>$GG['id'],
"UserID"=>$union['UserID'],
"TypeCard"=>1,
"LeftCard"=>$union['UnionCard'],
"OperCard"=>$GG['fk']
];
$db->insert("QPTreasureDB.dbo.GameUnionCard",$savea);
$db->update('QPTreasureDB.dbo.GameUnion',["UnionCard"=>$union['UnionCard']+$GG['fk']],"UnionID='".$GG['id']."'");
echo "<script>location.href='gh-data.php?id=".$GG['id']."';</script>";
exit;
}else{
$ppxq -> assign('Edit_Error',"输入错误!");
}
}elseif($GG['limit']){
foreach ($GG['limit'] as $key => $val){
$db->update('QPTreasureDB.dbo.GameUnionKind',['UnionGoldLimit' => $val,'ScoreMultiple' => $GG['score'][$key],'GameGold' => $GG['gold'][$key]],"id='".$key."'");
}
echo "<script>location.href='gh-data.php?id=".$GG['id']."';</script>";
exit;
}
}else{
$ppxq -> assign('Edit_Error',"操作密码错误!");
}
}
$kind_arr = ['2'=>'牛牛','6'=>'炸金花','200'=>'斗地主','210'=>'跑得快','430'=>'打炸','502'=>'十三张','558'=>'麻将'];
if($GG['open']){
$union = $db->fetch_one("select * from QPTreasureDB.dbo.GameUnion where UnionID='".$GG['id']."'");
if($union){
if($union['UnionGoldOpen']){
$hsave=['UnionGoldOpen'=>0];
//关闭欢乐场
$db->deldate("QPTreasureDB.dbo.GameUnionKind","UnionID='".$union['UnionID']."'");
}else{
$hsave=['UnionGoldOpen'=>1];
//开启欢乐场
foreach ($kind_arr as $key => $val){
$db->insert("QPTreasureDB.dbo.GameUnionKind",['UnionID' => $union['UnionID'],
'KindID' => $key,
'UnionGoldLimit' => 100,
'ScoreMultiple' => 1,
'GameGold' => 3]);
}
}
$db->update('QPTreasureDB.dbo.GameUnion',$hsave,"UnionID='".$union['UnionID']."'");
}
echo "<script>location.href='gh-data.php?id=".$union['UnionID']."';</script>";
exit;
}
$ppxq -> assign('union',$union = $db->fetch_one("select a.*,c.GameID,c.NickName from QPTreasureDB.dbo.GameUnion as a LEFT JOIN AccountsInfo AS c ON(a.UserID=c.UserID) where a.UnionID='".$GG['id']."'"));
$ppxq -> assign('rec',$db->fetch_all("select top 10 *,convert(char,InsertTime,120) as Date from QPTreasureDB.dbo.GameUnionCard where UnionID='".$GG['id']."' order by UnionCardID desc"));
$ppxq -> assign('data',$db->fetch_all("select top 10 a.*,convert(char,a.InsertTime,120) as addTime,b.HeadHttp,c.NickName,d.NickName as Named,e.NickName as Namee,f.NickName as Namef,g.NickName as Nameg from QPTreasureDB.dbo.GameUnionConsumer as a LEFT JOIN IndividualDatum as b ON(a.UserIDa=b.UserID)
LEFT JOIN AccountsInfo AS c ON(a.UserIDa=c.UserID)
LEFT JOIN AccountsInfo AS d ON(a.UserIDb=d.UserID)
LEFT JOIN AccountsInfo AS e ON(a.UserIDc=e.UserID)
LEFT JOIN AccountsInfo AS f ON(a.UserIDd=f.UserID)
LEFT JOIN AccountsInfo AS g ON(a.UserIDe=g.UserID)
where a.UnionID='".$GG['id']."' order by GameOK asc,UnionConsumerID desc"));
$ppxq -> assign('kind_arr',$kind_arr);
$ppxq -> assign('kind',$db->fetch_all("select * from QPTreasureDB.dbo.GameUnionKind where UnionID='".$GG['id']."' order by id desc"));
$ppxq -> assign('gold',$db->fetch_all("select top 10 a.*,convert(char,a.InsertTime,120) as Date,c.GameID,c.NickName from QPTreasureDB.dbo.GameUnionGold as a LEFT JOIN AccountsInfo AS c ON(a.UserID=c.UserID) where a.UnionID='".$GG['id']."' order by UnionGoldID desc"));
$ppxq -> assign('day',$db->fetch_all("select top 10 * from QPTreasureDB.dbo.GameUnionDay where UnionID='".$GG['id']."' order by UnionDayID desc"));
$ppxq -> assign('month',$db->fetch_all("select top 10 * from QPTreasureDB.dbo.GameUnionMonth where UnionID='".$GG['id']."' order by UnionMonthID desc"));
$ppxq -> assign('auto',$auto = $db->fetch_all("select *,convert(char,CreateTime,120) as Date from QPPlatformDB.dbo.UnionRoomInfo where UnionCode='".$union['UnionCode']."' order by id desc"));
$ppxq -> assign('rule',$rule);
$ppxq -> register_function('timename','timename');
$ppxq -> assign('GG',$GG);
$ppxq -> display('user/gh-data.tpl');
$db->close();
unset($GG,$ppxq,$db);
?>