All Data Structures Namespaces Files Functions Variables Pages
winner.php
Go to the documentation of this file.
<?php
define('CURSCRIPT', 'winner');
require './include/common.inc.php';
if(!isset($command)){$command = 'ref';}
if($command == 'info') {
$result = $db->query("SELECT * FROM {$tablepre}winners WHERE gid='$gnum' LIMIT 1");
$pdata = $db->fetch_array($result);
$pdata['gdate'] = floor($pdata['gtime']/3600).':'.floor($pdata['gtime']%3600/60).':'.($pdata['gtime']%60);
$pdata['gsdate'] = date("m/d/Y H:i:s",$pdata['gstime']);
$pdata['gedate'] = date("m/d/Y H:i:s",$pdata['getime']);
extract($pdata);
include GAME_ROOT.'./include/game.func.php';
init_playerdata();
init_profile();
} elseif($command == 'news') {
include GAME_ROOT.'./include/news.func.php';
$hnewsfile = GAME_ROOT."./gamedata/bak/{$gnum}_newsinfo.html";
if(file_exists($hnewsfile)){
$hnewsinfo = readover($hnewsfile);
}
} else {
if(!isset($start) || !$start){
$result = $db->query("SELECT gid,name,icon,gd,wep,wmode,getime,motto,hdp,hdmg,hkp,hkill FROM {$tablepre}winners ORDER BY gid desc LIMIT $winlimit");
} else {
$result = $db->query("SELECT gid,name,icon,gd,wep,wmode,getime,motto,hdp,hdmg,hkp,hkill FROM {$tablepre}winners WHERE gid<='$start' ORDER BY gid desc LIMIT $winlimit");
}
while($wdata = $db->fetch_array($result)) {
$wdata['date'] = date("Y-m-d",$wdata['getime']);
$wdata['time'] = date("H:i:s",$wdata['getime']);
$wdata['iconImg'] = $wdata['gd'] == 'f' ? 'f_'.$wdata['icon'].'.gif' : 'm_'.$wdata['icon'].'.gif';
$winfo[$wdata['gid']] = $wdata;
}
$listnum = floor($gamenum/$winlimit);
for($i=0;$i<$listnum;$i++) {
$snum = ($listnum-$i)*$winlimit;
$enum = $snum-$winlimit+1;
$listinfo .= "<input style='width: 120px;' type='button' value='{$snum} ~ {$enum} 回' onClick=\"document['list']['start'].value = '$snum'; document['list'].submit();\">";
if(is_int(($i+1)/3)&&$i){$listinfo .= '<br>';}
}
}
include template('winner');
?>
$i
$i
Definition: botservice.php:267
readover
readover($filename, $method="rb")
Definition: global.func.php:139
$db
$db
Definition: clear.php:32
$winlimit
$winlimit
Definition: system.php:36
elseif
【生存者数：<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
Definition: 1_alive.tpl.php:18
init_profile
init_profile()
Definition: game.func.php:32
GAME_ROOT
const GAME_ROOT
Definition: clear.php:6
$pdata
if(!$db->num_rows($result)) $pdata
Definition: botservice.php:18
$gamenum
$gamenum
Definition: gameinfo.php:3
$result
if(!$cuser||!$cpass) $result
Definition: admin.php:25
$start
$start
Definition: npcmng.php:12
init_playerdata
if(!defined('IN_GAME')) init_playerdata()
Definition: game.func.php:9