112 lines
4.4 KiB
PHP
112 lines
4.4 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");
|
||
|
|
|
||
|
|
|
||
|
|
if($GG['del']){
|
||
|
|
$db->deldate("QPTreasureDB.dbo.PrivateGameRecordChild","RecordChildID='".$GG['del']."'");
|
||
|
|
}
|
||
|
|
if($GG['hfm']){
|
||
|
|
$where = " where h.RoomID='".$GG['hfm']."'";
|
||
|
|
}
|
||
|
|
if($GG['kid']){
|
||
|
|
if($where){
|
||
|
|
$where = " and h.KindID='".$GG['kid']."'";
|
||
|
|
}else{
|
||
|
|
$where = " where h.KindID='".$GG['kid']."'";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
$table = "QPTreasureDB.dbo.PrivateGameRecordChild";
|
||
|
|
$sql = "SELECT top 50 a.RecordChildID,a.UserIDs,a.UserScore,convert(char,a.InsertTime,120) as Date,a.RecordID,a.Bj,h.KindID,h.RoomID
|
||
|
|
,(SELECT b.UserID,c.GameID,c.NickName,y.UnionName,d.HeadHttp FROM QPTreasureDB.dbo.PrivateGameRecordUserRecordID as b LEFT JOIN AccountsInfo as c ON(b.UserID=c.UserID) LEFT JOIN IndividualDatum as d ON(d.UserID=b.UserID) LEFT JOIN QPTreasureDB.dbo.GameScoreInfo AS x ON(b.UserID=x.UserID) LEFT JOIN QPTreasureDB.dbo.GameUnion As y ON(x.UnionID=y.UnionID) WHERE b.RecordID=a.RecordID order by b.InsertTime asc FOR XML PATH('')) AS StuList
|
||
|
|
FROM QPTreasureDB.dbo.PrivateGameRecordChild as a
|
||
|
|
LEFT JOIN QPTreasureDB.dbo.PrivateGameRecord AS h ON(a.RecordID=h.RecordID)
|
||
|
|
".$where." order by Date desc";
|
||
|
|
if($where){
|
||
|
|
$count = "select count(*) from ".$table." as a LEFT JOIN QPTreasureDB.dbo.PrivateGameRecord AS h ON(a.RecordID=h.RecordID) ".$where." ";
|
||
|
|
}else{
|
||
|
|
$count = "select count(*) from ".$table."";
|
||
|
|
}
|
||
|
|
$data = $db->page([
|
||
|
|
"sql"=>$sql,
|
||
|
|
"count"=>$count,
|
||
|
|
"key"=>"RecordChildID",
|
||
|
|
"table"=>$table,
|
||
|
|
"where"=>str_ireplace("a.","",$where),
|
||
|
|
"order"=>"RecordChildID desc",
|
||
|
|
"page"=>$GG['page'],
|
||
|
|
"pageSize"=>$GG['pagelist'] ? $GG['pagelist'] : 30
|
||
|
|
]);
|
||
|
|
//print_r($data['data']);
|
||
|
|
//exit;
|
||
|
|
if($data['data']){
|
||
|
|
foreach($data['data'] as $k => $v){
|
||
|
|
$info[$k]['data'] = $v;
|
||
|
|
$info[$k]['data']['Score'] = explode(",",$v['UserScore']);
|
||
|
|
if($v['StuList']){
|
||
|
|
$v['StuList'] = str_replace("<UserID>0</UserID>","",$v['StuList']);
|
||
|
|
$userstr = [];
|
||
|
|
$arr = explode("</HeadHttp>",$v['StuList']);
|
||
|
|
foreach($arr as $ka => $va){
|
||
|
|
if($va){
|
||
|
|
//$userstr[] = str_replace(['</UserID>','</GameID>','</NickName>','<GameID>','<UserID>','<NickName>','<HeadHttp>'],['</>','</>','</>','','','',''],$va);
|
||
|
|
$userstr[] = str_replace(['</UserID>','</GameID>','</NickName>','</UnionName>','<GameID>','<UserID>','<NickName>','<HeadHttp>','<UnionName>'],['</>','</>','</>','</>','','','','','',''],$va);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if($userstr){
|
||
|
|
foreach($userstr as $kb => $vb){
|
||
|
|
$user_str = explode('</>',$vb);
|
||
|
|
if(!$user_str[0]){
|
||
|
|
$info[$k]['users'][$kb]['UserID'] = '';
|
||
|
|
$info[$k]['users'][$kb]['GameID'] = '';
|
||
|
|
$info[$k]['users'][$kb]['NickName'] = '';
|
||
|
|
$info[$k]['users'][$kb]['UnionName'] = '';
|
||
|
|
$info[$k]['users'][$kb]['HeadHttp'] = '';
|
||
|
|
$kb++;
|
||
|
|
array_shift($user_str);
|
||
|
|
}
|
||
|
|
$info[$k]['users'][$kb]['UserID'] = $user_str[0];
|
||
|
|
$info[$k]['users'][$kb]['GameID'] = $user_str[1];
|
||
|
|
$info[$k]['users'][$kb]['NickName'] = $user_str[2];
|
||
|
|
$info[$k]['users'][$kb]['UnionName'] = $user_str[4] ? $user_str[3] : "";
|
||
|
|
$info[$k]['users'][$kb]['HeadHttp'] = $user_str[4] ? $user_str[4] : $user_str[3];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//$info[$k]['users'] = $userstr;
|
||
|
|
}else{
|
||
|
|
$info[$k]['users'] = [];
|
||
|
|
}
|
||
|
|
if($GG['hfm']){
|
||
|
|
$zf[0] = $zf[0]+$info[$k]['data']['Score'][0];
|
||
|
|
$zf[1] = $zf[1]+$info[$k]['data']['Score'][1];
|
||
|
|
$zf[2] = $zf[2]+$info[$k]['data']['Score'][2];
|
||
|
|
$zf[3] = $zf[3]+$info[$k]['data']['Score'][3];
|
||
|
|
$zf[4] = $zf[4]+$info[$k]['data']['Score'][4];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if($GG['hfm']){
|
||
|
|
$uids = explode(',',$data['data'][0]['UserIDs']);
|
||
|
|
foreach($uids as $kz => $vz){
|
||
|
|
$users[$kz] = $db->fetch_one("SELECT c.UserID,c.GameID,c.NickName,y.UnionName,d.HeadHttp FROM AccountsInfo as c LEFT JOIN IndividualDatum as d ON(c.UserID=d.UserID) LEFT JOIN QPTreasureDB.dbo.GameScoreInfo AS x ON(c.UserID=x.UserID) LEFT JOIN QPTreasureDB.dbo.GameUnion As y ON(x.UnionID=y.UnionID) WHERE c.UserID='".$vz."'");
|
||
|
|
}
|
||
|
|
$ppxq -> assign('users',$users);
|
||
|
|
}
|
||
|
|
//print_r($users);exit;
|
||
|
|
}
|
||
|
|
//print_r($info);exit;
|
||
|
|
|
||
|
|
$ppxq -> register_function('timename','timename');
|
||
|
|
$ppxq -> assign('Pagenum',pages());
|
||
|
|
$ppxq -> assign('data',$info);
|
||
|
|
$ppxq -> assign('zf',$zf);
|
||
|
|
$ppxq -> assign('dbsjc',time()-86400*4);
|
||
|
|
$ppxq -> assign('Link',"pagelist=".$GG['pagelist']."&kid=".$GG['kid']."&key=".$GG['key']."&order=".$GG['order']);
|
||
|
|
$ppxq -> assign('Pages',$data['page']);
|
||
|
|
$ppxq -> assign('GG',$GG);
|
||
|
|
$ppxq -> display('user/log.tpl');
|
||
|
|
$db->close();
|
||
|
|
unset($GG,$ppxq,$db);
|
||
|
|
?>
|