Files
2026-02-24 09:25:17 +08:00

57 lines
1.8 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/ip.php");
if($GG['del']){//ɾ³ýÈÕÖ¾
$db->deldate("AgentRecharge","Rid='".$GG['del']."'");
}
if($GG['remark'] && $GG['money']){
if($GG['pass']==$CONFIG['ADMIN']['pass']){
$save = [
"PayMoney"=>$GG['money'],
"remark"=>$GG['remark'],
"AddIP"=>$db->getip()
];
$db->insert("AgentRecharge",$save);
}
echo "<script>location.href='cw.php';</script>";
exit;
}
$money = intval($db->fetch_abc("select sum(PayMoney) from AgentRecharge where PayMoney>0"));
$pay = intval(abs($db->fetch_abc("select sum(PayMoney) from AgentRecharge where PayMoney<0")));
$GG['m'] = $GG['m'] ? $GG['m'] : date('Y-m');
$data = $db->fetch_all("select a.*,convert(char,a.AddDate,120) as Date,b.GameID,b.NickName from AgentRecharge as a LEFT JOIN AccountsInfo as b ON(a.UserID=b.UserID) where convert(varchar(7),a.AddDate,120)='".$GG['m']."' and a.PayMoney<>'0' order by Rid desc");
if($data){
foreach($data as $k=>$v){
$zz = $zz+$v['PayMoney'];
if($v['PayMoney']>0){
$zq = $zq+intval($v['PayMoney']);
$mk = $mk+intval($v['OperCount']);
}else{
$kx = $kx+intval(abs($v['PayMoney']));
}
$info[$k] = $v;
$info[$k]['pjz'] = $v['PayMoney']/$v['OperCount'];
}
}
for($y=0;$y<50;$y++){
$ye = date('Y-m',strtotime('-'.$y.' month'));
if($ye>'2019-10'){
$year[] = $ye;
}
}
$ppxq -> assign('year',$year);
$ppxq -> assign('data',$info);
$ppxq -> assign('info',['money'=>$money,'pay'=>$pay,'zz'=>$zz,'zq'=>$zq,'kx'=>$kx,'mk'=>$mk]);
$ppxq -> register_function('timename','timename');
$ppxq -> register_function('convertip','convertip');
$ppxq -> assign('GG',$GG);
$ppxq -> display('user/cw.tpl');
$db->close();
unset($GG,$ppxq,$db);
?>