Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
winner.php
Go to the documentation of this file.
1 <?php
2 
3 define('CURSCRIPT', 'winner');
4 
5 require './include/common.inc.php';
6 if(!isset($command)){$command = 'ref';}
7 if($command == 'info') {
8  $result = $db->query("SELECT * FROM {$tablepre}winners WHERE gid='$gnum' LIMIT 1");
9  $pdata = $db->fetch_array($result);
10  $pdata['gdate'] = floor($pdata['gtime']/3600).':'.floor($pdata['gtime']%3600/60).':'.($pdata['gtime']%60);
11  $pdata['gsdate'] = date("m/d/Y H:i:s",$pdata['gstime']);
12  $pdata['gedate'] = date("m/d/Y H:i:s",$pdata['getime']);
13  extract($pdata);
14  include GAME_ROOT.'./include/game.func.php';
16  init_profile();
17 } elseif($command == 'news') {
18  include GAME_ROOT.'./include/news.func.php';
19  $hnewsfile = GAME_ROOT."./gamedata/bak/{$gnum}_newsinfo.html";
20  if(file_exists($hnewsfile)){
21  $hnewsinfo = readover($hnewsfile);
22  }
23 } else {
24  if(!isset($start) || !$start){
25  $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");
26  } else {
27  $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");
28  }
29  while($wdata = $db->fetch_array($result)) {
30  $wdata['date'] = date("Y-m-d",$wdata['getime']);
31  $wdata['time'] = date("H:i:s",$wdata['getime']);
32  $wdata['iconImg'] = $wdata['gd'] == 'f' ? 'f_'.$wdata['icon'].'.gif' : 'm_'.$wdata['icon'].'.gif';
33  $winfo[$wdata['gid']] = $wdata;
34  }
35  $listnum = floor($gamenum/$winlimit);
36 
37  for($i=0;$i<$listnum;$i++) {
38  $snum = ($listnum-$i)*$winlimit;
39  $enum = $snum-$winlimit+1;
40  $listinfo .= "<input style='width: 120px;' type='button' value='{$snum} ~ {$enum} 回' onClick=\"document['list']['start'].value = '$snum'; document['list'].submit();\">";
41  if(is_int(($i+1)/3)&&$i){$listinfo .= '<br>';}
42  }
43 }
44 
45 include template('winner');
46 
47 ?>
$i
Definition: botservice.php:267
readover($filename, $method="rb")
$db
Definition: clear.php:32
$winlimit
Definition: system.php:36
【生存者数:<?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()
Definition: game.func.php:32
const GAME_ROOT
Definition: clear.php:6
if(!$db->num_rows($result)) $pdata
Definition: botservice.php:18
$gamenum
Definition: gameinfo.php:3
if(!$cuser||!$cpass) $result
Definition: admin.php:25
$start
Definition: npcmng.php:12
if(!defined('IN_GAME')) init_playerdata()
Definition: game.func.php:9